summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/stm32-usart.c
diff options
context:
space:
mode:
authorErwan Le Ray <erwan.leray@st.com>2019-06-13 15:49:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-04 12:43:45 +0200
commit94616d9a9db0099f5251c60b831e03619c63523a (patch)
tree41dc43c4c8f61588f8aef87ddf1f32ae875e702c /drivers/tty/serial/stm32-usart.c
parent96b79ac705cccb9ff2485d59b83ea0b94b5329eb (diff)
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 <bich.hemon@st.com> Signed-off-by: Erwan Le Ray <erwan.leray@st.com> Link: https://lore.kernel.org/r/1560433800-12255-4-git-send-email-erwan.leray@st.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/stm32-usart.c')
-rw-r--r--drivers/tty/serial/stm32-usart.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 24a2261f879a..7bb2bb9fffbc 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -24,6 +24,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeirq.h>
@@ -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);