From: Antoniu Miclaus Date: Tue, 21 Oct 2025 10:53:44 +0000 (+0000) Subject: iio: adc: ad4080: add support for AD4083 X-Git-Tag: v6.19-rc1~65^2~58^2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4028cbcf3415f6e0810326d87c6e0b494814ae12;p=thirdparty%2Fkernel%2Flinux.git iio: adc: ad4080: add support for AD4083 Add support for AD4083 16-bit SAR ADC. The AD4083 differs from AD4080 in resolution (16-bit vs 20-bit) and LVDS CNV clock count maximum (5 vs 7). Changes: - Add AD4083_CHIP_ID definition (0x0053) - Create ad4083_channel with 16-bit resolution and storage - Add ad4083_chip_info with lvds_cnv_clk_cnt_max = 5 - Register AD4083 in device ID and OF match tables Signed-off-by: Antoniu Miclaus Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c index 5940651655dfd..e2cdca2e91749 100644 --- a/drivers/iio/adc/ad4080.c +++ b/drivers/iio/adc/ad4080.c @@ -127,6 +127,7 @@ #define AD4080_SPI_READ BIT(7) #define AD4080_CHIP_ID 0x0050 #define AD4081_CHIP_ID 0x0051 +#define AD4083_CHIP_ID 0x0053 #define AD4084_CHIP_ID 0x0054 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 @@ -439,6 +440,8 @@ static const struct iio_chan_spec ad4080_channel = AD4080_CHANNEL_DEFINE(20, 32) static const struct iio_chan_spec ad4081_channel = AD4080_CHANNEL_DEFINE(20, 32); +static const struct iio_chan_spec ad4083_channel = AD4080_CHANNEL_DEFINE(16, 16); + static const struct iio_chan_spec ad4084_channel = AD4080_CHANNEL_DEFINE(16, 16); static const struct ad4080_chip_info ad4080_chip_info = { @@ -461,6 +464,16 @@ static const struct ad4080_chip_info ad4081_chip_info = { .lvds_cnv_clk_cnt_max = 2, }; +static const struct ad4080_chip_info ad4083_chip_info = { + .name = "ad4083", + .product_id = AD4083_CHIP_ID, + .scale_table = ad4080_scale_table, + .num_scales = ARRAY_SIZE(ad4080_scale_table), + .num_channels = 1, + .channels = &ad4083_channel, + .lvds_cnv_clk_cnt_max = 5, +}; + static const struct ad4080_chip_info ad4084_chip_info = { .name = "ad4084", .product_id = AD4084_CHIP_ID, @@ -627,6 +640,7 @@ static int ad4080_probe(struct spi_device *spi) static const struct spi_device_id ad4080_id[] = { { "ad4080", (kernel_ulong_t)&ad4080_chip_info }, { "ad4081", (kernel_ulong_t)&ad4081_chip_info }, + { "ad4083", (kernel_ulong_t)&ad4083_chip_info }, { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, { } }; @@ -635,6 +649,7 @@ MODULE_DEVICE_TABLE(spi, ad4080_id); static const struct of_device_id ad4080_of_match[] = { { .compatible = "adi,ad4080", &ad4080_chip_info }, { .compatible = "adi,ad4081", &ad4081_chip_info }, + { .compatible = "adi,ad4083", &ad4083_chip_info }, { .compatible = "adi,ad4084", &ad4084_chip_info }, { } };