From patchwork Thu Oct 8 23:21:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 7357011 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A659A9F54C for ; Thu, 8 Oct 2015 23:21:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF724205F1 for ; Thu, 8 Oct 2015 23:21:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E40A920796 for ; Thu, 8 Oct 2015 23:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934204AbbJHXVO (ORCPT ); Thu, 8 Oct 2015 19:21:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39795 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932532AbbJHXVN (ORCPT ); Thu, 8 Oct 2015 19:21:13 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id D2B3B141086; Thu, 8 Oct 2015 23:21:12 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id B9CCB14108C; Thu, 8 Oct 2015 23:21:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0E2B1141086; Thu, 8 Oct 2015 23:21:11 +0000 (UTC) Date: Thu, 8 Oct 2015 16:21:11 -0700 From: Stephen Boyd To: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, edubezval@gmail.com, srinivas.kandagatla@linaro.org, nrajan@codeaurora.org, lina.iyer@linaro.org, punit.agrawal@arm.com Subject: Re: [PATCH v3 4/9] clk: qcom: create virtual child device for TSENS Message-ID: <20151008232110.GK26883@codeaurora.org> References: <1444280468-17159-1-git-send-email-rnayak@codeaurora.org> <1444280468-17159-5-git-send-email-rnayak@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1444280468-17159-5-git-send-email-rnayak@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/08, Rajendra Nayak wrote: > 8960 family of devices have TSENS as part of GCC in hardware. > Hence DT would represent a GCC node with GCC properties as well > as TSENS. Create a virtual platform child device here for TSENS > so the driver can probe it and use the parent (GCC) to extract DT > properties. > > Suggested-by: Stephen Boyd > Signed-off-by: Rajendra Nayak > --- Applied to clk-next with some massaging. Is there going to be an update to the gcc binding too? ---8<---- From: Rajendra Nayak Subject: [PATCH] clk: qcom: create virtual child device for TSENS 8960 family of devices have TSENS as part of GCC in hardware. Hence DT would represent a GCC node with GCC properties as well as TSENS. Create a virtual platform child device here for TSENS so the driver can probe it and use the parent (GCC) to extract DT properties. Suggested-by: Stephen Boyd Signed-off-by: Rajendra Nayak [sboyd@codeaurora.org: Massaged to work with devm friendly qcom_cc_probe()] Signed-off-by: Stephen Boyd --- drivers/clk/qcom/gcc-msm8960.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-msm8960.c b/drivers/clk/qcom/gcc-msm8960.c index b52153903893..66c18bc97857 100644 --- a/drivers/clk/qcom/gcc-msm8960.c +++ b/drivers/clk/qcom/gcc-msm8960.c @@ -3506,6 +3506,8 @@ static int gcc_msm8960_probe(struct platform_device *pdev) struct clk *clk; struct device *dev = &pdev->dev; const struct of_device_id *match; + struct platform_device *tsens; + int ret; match = of_match_device(gcc_msm8960_match_table, &pdev->dev); if (!match) @@ -3520,11 +3522,26 @@ static int gcc_msm8960_probe(struct platform_device *pdev) if (IS_ERR(clk)) return PTR_ERR(clk); - return qcom_cc_probe(pdev, match->data); + ret = qcom_cc_probe(pdev, match->data); + if (ret) + return ret; + + tsens = platform_device_register_data(&pdev->dev, "qcom-tsens", -1, + NULL, 0); + if (IS_ERR(tsens)) + return PTR_ERR(tsens); + + platform_set_drvdata(pdev, tsens); + + return 0; } static int gcc_msm8960_remove(struct platform_device *pdev) { + struct platform_device *tsens = platform_get_drvdata(pdev); + + platform_device_unregister(tsens); + return 0; }