Re: [PATCH 1/3] iio: adc: ti-ads112c14: add debugfs register access
From: Jonathan Cameron
Date: Sun Jul 19 2026 - 20:25:00 EST
On Tue, 14 Jul 2026 19:19:30 -0500
"David Lechner (TI)" <dlechner@xxxxxxxxxxxx> wrote:
> 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@xxxxxxxxxxxx>
Given this one is trivial, applied.
Jonathan
> ---
> drivers/iio/adc/ti-ads112c14.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/iio/adc/ti-ads112c14.c b/drivers/iio/adc/ti-ads112c14.c
> index fef3a9c37ced..28824c81908e 100644
> --- a/drivers/iio/adc/ti-ads112c14.c
> +++ b/drivers/iio/adc/ti-ads112c14.c
> @@ -690,6 +690,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)
> {
> @@ -736,6 +749,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,
> };
>
>