From: Erwan Le Ray Date: Thu, 13 Jun 2019 13:49:53 +0000 (+0200) Subject: serial: stm32: select pinctrl state in each suspend/resume function X-Git-Tag: v5.4-rc1~135^2~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94616d9a9db0099f5251c60b831e03619c63523a;p=thirdparty%2Fkernel%2Fstable.git serial: stm32: select pinctrl state in each suspend/resume function Select either pinctrl sleep state in suspend function or default state in resume function. Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray Link: https://lore.kernel.org/r/1560433800-12255-4-git-send-email-erwan.leray@st.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 24a2261f879a1..7bb2bb9fffbc1 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1373,6 +1374,8 @@ static int stm32_serial_suspend(struct device *dev) else stm32_serial_enable_wakeup(port, false); + pinctrl_pm_select_sleep_state(dev); + return 0; } @@ -1380,6 +1383,8 @@ static int stm32_serial_resume(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); + pinctrl_pm_select_default_state(dev); + if (device_may_wakeup(dev)) stm32_serial_enable_wakeup(port, false);