diff options
| author | Antoniu Miclaus <antoniu.miclaus@analog.com> | 2025-10-07 14:15:23 +0300 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-10-19 13:59:22 +0300 |
| commit | 6c3e7265734bbde7347d44fa8e5720bcc5ad5cea (patch) | |
| tree | c8a96d97146910e8b6769f4963460bd2b6f96544 | |
| parent | 1b86053ba6f818624efffa8d1b890b4c74886903 (diff) | |
| download | linux-6c3e7265734bbde7347d44fa8e5720bcc5ad5cea.tar.xz | |
iio: adc: ad4080: add support for AD4084
Add support for AD4084 16-bit SAR ADC. The AD4084 differs from
AD4080 in resolution (16-bit vs 20-bit) and LVDS CNV clock count
maximum (2 vs 7).
Changes:
- Add AD4084_CHIP_ID definition (0x0054)
- Create ad4084_channel with 16-bit resolution and storage
- Add ad4084_chip_info with appropriate configuration
- Register AD4084 in device ID and OF match tables
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| -rw-r--r-- | drivers/iio/adc/ad4080.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c index 646a4de01ca7..d243b4336ac6 100644 --- a/drivers/iio/adc/ad4080.c +++ b/drivers/iio/adc/ad4080.c @@ -126,6 +126,7 @@ /* Miscellaneous Definitions */ #define AD4080_SPI_READ BIT(7) #define AD4080_CHIP_ID 0x0050 +#define AD4084_CHIP_ID 0x0054 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 @@ -435,6 +436,8 @@ static struct iio_chan_spec_ext_info ad4080_ext_info[] = { static const struct iio_chan_spec ad4080_channel = AD4080_CHANNEL_DEFINE(20, 32); +static const struct iio_chan_spec ad4084_channel = AD4080_CHANNEL_DEFINE(16, 16); + static const struct ad4080_chip_info ad4080_chip_info = { .name = "ad4080", .product_id = AD4080_CHIP_ID, @@ -445,6 +448,16 @@ static const struct ad4080_chip_info ad4080_chip_info = { .lvds_cnv_clk_cnt_max = AD4080_LVDS_CNV_CLK_CNT_MAX, }; +static const struct ad4080_chip_info ad4084_chip_info = { + .name = "ad4084", + .product_id = AD4084_CHIP_ID, + .scale_table = ad4080_scale_table, + .num_scales = ARRAY_SIZE(ad4080_scale_table), + .num_channels = 1, + .channels = &ad4084_channel, + .lvds_cnv_clk_cnt_max = 2, +}; + static int ad4080_setup(struct iio_dev *indio_dev) { struct ad4080_state *st = iio_priv(indio_dev); @@ -600,12 +613,14 @@ static int ad4080_probe(struct spi_device *spi) static const struct spi_device_id ad4080_id[] = { { "ad4080", (kernel_ulong_t)&ad4080_chip_info }, + { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, { } }; MODULE_DEVICE_TABLE(spi, ad4080_id); static const struct of_device_id ad4080_of_match[] = { { .compatible = "adi,ad4080", &ad4080_chip_info }, + { .compatible = "adi,ad4084", &ad4084_chip_info }, { } }; MODULE_DEVICE_TABLE(of, ad4080_of_match); |
