Re: [PATCH 2/3] iio: st_sensors: Disable DRDY at init time
On 24/05/16 12:28, Linus Walleij wrote: > On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard >wrote: > >> 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 >> Cc: Giuseppe Barba >> Cc: Denis Ciocca >> Signed-off-by: Crestez Dan Leonard > > Reviewed-by: Linus Walleij Applied to the fixes-togreg-post-rc1 branch of iio.git. Note I'm taking these without Denis ack as he is snowed under right now and this set aren't terribly 'exciting' (hopefully) Jonathan > > Yours, > Linus Walleij > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: [PATCH 2/3] iio: st_sensors: Disable DRDY at init time
On 24/05/16 12:28, Linus Walleij wrote: > On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard > wrote: > >> 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 >> Cc: Giuseppe Barba >> Cc: Denis Ciocca >> Signed-off-by: Crestez Dan Leonard > > Reviewed-by: Linus Walleij Applied to the fixes-togreg-post-rc1 branch of iio.git. Note I'm taking these without Denis ack as he is snowed under right now and this set aren't terribly 'exciting' (hopefully) Jonathan > > Yours, > Linus Walleij > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: [PATCH 2/3] iio: st_sensors: Disable DRDY at init time
On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonardwrote: > 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 > Cc: Giuseppe Barba > Cc: Denis Ciocca > Signed-off-by: Crestez Dan Leonard Reviewed-by: Linus Walleij Yours, Linus Walleij
Re: [PATCH 2/3] iio: st_sensors: Disable DRDY at init time
On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard wrote: > 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 > Cc: Giuseppe Barba > Cc: Denis Ciocca > Signed-off-by: Crestez Dan Leonard Reviewed-by: Linus Walleij Yours, Linus Walleij
Re: [PATCH 2/3] iio: st_sensors: Disable DRDY at init time
On 13/05/16 19:43, Crestez Dan Leonard wrote: > 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> Cc: Giuseppe Barba > Cc: Denis Ciocca > Signed-off-by: Crestez Dan Leonard Again, this one seems obviously correct to me, but would like Denis Ack. Jonathan > --- > 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); >
Re: [PATCH 2/3] iio: st_sensors: Disable DRDY at init time
On 13/05/16 19:43, Crestez Dan Leonard wrote: > 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 > Cc: Giuseppe Barba > Cc: Denis Ciocca > Signed-off-by: Crestez Dan Leonard Again, this one seems obviously correct to me, but would like Denis Ack. Jonathan > --- > 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); >
[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 WalleijCc: Giuseppe Barba Cc: Denis Ciocca Signed-off-by: Crestez Dan Leonard --- 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
[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 Cc: Giuseppe Barba Cc: Denis Ciocca Signed-off-by: Crestez Dan Leonard --- 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