mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
iio:adc:ad799x: Return more meaningful event enabled state
only report an event as enabled if it actually is enabled Signed-off-by: Peter Meerwald <[email protected]> Acked-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
parent
8235841b95
commit
1d15330a39
1 changed files with 9 additions and 1 deletions
|
|
@ -364,7 +364,15 @@ static int ad799x_read_event_config(struct iio_dev *indio_dev,
|
|||
enum iio_event_type type,
|
||||
enum iio_event_direction dir)
|
||||
{
|
||||
return 1;
|
||||
struct ad799x_state *st = iio_priv(indio_dev);
|
||||
|
||||
if (!(st->config & AD7998_ALERT_EN))
|
||||
return 0;
|
||||
|
||||
if ((st->config >> AD799X_CHANNEL_SHIFT) & BIT(chan->scan_index))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int ad799x_threshold_reg(const struct iio_chan_spec *chan,
|
||||
|
|
|
|||
Loading…
Reference in a new issue