[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <52054a54539759100d9c926c78616858b12a2089.1463164919.git.leonard.crestez@intel.com>
Date: Fri, 13 May 2016 21:43:34 +0300
From: Crestez Dan Leonard <leonard.crestez@...el.com>
To: Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Daniel Baluta <daniel.baluta@...el.com>,
Crestez Dan Leonard <leonard.crestez@...el.com>,
Linus Walleij <linus.walleij@...aro.org>,
Giuseppe Barba <giuseppe.barba@...com>,
Denis Ciocca <denis.ciocca@...com>
Subject: [PATCH 2/3] 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: Linus Walleij <linus.walleij@...aro.org>
Cc: Giuseppe Barba <giuseppe.barba@...com>
Cc: Denis Ciocca <denis.ciocca@...com>
Signed-off-by: Crestez Dan Leonard <leonard.crestez@...el.com>
---
drivers/iio/common/st_sensors/st_sensors_core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 928ee68..9e59c90 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,
if (err < 0)
return err;
+ /* Disable DRDY, this might be still be enabled after reboot. */
+ err = st_sensors_set_dataready_irq(indio_dev, false);
+ if (err < 0)
+ return err;
+
if (sdata->current_fullscale) {
err = st_sensors_set_fullscale(indio_dev,
sdata->current_fullscale->num);
--
2.5.5
Powered by blists - more mailing lists