Re: [PATCH v2 06/10] iio: adc: ti-ads112c14: support external clock

From: Jonathan Cameron

Date: Sat Sep 05 2026 - 21:41:58 EST


> Add support for an external clock source to the TI ADS112C14 ADC driver.
> The unused fclk_Hz field is added in preparation for filter support.
>
> Signed-off-by: David Lechner (TI) <dlechner@xxxxxxxxxxxx>
One minor thing inline.

>
> diff --git a/drivers/iio/adc/ti-ads112c14.c b/drivers/iio/adc/ti-ads112c14.c
> index c03789c3d95e..55462fc57752 100644
> --- a/drivers/iio/adc/ti-ads112c14.c
> +++ b/drivers/iio/adc/ti-ads112c14.c



> @@ -1737,6 +1752,20 @@ static int ads112c14_probe(struct i2c_client *client)
> return ret;
> }
>
> + if (clk) {
> + ret = regmap_update_bits(data->regmap, ADS112C14_REG_GPIO_CFG,
> + ADS112C14_GPIO_CFG_GPIO3_CFG,
> + FIELD_PREP(ADS112C14_GPIO_CFG_GPIO3_CFG,
> + ADS112C14_GPIO_CFG_GPIO_CFG_INPUT));
> + if (ret)
> + return ret;
> +
> + ret = regmap_set_bits(data->regmap, ADS112C14_REG_DEVICE_CFG,
> + ADS112C14_DEVICE_CFG_CLK_SEL);

Given it is a pick between two things I'd rather see a FIELD_PREP()
for this one and a field value name that tells us what is being
picked. That means adding defines for values 0 and 1.

--
Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>