iio: trigger: stm32-timer: add enable attribute
authorFabrice Gasnier <fabrice.gasnier@st.com>
Thu, 27 Jul 2017 16:19:00 +0000 (18:19 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 30 Jul 2017 13:48:14 +0000 (14:48 +0100)
commit90938ca432e6b8f6bb1c22a24984738fc3d906ed
tree327d2c8c8a0dd35f5fcec8c86746990074754279
parent06e3fe89988b1c99a3d9953b1d3b1faf3f047017
iio: trigger: stm32-timer: add enable attribute

In order to use encoder mode, timers needs to be enabled (e.g. CEN bit)
along with peripheral clock.
Add IIO_CHAN_INFO_ENABLE attribute to handle this.
Also, in triggered mode, CEN bit is set automatically in hardware.
Then clock must be enabled before starting triggered mode.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/trigger/stm32-timer-trigger.c