Skip to content

Commit

Permalink
serial: stm32: select pinctrl state in each suspend/resume function
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Bich Hemon authored and Greg Kroah-Hartman committed Jun 10, 2019
1 parent 15b3cd8 commit c70669e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/tty/serial/stm32-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,13 +1298,17 @@ static int stm32_serial_suspend(struct device *dev)
else
stm32_serial_enable_wakeup(port, false);

pinctrl_pm_select_sleep_state(dev);

return 0;
}

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);

Expand Down

0 comments on commit c70669e

Please sign in to comment.