mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <marcelo.schmitt@analog.com>
To: <beniamin.bia@analog.com>, <paul.cercueil@analog.com>,
	<Michael.Hennerich@analog.com>, <lars@metafoo.de>,
	<jic23@kernel.org>, <marcelo.schmitt1@gmail.com>
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 7/7] iio: adc: ad7091r-base: Add debugfs reg access
Date: Tue, 21 Nov 2023 18:36:52 -0300	[thread overview]
Message-ID: <3fdf3d1815b5181dc01490e2500b4eb4fe3fe579.1700595310.git.marcelo.schmitt1@gmail.com> (raw)
In-Reply-To: <cover.1700595310.git.marcelo.schmitt1@gmail.com>

From: Marcelo Schmitt <marcelo.schmitt@analog.com>

Add direct register access support for AD7091R-2/-4/-5/-8 ADCs.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
 drivers/iio/adc/ad7091r-base.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c
index f9b4f91d1c4f..798f7b3cc7e1 100644
--- a/drivers/iio/adc/ad7091r-base.c
+++ b/drivers/iio/adc/ad7091r-base.c
@@ -157,8 +157,20 @@ static int ad7091r_read_raw(struct iio_dev *iio_dev,
 	return ret;
 }
 
+static int ad7091r_reg_access(struct iio_dev *indio_dev, unsigned int reg,
+			      unsigned int writeval, unsigned int *readval)
+{
+	struct ad7091r_state *st  = iio_priv(indio_dev);
+
+	if (readval)
+		return regmap_read(st->map, reg, readval);
+
+	return regmap_write(st->map, reg, writeval);
+}
+
 static const struct iio_info ad7091r_info = {
 	.read_raw = ad7091r_read_raw,
+	.debugfs_reg_access = &ad7091r_reg_access,
 };
 
 static irqreturn_t ad7091r_event_handler(int irq, void *private)
-- 
2.42.0


      parent reply	other threads:[~2023-11-21 21:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 21:33 [PATCH 0/7] Add support for AD7091R-2/-4/-8 marcelo.schmitt
2023-11-21 21:34 ` [PATCH 1/7] iio: adc: ad7091r-base: Set alert config and drvdata marcelo.schmitt
2023-11-21 21:35 ` [PATCH 2/7] MAINTAINERS: Add MAINTAINERS entry for AD7091R marcelo.schmitt
2023-11-21 21:35 ` [PATCH 3/7] iio: adc: ad7091r: Move defines to header file marcelo.schmitt
2023-11-22 12:40   ` kernel test robot
2023-11-21 21:35 ` [PATCH 4/7] iio: adc: ad7091r: Alloc IIO device before generic probe marcelo.schmitt
2023-11-21 21:36 ` [PATCH 5/7] dt-bindings: iio: Add binding documentation for AD7091R-8 marcelo.schmitt
2023-11-22  9:57   ` Krzysztof Kozlowski
2023-11-22 12:40   ` kernel test robot
2023-11-21 21:36 ` [PATCH 6/7] iio: adc: Add support " marcelo.schmitt
2023-11-22 10:01   ` Krzysztof Kozlowski
2023-11-23  6:30   ` Dan Carpenter
2023-11-21 21:36 ` marcelo.schmitt [this message]

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=3fdf3d1815b5181dc01490e2500b4eb4fe3fe579.1700595310.git.marcelo.schmitt1@gmail.com \
    --to=marcelo.schmitt@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=beniamin.bia@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=paul.cercueil@analog.com \
    /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

all inboxes | Powered by JetHome®