From: Marc Titinger <mtitinger@baylibre.com>
To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
mturquette@baylibre.com, bcousson@baylibre.com,
ptitiano@baylibre.com, Marc Titinger <mtitinger@baylibre.com>
Subject: [RFC 3/4] iio: ina2xx: add debugfs reg access
Date: Tue, 10 Nov 2015 17:07:32 +0100 [thread overview]
Message-ID: <1447171653-12756-4-git-send-email-mtitinger@baylibre.com> (raw)
In-Reply-To: <1447171653-12756-1-git-send-email-mtitinger@baylibre.com>
iio:device0: ina226
...
3 device-specific attributes found:
attr 0: in_calibscale value: 10000
attr 1: in_mean_raw value: 4
attr 2: in_sampling_frequency value: 455
Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
---
drivers/iio/adc/ina2xx-iio.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/iio/adc/ina2xx-iio.c b/drivers/iio/adc/ina2xx-iio.c
index 92169e1..3e4a4b0 100644
--- a/drivers/iio/adc/ina2xx-iio.c
+++ b/drivers/iio/adc/ina2xx-iio.c
@@ -321,7 +321,19 @@ static const struct iio_chan_spec ina2xx_channels[] = {
IIO_CHAN_SOFT_TIMESTAMP(4),
};
+static int ina2xx_debug_reg(struct iio_dev *indio_dev,
+ unsigned reg, unsigned writeval, unsigned *readval)
+{
+ struct ina2xx_chip_info *chip = iio_priv(indio_dev);
+
+ if (!readval)
+ return regmap_write(chip->regmap, reg, writeval);
+
+ return regmap_read(chip->regmap, reg, readval);
+}
+
static const struct iio_info ina2xx_info = {
+ .debugfs_reg_access = &ina2xx_debug_reg,
.read_raw = &ina2xx_read_raw,
.write_raw = &ina2xx_write_raw,
.driver_module = THIS_MODULE,
--
1.9.1
next prev parent reply other threads:[~2015-11-10 16:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 16:07 [RFC 0/4] IIO: add support for INA2xx power monitor Marc Titinger
2015-11-10 16:07 ` [RFC 1/4] iio: ina2xx: add direct IO support for TI INA2xx Power Monitors Marc Titinger
2015-11-11 10:14 ` Daniel Baluta
2015-11-12 9:25 ` Marc Titinger
2015-11-11 12:09 ` Daniel Baluta
2015-11-12 9:38 ` Marc Titinger
2015-11-12 12:57 ` [RFC v2 1/2] " Marc Titinger
2015-11-14 18:59 ` Jonathan Cameron
2015-11-16 9:31 ` Marc Titinger
2015-11-16 17:27 ` Jonathan Cameron
2015-11-12 12:57 ` [RFC v2 2/2] iio: ina2xx: add SOFTWARE buffer mode using an iio kfifo Marc Titinger
2015-11-10 16:07 ` [RFC 2/4] iio: ina2xx: add SAMP_FREQ attribute Marc Titinger
2015-11-11 10:17 ` Daniel Baluta
2015-11-10 16:07 ` Marc Titinger [this message]
2015-11-10 16:07 ` [RFC 4/4] iio: ina2xx: add SOFTWARE buffer mode using an iio kfifo Marc Titinger
2015-11-10 18:23 ` Lars-Peter Clausen
2015-11-12 10:18 ` Marc Titinger
2015-11-12 10:20 ` Lars-Peter Clausen
2015-11-14 18:44 ` Jonathan Cameron
2015-11-16 9:37 ` Marc Titinger
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=1447171653-12756-4-git-send-email-mtitinger@baylibre.com \
--to=mtitinger@baylibre.com \
--cc=bcousson@baylibre.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=pmeerw@pmeerw.net \
--cc=ptitiano@baylibre.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