diff options
author | Fabrice Gasnier <fabrice.gasnier@st.com> | 2020-02-14 17:23:57 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-03-08 17:28:35 +0000 |
commit | 3192ade7b6f6306b66139109e0d455f98a7f695f (patch) | |
tree | 13e67ca5df29483979999cb0ebd1ff3ec0e91b10 /scripts/sorttable.c | |
parent | 9c088c020d8181a0c8376444b740c99366eec04d (diff) | |
download | linux-stable-3192ade7b6f6306b66139109e0d455f98a7f695f.tar.gz linux-stable-3192ade7b6f6306b66139109e0d455f98a7f695f.tar.bz2 linux-stable-3192ade7b6f6306b66139109e0d455f98a7f695f.zip |
iio: trigger: stm32-timer: enable clock when in master mode
Clock should be enabled as soon as using master modes, even before
enabling timer. Or, this may provoke bad behavior on the other end
(slave timer). Then, introduce 'clk_enabled' flag, instead of relying
on CR1 EN bit, to keep track of clock being enabled (balanced refcount).
Propagate this anywhere else in the driver.
Also add 'remove' routine to stop timer and disable clock in case it
has been left enabled. Enforce the user interface has been unregistered
in the remove routine, before disabling the hardware to avoid possible
race. So, remove use of devm_ variant to register triggers and unregister
them before the hardware gets disabled [1].
[1] https://patchwork.kernel.org/patch/9956247/
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'scripts/sorttable.c')
0 files changed, 0 insertions, 0 deletions