Commit c815d769 authored by Georgi Djakov's avatar Georgi Djakov Committed by Jassi Brar

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: default avatarGeorgi Djakov <georgi.djakov@linaro.org>
Acked-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent c6a8b171
...@@ -29,6 +29,7 @@ struct qcom_apcs_ipc { ...@@ -29,6 +29,7 @@ struct qcom_apcs_ipc {
struct regmap *regmap; struct regmap *regmap;
unsigned long offset; unsigned long offset;
struct platform_device *clk;
}; };
static const struct regmap_config apcs_regmap_config = { static const struct regmap_config apcs_regmap_config = {
...@@ -96,6 +97,14 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) ...@@ -96,6 +97,14 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
return ret; return ret;
} }
if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) {
apcs->clk = platform_device_register_data(&pdev->dev,
"qcom-apcs-msm8916-clk",
-1, NULL, 0);
if (IS_ERR(apcs->clk))
dev_err(&pdev->dev, "failed to register APCS clk\n");
}
platform_set_drvdata(pdev, apcs); platform_set_drvdata(pdev, apcs);
return 0; return 0;
...@@ -104,8 +113,10 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) ...@@ -104,8 +113,10 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
static int qcom_apcs_ipc_remove(struct platform_device *pdev) static int qcom_apcs_ipc_remove(struct platform_device *pdev)
{ {
struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev); struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev);
struct platform_device *clk = apcs->clk;
mbox_controller_unregister(&apcs->mbox); mbox_controller_unregister(&apcs->mbox);
platform_device_unregister(clk);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment