Commit bb88b86c1f623e079968c6b8799989019c5f8413
Committed by
Tony Lindgren
1 parent
4345f0dc01
bus: ti-sysc: allow reset sharing across devices
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>
Showing 1 changed file with 9 additions and 3 deletions Side-by-side Diff
drivers/bus/ti-sysc.c
... | ... | @@ -501,7 +501,7 @@ |
501 | 501 | static int sysc_init_resets(struct sysc *ddata) |
502 | 502 | { |
503 | 503 | ddata->rsts = |
504 | - devm_reset_control_get_optional(ddata->dev, "rstctrl"); | |
504 | + devm_reset_control_get_optional_shared(ddata->dev, "rstctrl"); | |
505 | 505 | if (IS_ERR(ddata->rsts)) |
506 | 506 | return PTR_ERR(ddata->rsts); |
507 | 507 | |
... | ... | @@ -1527,7 +1527,7 @@ |
1527 | 1527 | */ |
1528 | 1528 | static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset) |
1529 | 1529 | { |
1530 | - int error, val; | |
1530 | + int error; | |
1531 | 1531 | |
1532 | 1532 | if (!ddata->rsts) |
1533 | 1533 | return 0; |
... | ... | @@ -1538,7 +1538,9 @@ |
1538 | 1538 | return error; |
1539 | 1539 | } |
1540 | 1540 | |
1541 | - return reset_control_deassert(ddata->rsts); | |
1541 | + reset_control_deassert(ddata->rsts); | |
1542 | + | |
1543 | + return 0; | |
1542 | 1544 | } |
1543 | 1545 | |
1544 | 1546 | /* |
... | ... | @@ -2414,6 +2416,10 @@ |
2414 | 2416 | pm_runtime_disable(ddata->dev); |
2415 | 2417 | goto unprepare; |
2416 | 2418 | } |
2419 | + | |
2420 | + /* Balance reset counts */ | |
2421 | + if (ddata->rsts) | |
2422 | + reset_control_assert(ddata->rsts); | |
2417 | 2423 | |
2418 | 2424 | sysc_show_registers(ddata); |
2419 | 2425 |