diff options
author | Georgi Djakov <georgi.djakov@linaro.org> | 2017-12-05 10:46:57 -0500 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2018-02-04 01:46:23 -0500 |
commit | c815d769b598196bdbd104a7e049d07ae6fba0d2 (patch) | |
tree | 66ca88d4e7483f9725db97a95166ed96f95e6733 | |
parent | c6a8b171ca8e338a3012420041346f0e50f7f649 (diff) |
mailbox: qcom: Create APCS child device for clock controller
There is a clock controller functionality provided by the APCS hardware
block of msm8916 devices. The device-tree would represent an APCS node
with both mailbox and clock provider properties.
Create a platform child device for the clock controller functionality so
the driver can probe and use APCS as parent.
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r-- | drivers/mailbox/qcom-apcs-ipc-mailbox.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c index ab344bc6fa63..57bde0dfd12f 100644 --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c | |||
@@ -29,6 +29,7 @@ struct qcom_apcs_ipc { | |||
29 | 29 | ||
30 | struct regmap *regmap; | 30 | struct regmap *regmap; |
31 | unsigned long offset; | 31 | unsigned long offset; |
32 | struct platform_device *clk; | ||
32 | }; | 33 | }; |
33 | 34 | ||
34 | static const struct regmap_config apcs_regmap_config = { | 35 | static const struct regmap_config apcs_regmap_config = { |
@@ -96,6 +97,14 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) | |||
96 | return ret; | 97 | return ret; |
97 | } | 98 | } |
98 | 99 | ||
100 | if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) { | ||
101 | apcs->clk = platform_device_register_data(&pdev->dev, | ||
102 | "qcom-apcs-msm8916-clk", | ||
103 | -1, NULL, 0); | ||
104 | if (IS_ERR(apcs->clk)) | ||
105 | dev_err(&pdev->dev, "failed to register APCS clk\n"); | ||
106 | } | ||
107 | |||
99 | platform_set_drvdata(pdev, apcs); | 108 | platform_set_drvdata(pdev, apcs); |
100 | 109 | ||
101 | return 0; | 110 | return 0; |
@@ -104,8 +113,10 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) | |||
104 | static int qcom_apcs_ipc_remove(struct platform_device *pdev) | 113 | static int qcom_apcs_ipc_remove(struct platform_device *pdev) |
105 | { | 114 | { |
106 | struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev); | 115 | struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev); |
116 | struct platform_device *clk = apcs->clk; | ||
107 | 117 | ||
108 | mbox_controller_unregister(&apcs->mbox); | 118 | mbox_controller_unregister(&apcs->mbox); |
119 | platform_device_unregister(clk); | ||
109 | 120 | ||
110 | return 0; | 121 | return 0; |
111 | } | 122 | } |