From: Rupesh Majhi <zoone.rupert@gmail.com>
To: "Andy Shevchenko" <andy@kernel.org>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Eddie James" <eajames@linux.ibm.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Lucas Stankus" <lucas.p.stankus@gmail.com>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Petre Rodan" <petre.rodan@subdimension.ro>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Shuah Khan" <skhan@linuxfoundation.org>
Cc: linux@analog.com, linux-doc@vger.kernel.org,
linux-iio@vger.kernel.org, Rupesh Majhi <zoone.rupert@gmail.com>,
crofts@kernel.org
Subject: [PATCH v4 0/7] iio: debugfs register access through regmap in the core
Date: Sun, 6 Dec 2026 12:03:19 +0200 [thread overview]
Message-ID: <20261206100326.45569-1-zoone.rupert@gmail.com> (raw)
More than 25 IIO drivers implement .debugfs_reg_access() with only a
regmap_read() or regmap_write() on the regmap of the parent device.
Patch 2 adds a core helper for that, patches 3 to 6 use it in four
drivers and patch 7 adds register access to dps310 with it. The other
drivers can follow in batches. Callbacks that take a lock or claim
direct mode around the access are left alone.
Patch 1 moves the kernel-doc of iio_get_debugfs_dentry() to the C file,
as asked on v3.
Patch 7 is tested on a DPS310 on a BeagleBone Black. I don't have the
other parts, so adxl313, adxl372, bma220 and ina226 were run on
i2c-stub under QEMU: direct_reg_access gives the same results before
and after.
Based on iio testing, which has Andy's split of the debugfs code [1].
v4:
- new patch 1: kernel-doc of iio_get_debugfs_dentry() moves to
industrialio-debugfs.c (Andy, Jonathan)
- 2: no change to that kernel-doc any more
- 2: regmap lookup split from the declaration (Andy)
v3: https://lore.kernel.org/linux-iio/20261204181105.150419-1-zoone.rupert@gmail.com/
- rename to iio_access_debugfs_regmap_reg() (Andy)
- 1: kernel-doc of iio_get_debugfs_dentry() moves inside the #if (Andy)
- Reviewed-by from Andy on 2 to 6
v2: https://lore.kernel.org/linux-iio/20261128184025.87548-1-zoone.rupert@gmail.com/
- 1: the helper moves to industrialio-debugfs.c and is NULL without
CONFIG_DEBUG_FS (Andy)
- Reviewed-by from Nuno on all, Tested-by from Petre on 4
v1: https://lore.kernel.org/linux-iio/20261124065016.185124-1-zoone.rupert@gmail.com/
[1] https://lore.kernel.org/linux-iio/20261127113635.1691512-1-andriy.shevchenko@linux.intel.com/
Cc: crofts@kernel.org
Rupesh Majhi (7):
iio: core: move iio_get_debugfs_dentry() kernel-doc to the C file
iio: core: add iio_access_debugfs_regmap_reg()
iio: accel: adxl313: use iio_access_debugfs_regmap_reg()
iio: accel: adxl372: use iio_access_debugfs_regmap_reg()
iio: accel: bma220: use iio_access_debugfs_regmap_reg()
iio: adc: ina2xx-adc: use iio_access_debugfs_regmap_reg()
iio: pressure: dps310: add debugfs register access
Documentation/driver-api/iio/core.rst | 2 ++
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-debugfs.c | 34 +++++++++++++++++++++++++++
drivers/iio/pressure/dps310.c | 1 +
include/linux/iio/iio.h | 8 +++----
8 files changed, 46 insertions(+), 53 deletions(-)
base-commit: 27bae9cc834c13108eb5f362da8f3fa5904a4955
--
2.43.0
next reply other threads:[~2026-12-06 10:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 10:03 Rupesh Majhi [this message]
2026-12-06 10:03 ` [PATCH v4 1/7] iio: core: move iio_get_debugfs_dentry() kernel-doc to the C file Rupesh Majhi
2026-12-06 10:03 ` [PATCH v4 2/7] iio: core: add iio_access_debugfs_regmap_reg() Rupesh Majhi
2026-12-06 10:03 ` [PATCH v4 3/7] iio: accel: adxl313: use iio_access_debugfs_regmap_reg() Rupesh Majhi
2026-12-06 10:03 ` [PATCH v4 4/7] iio: accel: adxl372: " Rupesh Majhi
2026-12-06 10:03 ` [PATCH v4 5/7] iio: accel: bma220: " Rupesh Majhi
2026-12-06 10:03 ` [PATCH v4 6/7] iio: adc: ina2xx-adc: " Rupesh Majhi
2026-12-06 10:03 ` [PATCH v4 7/7] iio: pressure: dps310: add debugfs register access Rupesh Majhi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261206100326.45569-1-zoone.rupert@gmail.com \
--to=zoone.rupert@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=corbet@lwn.net \
--cc=crofts@kernel.org \
--cc=dlechner@baylibre.com \
--cc=eajames@linux.ibm.com \
--cc=jic23@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux@analog.com \
--cc=lucas.p.stankus@gmail.com \
--cc=marcelo.schmitt@analog.com \
--cc=nuno.sa@analog.com \
--cc=petre.rodan@subdimension.ro \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox