Skip to content

Commit a87259a

Browse files
committed
drivers: disk: sdmmc_stm32: support PINCTRL sleep
Add support for configuring pins into an alternate mode when the device is powered off. Signed-off-by: Jordan Yates <[email protected]>
1 parent 1c8ce27 commit a87259a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/disk/sdmmc_stm32.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,17 @@ static int stm32_sdmmc_pwr_on(struct stm32_sdmmc_priv *priv)
713713

714714
static int stm32_sdmmc_pwr_off(struct stm32_sdmmc_priv *priv)
715715
{
716+
int err;
717+
716718
if (!priv->pe.port) {
717719
return 0;
718720
}
719721

722+
/* PINCTRL sleep mode when powered down */
723+
err = pinctrl_apply_state(priv->pcfg, PINCTRL_STATE_SLEEP);
724+
if ((err != 0) && (err != -ENOENT)) {
725+
LOG_WRN("Failed to apply pin sleep states");
726+
}
720727
gpio_pin_configure_dt(&priv->pe, GPIO_OUTPUT_INACTIVE);
721728
return 0;
722729
}

0 commit comments

Comments
 (0)