Commit 569dc805 authored by David Lechner's avatar David Lechner Committed by Jonathan Cameron

staging: iio: resolver: ad2s1210: add debugfs reg access

This add an implementation of debugfs_reg_access for the AD2S1210
driver.
Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-11-fa4364281745@baylibre.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b3689e14
...@@ -614,9 +614,29 @@ static int ad2s1210_initial(struct ad2s1210_state *st) ...@@ -614,9 +614,29 @@ static int ad2s1210_initial(struct ad2s1210_state *st)
return ret; return ret;
} }
static int ad2s1210_debugfs_reg_access(struct iio_dev *indio_dev,
unsigned int reg, unsigned int writeval,
unsigned int *readval)
{
struct ad2s1210_state *st = iio_priv(indio_dev);
int ret;
mutex_lock(&st->lock);
if (readval)
ret = regmap_read(st->regmap, reg, readval);
else
ret = regmap_write(st->regmap, reg, writeval);
mutex_unlock(&st->lock);
return ret;
}
static const struct iio_info ad2s1210_info = { static const struct iio_info ad2s1210_info = {
.read_raw = ad2s1210_read_raw, .read_raw = ad2s1210_read_raw,
.attrs = &ad2s1210_attribute_group, .attrs = &ad2s1210_attribute_group,
.debugfs_reg_access = &ad2s1210_debugfs_reg_access,
}; };
static int ad2s1210_setup_clocks(struct ad2s1210_state *st) static int ad2s1210_setup_clocks(struct ad2s1210_state *st)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment