pwm: stm32: Add power management support
authorFabrice Gasnier <fabrice.gasnier@st.com>
Fri, 4 Oct 2019 12:53:53 +0000 (14:53 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 21 Oct 2019 14:50:01 +0000 (16:50 +0200)
commit2d3aa06b5de097747d848a9d714987a4aa2303aa
treeb7b90299b17a4256a2c2be8e330e41aa64517151
parent0f9d2ecba883d0788a34414a608055479be81ccd
pwm: stm32: Add power management support

Add suspend/resume PM sleep ops. When going to low power, enforce the PWM
channel isn't active. Let the PWM consumers disable it during their own
suspend sequence, see [1]. So, perform a check here, and handle the
pinctrl states. Also restore the break inputs upon resume, as registers
content may be lost when going to low power mode.

[1] https://lkml.org/lkml/2019/2/5/770

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-stm32.c