iio: bmc150: introduce bmc150_accel_interrupt
authorOctavian Purdila <octavian.purdila@intel.com>
Tue, 3 Mar 2015 16:17:57 +0000 (18:17 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sat, 14 Mar 2015 18:56:04 +0000 (18:56 +0000)
commit3e825ec98d36c8c8073024c95853389a831902e5
tree06c2d503f11a0eea8fd2ae7f90dc98dcf44f653d
parent1fad034c636cb57686f778d1c80513acbdaf8ec5
iio: bmc150: introduce bmc150_accel_interrupt

Since both triggers and events can share an interrupt, add a data
structure that tracks the users of an interrupt so that it enables or
disables it only for the first users and respectively last user.

This will allows us to easily add more events or triggers.

The patch also adds an interrupt enabled counter, so that we can
easily know if we need to put the device in normal mode when the
resume callback is issued.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/bmc150-accel.c