提交 99147606 编写于 作者: C Crestez Dan Leonard 提交者: Jonathan Cameron

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: NCrestez Dan Leonard <leonard.crestez@intel.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 ff05916f
...@@ -363,6 +363,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev, ...@@ -363,6 +363,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
if (err < 0) if (err < 0)
return err; 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) { if (sdata->current_fullscale) {
err = st_sensors_set_fullscale(indio_dev, err = st_sensors_set_fullscale(indio_dev,
sdata->current_fullscale->num); sdata->current_fullscale->num);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册