Skip to content

iio: debugfs register access through regmap in the core

Rupesh Majhi linux-iio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6iio: core: add iio_debugfs_reg_access_regmap()drivers/iio/industrialio-core.c include/linux/iio/iio.h+30 -00 replies
2/6iio: accel: adxl313: use iio_debugfs_reg_access_regmap()drivers/iio/accel/adxl313_core.c+1 -110 replies
3/6iio: accel: adxl372: use iio_debugfs_reg_access_regmap()drivers/iio/accel/adxl372.c+1 -140 replies
4/6iio: accel: bma220: use iio_debugfs_reg_access_regmap()drivers/iio/accel/bma220_core.c+1 -111 reply
5/6iio: adc: ina2xx-adc: use iio_debugfs_reg_access_regmap()drivers/iio/adc/ina2xx-adc.c+2 -130 replies
6/6iio: pressure: dps310: add debugfs register accessdrivers/iio/pressure/dps310.c+1 -00 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPetre RodanNuno Sá
SeriesR-b
1/6
2/6
3/6
4/6T-b
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] iio: debugfs register access through regmap in the core

More than 25 IIO drivers have a debugfs_reg_access callback that is only a regmap_read() or regmap_write() on the regmap of the parent device. Patch 1 adds a core helper for that, patches 2 to 5 use it in four drivers and patch 6 adds register access to dps310 with it. The other drivers can follow in batches if the helper is wanted.

The helper finds the regmap with dev_get_regmap() on the parent, so it only fits drivers with one regmap there. Existing callbacks that take a lock or claim direct mode around the access are left alone.

Patch 6 is tested on a DPS310 on a BeagleBone Black. I don't have the other parts. For those, adxl313, adxl372, bma220 and ina226 (ina219 uses the same callback) were instantiated on i2c-stub under QEMU:
reads, writes and refused registers through direct_reg_access give the same results before and after.

Based on iio testing.

Rupesh Majhi (6):
iio: core: add iio_debugfs_reg_access_regmap()
iio: accel: adxl313: use iio_debugfs_reg_access_regmap()
iio: accel: adxl372: use iio_debugfs_reg_access_regmap()
iio: accel: bma220: use iio_debugfs_reg_access_regmap()
iio: adc: ina2xx-adc: use iio_debugfs_reg_access_regmap()
iio: pressure: dps310: add debugfs register access

 drivers/iio/accel/adxl313_core.c | 12 +-----------
 drivers/iio/accel/adxl372.c      | 15 +--------------
 drivers/iio/accel/bma220_core.c  | 12 +-----------
 drivers/iio/adc/ina2xx-adc.c     | 15 ++-------------
 drivers/iio/industrialio-core.c  | 28 ++++++++++++++++++++++++++++
 drivers/iio/pressure/dps310.c    |  1 +
 include/linux/iio/iio.h          |  2 ++
 7 files changed, 36 insertions(+), 49 deletions(-)

base-commit: f2cbef9101b9fc979a324bb1242b8b802a2484b6

Signature · 1 line
2.43.0