aboutsummaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorTony Lindgren2019-05-27 04:51:55 -0700
committerTony Lindgren2019-05-28 05:19:16 -0700
commitfb685f1c190ec8c085e499f138752b2b0a2836de (patch)
tree055f348be2b72b535f5f5e84f0229360521c1bf3 /drivers/bus
parentae9ae12e9daa1e2139c3ff729d60f3c16d6e9b61 (diff)
bus: ti-sysc: Handle swsup idle mode quirks
Some modules have idlemodes wired, but not completely functional. We have quirks for SWSUP_SIDLE and SWSUP_SIDLE_ACT to manage interconnect target modules without hardware support, but we've been only using them so far in legacy mode. Let's add support for SWSUP quirks in non-legacy mode too. Tested-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/ti-sysc.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 31035492f1be..4a0146424902 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -886,10 +886,15 @@ static int sysc_enable_module(struct device *dev)
if (!idlemodes || regbits->sidle_shift < 0)
goto set_midle;
- best_mode = fls(ddata->cfg.sidlemodes) - 1;
- if (best_mode > SYSC_IDLE_MASK) {
- dev_err(dev, "%s: invalid sidlemode\n", __func__);
- return -EINVAL;
+ if (ddata->cfg.quirks & (SYSC_QUIRK_SWSUP_SIDLE |
+ SYSC_QUIRK_SWSUP_SIDLE_ACT)) {
+ best_mode = SYSC_IDLE_NO;
+ } else {
+ best_mode = fls(ddata->cfg.sidlemodes) - 1;
+ if (best_mode > SYSC_IDLE_MASK) {
+ dev_err(dev, "%s: invalid sidlemode\n", __func__);
+ return -EINVAL;
+ }
}
reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);
@@ -973,10 +978,14 @@ set_sidle:
if (!idlemodes || regbits->sidle_shift < 0)
return 0;
- ret = sysc_best_idle_mode(idlemodes, &best_mode);
- if (ret) {
- dev_err(dev, "%s: invalid sidlemode\n", __func__);
- return ret;
+ if (ddata->cfg.quirks & SYSC_QUIRK_SWSUP_SIDLE) {
+ best_mode = SYSC_IDLE_FORCE;
+ } else {
+ ret = sysc_best_idle_mode(idlemodes, &best_mode);
+ if (ret) {
+ dev_err(dev, "%s: invalid sidlemode\n", __func__);
+ return ret;
+ }
}
reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);