diff options
author | Rajendra Nayak <rnayak@codeaurora.org> | 2015-10-08 10:31:03 +0530 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-10-08 23:53:03 -0700 |
commit | 53c929c922ccc5e615c3310e86ffbc1387372854 (patch) | |
tree | a24a52f5b9baea505abbe4c0e1cec8ad5d0ce2bb /drivers/clk/qcom | |
parent | 73bb7dc08edd921953f7b720b54e5dcb15ee0a02 (diff) | |
download | linux-53c929c922ccc5e615c3310e86ffbc1387372854.tar.gz linux-53c929c922ccc5e615c3310e86ffbc1387372854.tar.bz2 linux-53c929c922ccc5e615c3310e86ffbc1387372854.zip |
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 <sboyd@codeaurora.org>
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
[sboyd@codeaurora.org: Massaged to work with devm friendly
qcom_cc_probe()]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/qcom')
-rw-r--r-- | drivers/clk/qcom/gcc-msm8960.c | 19 |
1 files changed, 18 insertions, 1 deletions
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; } |