]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
UBUNTU:SAUCE: iio: st_sensors: support active-low interrupts
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 16 Dec 2016 10:05:31 +0000 (18:05 +0800)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 19 Dec 2016 18:51:16 +0000 (18:51 +0000)
commit500ce700a94a78f6c1f8e61e2d7d4e98c3708914
treed32a22980f063eb1bbb25524a59c2d4d88e60d16
parente43140b34700f7dfce3a50b123bedcf0ff05fddc
UBUNTU:SAUCE: iio: st_sensors: support active-low interrupts

BugLink: http://bugs.launchpad.net/bugs/1650112
Most ST MEMS Sensors that support interrupts can also handle sending
an active low interrupt, i.e. going from high to low on data ready
(or other interrupt) and thus triggering on a falling edge to the
interrupt controller.

Set up logic to inspect the interrupt line we get for a sensor: if
it is triggering on rising edge, leave everything alone, but if it
triggers on falling edges, set up active low, and if unsupported
configurations appear: warn with errors and reconfigure the interrupt
to a rising edge, which all interrupt generating sensors support.

Create a local header for st_sensors_core.h to share functions
between the sensor core and the trigger setup code.

Cc: Giuseppe Barba <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(back ported from commit a9fd053b56c6bb14972ab7a19da0b575fe4c5d66)
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Conflicts:
drivers/iio/common/st_sensors/st_sensors_core.c
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/iio/accel/st_accel_core.c
drivers/iio/common/st_sensors/st_sensors_core.c
drivers/iio/common/st_sensors/st_sensors_core.h [new file with mode: 0644]
drivers/iio/common/st_sensors/st_sensors_trigger.c
drivers/iio/gyro/st_gyro_core.c
drivers/iio/magnetometer/st_magn_core.c
drivers/iio/pressure/st_pressure_core.c
include/linux/iio/common/st_sensors.h