aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mailbox/qcom-apcs-ipc-mailbox.c
diff options
context:
space:
mode:
authorStephan Gerhold <[email protected]>2025-05-06 13:10:09 +0000
committerJassi Brar <[email protected]>2025-05-29 15:01:35 +0000
commitd0b497df02e9b2ebcb5771c7b16e424c0614a366 (patch)
tree9de8ff84002e17fb5501a8042c04e2e3a6893bff /drivers/mailbox/qcom-apcs-ipc-mailbox.c
parentdt-bindings: mailbox: qcom,apcs: Add separate node for clock-controller (diff)
downloadkernel-d0b497df02e9b2ebcb5771c7b16e424c0614a366.tar.gz
kernel-d0b497df02e9b2ebcb5771c7b16e424c0614a366.zip
mailbox: qcom-apcs-ipc: Assign OF node to clock controller child device
Currently, the child device for the clock controller inside the APCS block is created without any OF node assigned, so the drivers need to rely on the parent device for obtaining any resources. Add support for defining the clock controller inside a "clock-controller" subnode to break up circular dependencies between the mailbox and required parent clocks of the clock controller. For backwards compatibility, if the subnode is not defined, reuse the OF node from the parent device. Signed-off-by: Stephan Gerhold <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
Diffstat (limited to 'drivers/mailbox/qcom-apcs-ipc-mailbox.c')
-rw-r--r--drivers/mailbox/qcom-apcs-ipc-mailbox.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
index 11c41e935a36..8b24ec0fa191 100644
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
@@ -116,10 +116,18 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
}
if (apcs_data->clk_name) {
- apcs->clk = platform_device_register_data(&pdev->dev,
- apcs_data->clk_name,
- PLATFORM_DEVID_AUTO,
- NULL, 0);
+ struct device_node *np = of_get_child_by_name(pdev->dev.of_node,
+ "clock-controller");
+ struct platform_device_info pdevinfo = {
+ .parent = &pdev->dev,
+ .name = apcs_data->clk_name,
+ .id = PLATFORM_DEVID_AUTO,
+ .fwnode = of_fwnode_handle(np) ?: pdev->dev.fwnode,
+ .of_node_reused = !np,
+ };
+
+ apcs->clk = platform_device_register_full(&pdevinfo);
+ of_node_put(np);
if (IS_ERR(apcs->clk))
dev_err(&pdev->dev, "failed to register APCS clk\n");
}