aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorCrestez Dan Leonard <leonard.crestez@intel.com>2016-05-13 14:43:34 -0400
committerJonathan Cameron <jic23@kernel.org>2016-05-29 15:27:16 -0400
commit99147606155f09feccac67c65387dc62260b749b (patch)
treec3150c481f141675816479713a48016137038eea /drivers
parentff05916f94f912b25e8efcf9b02c10d481977bab (diff)
iio: st_sensors: Disable DRDY at init time
This fixes odd behavior after reboot. The fact that we set the device to powerdown mode is not sufficient to prevent DRDY being active because we might still have an unread sample. Even if powerdown was sufficient keeping DRDY disabled while trigger is not active is a good idea. Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/common/st_sensors/st_sensors_core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 928ee68fcc5f..9e59c90f6a8d 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -363,6 +363,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
363 if (err < 0) 363 if (err < 0)
364 return err; 364 return err;
365 365
366 /* Disable DRDY, this might be still be enabled after reboot. */
367 err = st_sensors_set_dataready_irq(indio_dev, false);
368 if (err < 0)
369 return err;
370
366 if (sdata->current_fullscale) { 371 if (sdata->current_fullscale) {
367 err = st_sensors_set_fullscale(indio_dev, 372 err = st_sensors_set_fullscale(indio_dev,
368 sdata->current_fullscale->num); 373 sdata->current_fullscale->num);