Skip to content

Commit 95e274b

Browse files
mmahadevan108kartben
authored andcommitted
drivers: pinctrl_mci_io_mux: Fix sleep output configuration
The sleep output configuration should be skipped for pins 22 to 28. This was causing incorrect GPIO wakeups when entering standby mode on RW612. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 8a63b53 commit 95e274b

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

drivers/pinctrl/pinctrl_mci_io_mux.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,20 @@ static void configure_pin_props(uint32_t pin_mux, uint8_t gpio_idx)
6161
/* Set slew rate */
6262
set = IOMUX_PAD_GET_SLEW(pin_mux) << ((gpio_idx & 0xF) << 1);
6363
*slew_reg = (*slew_reg & ~mask) | set;
64-
65-
/* Set sleep force enable bit */
66-
mask = (0x1 << (gpio_idx & 0x1F));
67-
/* Check if we should force the pin to output in sleep mode */
68-
if (IOMUX_PAD_GET_SLEEP_FORCE(pin_mux) == NO_FORCE_OUTPUT) {
69-
/* Does not force output during sleep */
70-
*sleep_force_en = (*sleep_force_en & ~mask);
71-
} else {
72-
/* Enable forcing output during sleep */
73-
*sleep_force_en = (*sleep_force_en | mask);
74-
set = (IOMUX_PAD_GET_SLEEP_FORCE_VAL(pin_mux) << (gpio_idx & 0x1F));
75-
*sleep_force_val = (*sleep_force_val & ~mask) | set;
64+
/* Sleep force configuration should be skipped for GPIO 22-27 */
65+
if (gpio_idx < 22 || gpio_idx > 27) {
66+
/* Set sleep force enable bit */
67+
mask = (0x1 << (gpio_idx & 0x1F));
68+
/* Check if we should force the pin to output in sleep mode */
69+
if (IOMUX_PAD_GET_SLEEP_FORCE(pin_mux) == NO_FORCE_OUTPUT) {
70+
/* Does not force output during sleep */
71+
*sleep_force_en = (*sleep_force_en & ~mask);
72+
} else {
73+
/* Enable forcing output during sleep */
74+
*sleep_force_en = (*sleep_force_en | mask);
75+
set = (IOMUX_PAD_GET_SLEEP_FORCE_VAL(pin_mux) << (gpio_idx & 0x1F));
76+
*sleep_force_val = (*sleep_force_val & ~mask) | set;
77+
}
7678
}
7779
}
7880

0 commit comments

Comments
 (0)