[PATCH v3 00/13] iio: pressure: mprls0025pa: driver code cleanup

Petre Rodan posted 13 patches 3 weeks, 4 days ago
drivers/iio/pressure/mprls0025pa.c     | 114 +++++++++++++++------------------
drivers/iio/pressure/mprls0025pa.h     |  15 ++---
drivers/iio/pressure/mprls0025pa_i2c.c |  13 +---
drivers/iio/pressure/mprls0025pa_spi.c |  41 +++++-------
4 files changed, 74 insertions(+), 109 deletions(-)
[PATCH v3 00/13] iio: pressure: mprls0025pa: driver code cleanup
Posted by Petre Rodan 3 weeks, 4 days ago
This series contains a collection of patches to the MPR sensor based
on feedback I received for other drivers.

major changes:
 - trigger flag fix (define edge direction only in the device tree)
 - fix SPI timing violation
 - fix scan_type struct
 - fix pressure calculation
    (does not affect users that define a sensor via the pressure-triplet)
 - stricter check for the status byte + better error return levels
 - drop the use of devm_kzalloc()
 - stick to the datasheet parameters while performing the measurement
    sequence

minor changes:
 - includes added and removed
 - rename generic 'buffer' variable to 'rx_buf'

Tested on two sensors - MPRLS0015PA0000SA and MPRLS0001BA00001A

Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/micropressure-mpr-series/documents/sps-siot-mpr-series-datasheet-32332628-ciid-172626.pdf?download=false
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
---
Changes in v3:
- implement changes based on Andy's review
- Link to v2: https://lore.kernel.org/r/20260114-mprls_cleanup-v2-0-5868b0045316@subdimension.ro

Changes in v2:
- reordered patches based on Marcelo's input
- implemented code changes based on Marcelo and Jonathan's reviews
- Link to v1: https://lore.kernel.org/r/20251218-mprls_cleanup-v1-0-b36a170f1a5c@subdimension.ro

---
Petre Rodan (13):
      iio: pressure: mprls0025pa: fix spi_transfer struct initialisation
      iio: pressure: mprls0025pa: fix SPI CS delay violation
      iio: pressure: mprls0025pa: fix interrupt flag
      iio: pressure: mprls0025pa: fix scan_type struct
      iio: pressure: mprls0025pa: fix pressure calculation
      iio: pressure: mprls0025pa: cleanup includes
      iio: pressure: mprls0025pa: remove redundant declarations
      iio: pressure: mprls0025pa: rename buffer variable
      iio: pressure: mprls0025pa: introduce tx buffer
      iio: pressure: mprls0025pa: move memset to core
      iio: pressure: mprls0025pa: stricter checks for the status byte
      iio: pressure: mprls0025pa: change measurement sequence
      iio: pressure: mprls0025pa: add copyright line

 drivers/iio/pressure/mprls0025pa.c     | 114 +++++++++++++++------------------
 drivers/iio/pressure/mprls0025pa.h     |  15 ++---
 drivers/iio/pressure/mprls0025pa_i2c.c |  13 +---
 drivers/iio/pressure/mprls0025pa_spi.c |  41 +++++-------
 4 files changed, 74 insertions(+), 109 deletions(-)
---
base-commit: f9e05791642810a0cf6237d39fafd6fec5e0b4bb
change-id: 20251215-mprls_cleanup-01de8971b439

Best regards,
-- 
Petre Rodan <petre.rodan@subdimension.ro>
Re: [PATCH v3 00/13] iio: pressure: mprls0025pa: driver code cleanup
Posted by Andy Shevchenko 3 weeks, 4 days ago
On Wed, Jan 14, 2026 at 06:55:29PM +0200, Petre Rodan wrote:
> This series contains a collection of patches to the MPR sensor based
> on feedback I received for other drivers.
> 
> major changes:
>  - trigger flag fix (define edge direction only in the device tree)
>  - fix SPI timing violation
>  - fix scan_type struct
>  - fix pressure calculation
>     (does not affect users that define a sensor via the pressure-triplet)
>  - stricter check for the status byte + better error return levels
>  - drop the use of devm_kzalloc()
>  - stick to the datasheet parameters while performing the measurement
>     sequence
> 
> minor changes:
>  - includes added and removed
>  - rename generic 'buffer' variable to 'rx_buf'
> 
> Tested on two sensors - MPRLS0015PA0000SA and MPRLS0001BA00001A

This version looks good to me,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

The change I mentioned can be sent as a followup.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v3 00/13] iio: pressure: mprls0025pa: driver code cleanup
Posted by Jonathan Cameron 3 weeks, 2 days ago
On Wed, 14 Jan 2026 19:09:20 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Wed, Jan 14, 2026 at 06:55:29PM +0200, Petre Rodan wrote:
> > This series contains a collection of patches to the MPR sensor based
> > on feedback I received for other drivers.
> > 
> > major changes:
> >  - trigger flag fix (define edge direction only in the device tree)
> >  - fix SPI timing violation
> >  - fix scan_type struct
> >  - fix pressure calculation
> >     (does not affect users that define a sensor via the pressure-triplet)
> >  - stricter check for the status byte + better error return levels
> >  - drop the use of devm_kzalloc()
> >  - stick to the datasheet parameters while performing the measurement
> >     sequence
> > 
> > minor changes:
> >  - includes added and removed
> >  - rename generic 'buffer' variable to 'rx_buf'
> > 
> > Tested on two sensors - MPRLS0015PA0000SA and MPRLS0001BA00001A  
> 
> This version looks good to me,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
> The change I mentioned can be sent as a followup.
> 

Applied to the togreg branch of iio.git.
(I wrote this earlier but apparently didn't hit send for some reason)
Re: [PATCH v3 00/13] iio: pressure: mprls0025pa: driver code cleanup
Posted by Petre Rodan 3 weeks, 2 days ago
Hello,

On Wed, Jan 14, 2026 at 07:09:20PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 14, 2026 at 06:55:29PM +0200, Petre Rodan wrote:
> > This series contains a collection of patches to the MPR sensor based
> > on feedback I received for other drivers.
> > 
> > major changes:
> >  - trigger flag fix (define edge direction only in the device tree)
> >  - fix SPI timing violation
> >  - fix scan_type struct
> >  - fix pressure calculation
> >     (does not affect users that define a sensor via the pressure-triplet)
> >  - stricter check for the status byte + better error return levels
> >  - drop the use of devm_kzalloc()
> >  - stick to the datasheet parameters while performing the measurement
> >     sequence
> > 
> > minor changes:
> >  - includes added and removed
> >  - rename generic 'buffer' variable to 'rx_buf'
> > 
> > Tested on two sensors - MPRLS0015PA0000SA and MPRLS0001BA00001A
> 
> This version looks good to me,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
> The change I mentioned can be sent as a followup.

Thank you for the review.

@Jonathan: please ping me when the series is pushed so I create the followup.

best regards,
peter