pwm: stm32: Split breakinput apply routine to ease PM support
authorFabrice Gasnier <fabrice.gasnier@st.com>
Fri, 4 Oct 2019 12:53:52 +0000 (14:53 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 21 Oct 2019 14:50:00 +0000 (16:50 +0200)
commit0f9d2ecba883d0788a34414a608055479be81ccd
tree202a3a1a804e5a1dfab07a2cc5083081afb9d2f9
parent4205e356285ef0e8127d531fcff845eb01108b20
pwm: stm32: Split breakinput apply routine to ease PM support

Split breakinput routine that configures STM32 timers 'break' safety
feature upon probe, into two routines:
- stm32_pwm_apply_breakinputs() sets all the break inputs into registers.
- stm32_pwm_probe_breakinputs() probes the device tree break input settings
  before calling stm32_pwm_apply_breakinputs()

This is a precursor patch to ease PM support. Registers content may get
lost during low power. So, break input settings applied upon probe need
to be restored upon resume (e.g. by calling stm32_pwm_apply_breakinputs()).

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