From 284da55bbdc95cdad0d3a9906580bd56478927e6 Mon Sep 17 00:00:00 2001 From: Naveen Kaje Date: Wed, 26 Mar 2014 09:54:29 -0600 Subject: [PATCH] msm-slim-ngd: Read configurable external modem identifier When an external modem is used, read the config from dt and use the value in subsystem restart callback registration. CRs-Fixed: 612775 Change-Id: I5e40e98a60c304c82741914157191cfb2f0697d5 Signed-off-by: Naveen Kaje --- .../devicetree/bindings/slimbus/slim-msm-ctrl.txt | 8 ++++---- drivers/slimbus/slim-msm-ngd.c | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/slimbus/slim-msm-ctrl.txt b/Documentation/devicetree/bindings/slimbus/slim-msm-ctrl.txt index e199e551da2..d25b4560b62 100644 --- a/Documentation/devicetree/bindings/slimbus/slim-msm-ctrl.txt +++ b/Documentation/devicetree/bindings/slimbus/slim-msm-ctrl.txt @@ -54,11 +54,11 @@ Optional property: are to be used, so that application processor can query logical address of the ported generic device to be used. Other than PC, fields of EA are same across platforms. - -qcom,slim-mdm: This value indicates presence of slimbus component on + - qcom,slim-mdm: This value provides the identifier of slimbus component on external mdm. This property enables the slimbus driver to - receive subsytem restart notification from mdm and follow - appropriate steps to ensure communication on the bus can be - resumed after mdm-restart. + register and receive subsytem restart notification from mdm + and follow appropriate steps to ensure communication on the bus + can be resumed after mdm-restart. Example: slim@fe12f000 { cell-index = <1>; diff --git a/drivers/slimbus/slim-msm-ngd.c b/drivers/slimbus/slim-msm-ngd.c index f3b35815077..f591be28aba 100644 --- a/drivers/slimbus/slim-msm-ngd.c +++ b/drivers/slimbus/slim-msm-ngd.c @@ -1205,6 +1205,7 @@ static int __devinit ngd_slim_probe(struct platform_device *pdev) struct resource *irq, *bam_irq; bool rxreg_access = false; bool slim_mdm = false; + const char *ext_modem_id = NULL; slim_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "slimbus_physical"); @@ -1265,8 +1266,10 @@ static int __devinit ngd_slim_probe(struct platform_device *pdev) &dev->pdata.apps_pipes); of_property_read_u32(pdev->dev.of_node, "qcom,ea-pc", &dev->pdata.eapc); - slim_mdm = of_property_read_bool(pdev->dev.of_node, - "qcom,slim-mdm"); + ret = of_property_read_string(pdev->dev.of_node, + "qcom,slim-mdm", &ext_modem_id); + if (!ret) + slim_mdm = true; } else { dev->ctrl.nr = pdev->id; } @@ -1341,7 +1344,7 @@ static int __devinit ngd_slim_probe(struct platform_device *pdev) if (slim_mdm) { dev->mdm.nb.notifier_call = mdm_ssr_notify_cb; - dev->mdm.ssr = subsys_notif_register_notifier("external_modem", + dev->mdm.ssr = subsys_notif_register_notifier(ext_modem_id, &dev->mdm.nb); if (IS_ERR_OR_NULL(dev->mdm.ssr)) dev_err(dev->dev,