]> 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)
commitf6510e539ec02f646dc1b686f8f7f5534fcf6c9c
tree999aae9d7ca17a10e2614f0cd4b1a518be514bb8
parent6b88c3b9774cd72501991383a8f800114f722208
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