]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: stm32: Improve capture by tuning counter prescaler
authorFabrice Gasnier <fabrice.gasnier@st.com>
Wed, 16 May 2018 07:35:59 +0000 (09:35 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 16 May 2018 08:11:13 +0000 (09:11 +0100)
commit056477cf37688d2d47f5f5e2f13c35f967ace625
tree999aae9d7ca17a10e2614f0cd4b1a518be514bb8
parent2c9b034b6d63c3aaa8b39a25fd2760014e0e2644
pwm: stm32: Improve capture by tuning counter prescaler

Currently, capture is based on timeout window to configure prescaler.
PWM capture framework provides 1s window at the time of writing.

There's place for improvement, after input signal has been captured once:
- Finer tune counter clock prescaler, by using 1st capture result (with
arbitrary margin).
- Do a 2nd capture, with scaled capture window.
This increases accuracy, especially at high rates.

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