mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-11 14:54:47 -04:00
iio: adc: ti-ads112c14: add debugfs register access
Add debugfs register access to the ads112c14 driver. This is a complex chip and being able to poke registers is useful for debugging and diagnostic/calibration purposes. Signed-off-by: David Lechner (TI) <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
36c12dbda8
commit
1ddd64c456
@@ -694,6 +694,19 @@ static int ads112c14_write_raw_get_fmt(struct iio_dev *indio_dev,
|
||||
}
|
||||
}
|
||||
|
||||
static int ads112c14_debugfs_reg_access(struct iio_dev *indio_dev,
|
||||
unsigned int reg,
|
||||
unsigned int writeval,
|
||||
unsigned int *readval)
|
||||
{
|
||||
struct ads112c14_data *data = iio_priv(indio_dev);
|
||||
|
||||
if (readval)
|
||||
return regmap_read(data->regmap, reg, readval);
|
||||
|
||||
return regmap_write(data->regmap, reg, writeval);
|
||||
}
|
||||
|
||||
static int ads112c14_read_label(struct iio_dev *indio_dev,
|
||||
struct iio_chan_spec const *chan, char *label)
|
||||
{
|
||||
@@ -740,6 +753,7 @@ static const struct iio_info ads112c14_info = {
|
||||
.read_avail = ads112c14_read_avail,
|
||||
.write_raw = ads112c14_write_raw,
|
||||
.write_raw_get_fmt = ads112c14_write_raw_get_fmt,
|
||||
.debugfs_reg_access = ads112c14_debugfs_reg_access,
|
||||
.read_label = ads112c14_read_label,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user