linux/drivers/iio/trigger
Fabrice Gasnier 50b39608ef iio: trigger: stm32-timer: fix quadrature mode get routine
Fixes: 4adec7da05 ("iio: stm32 trigger: Add quadrature encoder device")

SMS bitfiled is mode + 1. After reset, upon boot, SMS = 0. When reading
from sysfs, stm32_get_quadrature_mode() returns -1 (e.g. -EPERM) which is
wrong error code here. So, check SMS bitfiled matches valid encoder mode,
or return -EINVAL.

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>
2017-07-30 14:43:10 +01:00
..
iio-trig-hrtimer.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
iio-trig-interrupt.c iio: trigger: free trigger resource correctly 2017-01-22 16:14:21 +00:00
iio-trig-loop.c iio:trigger: Experimental kthread tight loop trigger (thread only) 2016-06-03 13:18:44 +01:00
iio-trig-sysfs.c iio: trigger: free trigger resource correctly 2017-01-22 16:14:21 +00:00
Kconfig iio: Add STM32 timer trigger driver 2017-01-25 16:11:56 +00:00
Makefile iio: Add STM32 timer trigger driver 2017-01-25 16:11:56 +00:00
stm32-timer-trigger.c iio: trigger: stm32-timer: fix quadrature mode get routine 2017-07-30 14:43:10 +01:00