pwm: stm32: Protect common prescaler for all channels
authorFabrice Gasnier <fabrice.gasnier@st.com>
Wed, 14 Feb 2018 10:04:33 +0000 (11:04 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 27 Mar 2018 22:37:37 +0000 (00:37 +0200)
commit4eb67a209645a87b8aca070aa9735eed90177829
tree4ad3d7082201ff0399725c80c99304f9620289d6
parent3af0bdd1d027292d40c7f1d13420bc298b3e1660
pwm: stm32: Protect common prescaler for all channels

There may be a race, when configuring two PWM channels, with different
prescaler values, when there's no active channel yet.
Add mutex lock to avoid concurrent access on PWM apply state.
This is also precursor patch for PWM capture support.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-stm32.c