mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] iio: debugfs register access through regmap in the core
@ 2026-11-24  6:50 Rupesh Majhi
  2026-11-24  6:50 ` [PATCH 1/6] iio: core: add iio_debugfs_reg_access_regmap() Rupesh Majhi
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Rupesh Majhi @ 2026-11-24  6:50 UTC (permalink / raw)
  To: Andy Shevchenko, Antoniu Miclaus, David Lechner, Eddie James,
	Jonathan Cameron, Lucas Stankus, Marcelo Schmitt,
	Michael Hennerich, Nuno Sá,
	Petre Rodan
  Cc: linux, linux-iio, linux-kernel, Rupesh Majhi

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
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-24  6:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24  6:50 [PATCH 0/6] iio: debugfs register access through regmap in the core Rupesh Majhi
2026-11-24  6:50 ` [PATCH 1/6] iio: core: add iio_debugfs_reg_access_regmap() Rupesh Majhi
2026-11-24  6:50 ` [PATCH 2/6] iio: accel: adxl313: use iio_debugfs_reg_access_regmap() Rupesh Majhi
2026-11-24  6:50 ` [PATCH 3/6] iio: accel: adxl372: " Rupesh Majhi
2026-11-24  6:50 ` [PATCH 4/6] iio: accel: bma220: " Rupesh Majhi
2026-11-24  6:50 ` [PATCH 5/6] iio: adc: ina2xx-adc: " Rupesh Majhi
2026-11-24  6:50 ` [PATCH 6/6] iio: pressure: dps310: add debugfs register access Rupesh Majhi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®