Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754472AbbKJQIe (ORCPT ); Tue, 10 Nov 2015 11:08:34 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36150 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754394AbbKJQHz (ORCPT ); Tue, 10 Nov 2015 11:07:55 -0500 From: Marc Titinger 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 Subject: [RFC 3/4] iio: ina2xx: add debugfs reg access Date: Tue, 10 Nov 2015 17:07:32 +0100 Message-Id: <1447171653-12756-4-git-send-email-mtitinger@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447171653-12756-1-git-send-email-mtitinger@baylibre.com> References: <1447171653-12756-1-git-send-email-mtitinger@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1397 Lines: 44 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/