]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bus: ti-sysc: allow reset sharing across devices
authorTero Kristo <t-kristo@ti.com>
Wed, 7 Aug 2019 12:46:05 +0000 (15:46 +0300)
committerTony Lindgren <tony@atomide.com>
Tue, 13 Aug 2019 11:32:15 +0000 (04:32 -0700)
Some devices need to share their reset signals, like DSP MMUs, thus drop
the exclusive notation from reset request. Also, balance the init time
reset count, otherwise the resets will never be applied post boot.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/bus/ti-sysc.c

index 6d34ccb914e08bb774480c39790d8e95971405f1..ffe62a0002b22246f40c8e5fc23d4082ea9eed6f 100644 (file)
@@ -501,7 +501,7 @@ static void sysc_clkdm_allow_idle(struct sysc *ddata)
 static int sysc_init_resets(struct sysc *ddata)
 {
        ddata->rsts =
-               devm_reset_control_get_optional(ddata->dev, "rstctrl");
+               devm_reset_control_get_optional_shared(ddata->dev, "rstctrl");
        if (IS_ERR(ddata->rsts))
                return PTR_ERR(ddata->rsts);
 
@@ -1527,7 +1527,7 @@ static int sysc_legacy_init(struct sysc *ddata)
  */
 static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset)
 {
-       int error, val;
+       int error;
 
        if (!ddata->rsts)
                return 0;
@@ -1538,7 +1538,9 @@ static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset)
                        return error;
        }
 
-       return reset_control_deassert(ddata->rsts);
+       reset_control_deassert(ddata->rsts);
+
+       return 0;
 }
 
 /*
@@ -2415,6 +2417,10 @@ static int sysc_probe(struct platform_device *pdev)
                goto unprepare;
        }
 
+       /* Balance reset counts */
+       if (ddata->rsts)
+               reset_control_assert(ddata->rsts);
+
        sysc_show_registers(ddata);
 
        ddata->dev->type = &sysc_device_type;