mbox series

[v2,0/3] ms5611 sensor value bug fix; dt-binding fix

Message ID 20221021135827.1444793-1-mitja@lxnav.com
Headers show
Series ms5611 sensor value bug fix; dt-binding fix | expand

Message

Mitja Spes Oct. 21, 2022, 1:58 p.m. UTC
Subject: [PATCH 0/3] ms5611 sensor value bug fix; dt-binding fix

The first patch fixes a bug in ms5611 iio driver where PROM value
compensation table was overwritten by the last initialized sensor.
This in turn produced wrong values when multiple sensors were used.

Second patch removes the hardcoded SPI frequency and uses the setting
from dt-bindings.

Third patch outlines the change from the second patch in the bindings
example.

v2:

[PATCH 1-2]
* no change

[PATCH 3]
* corrected patch subject

Mitja Spes (3):
  iio: pressure: ms5611: fixed value compensation bug
  iio: pressure: ms5611: changed hardcoded SPI speed to value limited
  dt-bindings: iio: pressure: meas,ms5611: add max SPI frequency to the
    example

 .../bindings/iio/pressure/meas,ms5611.yaml    |  1 +
 drivers/iio/pressure/ms5611.h                 | 12 ++---
 drivers/iio/pressure/ms5611_core.c            | 51 ++++++++++---------
 drivers/iio/pressure/ms5611_spi.c             |  2 +-
 4 files changed, 33 insertions(+), 33 deletions(-)

Comments

Jonathan Cameron Oct. 23, 2022, 11:10 a.m. UTC | #1
On Fri, 21 Oct 2022 17:32:21 +0200
Marcus Folkesson <marcus.folkesson@gmail.com> wrote:

> Hi Mitja,
> 
> On Fri, Oct 21, 2022 at 03:58:21PM +0200, Mitja Spes wrote:
> > Don't hardcode the ms5611 SPI speed, limit it instead.
> > 
> > Signed-off-by: Mitja Spes <mitja@lxnav.com>
Please give a fixes tag for this one as well.
The driver should never have been doing this.

Jonathan

> > ---
> >  drivers/iio/pressure/ms5611_spi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/pressure/ms5611_spi.c b/drivers/iio/pressure/ms5611_spi.c
> > index 432e912096f4..a0a7205c9c3a 100644
> > --- a/drivers/iio/pressure/ms5611_spi.c
> > +++ b/drivers/iio/pressure/ms5611_spi.c
> > @@ -91,7 +91,7 @@ static int ms5611_spi_probe(struct spi_device *spi)
> >  	spi_set_drvdata(spi, indio_dev);
> >  
> >  	spi->mode = SPI_MODE_0;
> > -	spi->max_speed_hz = 20000000;
> > +	spi->max_speed_hz = min(spi->max_speed_hz, 20000000U);  
> 
> max_speed_hz is a limit, and the max frequency the ms5611 support is
> 20MHz.
> 
> Best regards,
> Marcus Folkesson
Jonathan Cameron Oct. 29, 2022, 11:40 a.m. UTC | #2
On Fri, 21 Oct 2022 15:58:19 +0200
Mitja Spes <mitja@lxnav.com> wrote:

> Subject: [PATCH 0/3] ms5611 sensor value bug fix; dt-binding fix
> 
> The first patch fixes a bug in ms5611 iio driver where PROM value
> compensation table was overwritten by the last initialized sensor.
> This in turn produced wrong values when multiple sensors were used.
> 
> Second patch removes the hardcoded SPI frequency and uses the setting
> from dt-bindings.
> 
> Third patch outlines the change from the second patch in the bindings
> example.

1+2 applied to the fixes-togreg branch of iio.git and marked for
stable.

Thanks,

Jonathan

> 
> v2:
> 
> [PATCH 1-2]
> * no change
> 
> [PATCH 3]
> * corrected patch subject
> 
> Mitja Spes (3):
>   iio: pressure: ms5611: fixed value compensation bug
>   iio: pressure: ms5611: changed hardcoded SPI speed to value limited
>   dt-bindings: iio: pressure: meas,ms5611: add max SPI frequency to the
>     example
> 
>  .../bindings/iio/pressure/meas,ms5611.yaml    |  1 +
>  drivers/iio/pressure/ms5611.h                 | 12 ++---
>  drivers/iio/pressure/ms5611_core.c            | 51 ++++++++++---------
>  drivers/iio/pressure/ms5611_spi.c             |  2 +-
>  4 files changed, 33 insertions(+), 33 deletions(-)
>