Skip to content

Commit e5deb8f

Browse files
committed
bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up
The uarts should be tagged with SYSC_QUIRK_SWSUP_SIDLE instead of SYSC_QUIRK_SWSUP_SIDLE_ACT. The difference is that SYSC_QUIRK_SWSUP_SIDLE is used to force idle target modules rather than block idle during usage. The SYSC_QUIRK_SWSUP_SIDLE_ACT should disable autoidle and wake-up when a target module is active, and configure autoidle and wake-up when a target module is inactive. We are missing configuring the target module on sysc_disable_module(), and missing toggling of the wake-up bit. Let's fix the issue to allow uart wake-up to work. Fixes: fb685f1 ("bus: ti-sysc: Handle swsup idle mode quirks") Tested-by: Dhruva Gole <d-gole@ti.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 11729ca commit e5deb8f

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

drivers/bus/ti-sysc.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,11 @@ static int sysc_enable_module(struct device *dev)
10981098
if (ddata->cfg.quirks & (SYSC_QUIRK_SWSUP_SIDLE |
10991099
SYSC_QUIRK_SWSUP_SIDLE_ACT)) {
11001100
best_mode = SYSC_IDLE_NO;
1101+
1102+
/* Clear WAKEUP */
1103+
if (regbits->enwkup_shift >= 0 &&
1104+
ddata->cfg.sysc_val & BIT(regbits->enwkup_shift))
1105+
reg &= ~BIT(regbits->enwkup_shift);
11011106
} else {
11021107
best_mode = fls(ddata->cfg.sidlemodes) - 1;
11031108
if (best_mode > SYSC_IDLE_MASK) {
@@ -1225,6 +1230,13 @@ static int sysc_disable_module(struct device *dev)
12251230
}
12261231
}
12271232

1233+
if (ddata->cfg.quirks & SYSC_QUIRK_SWSUP_SIDLE_ACT) {
1234+
/* Set WAKEUP */
1235+
if (regbits->enwkup_shift >= 0 &&
1236+
ddata->cfg.sysc_val & BIT(regbits->enwkup_shift))
1237+
reg |= BIT(regbits->enwkup_shift);
1238+
}
1239+
12281240
reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);
12291241
reg |= best_mode << regbits->sidle_shift;
12301242
if (regbits->autoidle_shift >= 0 &&
@@ -1519,16 +1531,16 @@ struct sysc_revision_quirk {
15191531
static const struct sysc_revision_quirk sysc_revision_quirks[] = {
15201532
/* These drivers need to be fixed to not use pm_runtime_irq_safe() */
15211533
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff,
1522-
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
1534+
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
15231535
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,
1524-
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
1536+
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
15251537
/* Uarts on omap4 and later */
15261538
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff,
1527-
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
1539+
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
15281540
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff,
1529-
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
1541+
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
15301542
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47424e03, 0xffffffff,
1531-
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
1543+
SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
15321544

15331545
/* Quirks that need to be set based on the module address */
15341546
SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -ENODEV, 0x50000800, 0xffffffff,

0 commit comments

Comments
 (0)