Skip to content

Commit 7853cf5

Browse files
amiclausjic23
authored andcommitted
iio: adc: ad4080: add support for AD4884
Add support for the AD4884, a dual-channel, 16-bit, 40 MSPS SAR ADC. The AD4884 is the dual-channel variant of the AD4084, sharing the same register map and SPI interface as the rest of the AD4080 family. Like the AD4880, it uses two independent ADC channels, each with its own SPI configuration interface. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 4bff2ca commit 7853cf5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

drivers/iio/adc/ad4080.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
#define AD4087_CHIP_ID 0x0057
137137
#define AD4088_CHIP_ID 0x0058
138138
#define AD4880_CHIP_ID 0x0750
139+
#define AD4884_CHIP_ID 0x005C
139140

140141
#define AD4080_MAX_CHANNELS 2
141142

@@ -541,6 +542,11 @@ static const struct iio_chan_spec ad4880_channels[] = {
541542
AD4880_CHANNEL_DEFINE(20, 32, 1),
542543
};
543544

545+
static const struct iio_chan_spec ad4884_channels[] = {
546+
AD4880_CHANNEL_DEFINE(16, 16, 0),
547+
AD4880_CHANNEL_DEFINE(16, 16, 1),
548+
};
549+
544550
static const struct ad4080_chip_info ad4080_chip_info = {
545551
.name = "ad4080",
546552
.product_id = AD4080_CHIP_ID,
@@ -641,6 +647,16 @@ static const struct ad4080_chip_info ad4880_chip_info = {
641647
.lvds_cnv_clk_cnt_max = AD4080_LVDS_CNV_CLK_CNT_MAX,
642648
};
643649

650+
static const struct ad4080_chip_info ad4884_chip_info = {
651+
.name = "ad4884",
652+
.product_id = AD4884_CHIP_ID,
653+
.scale_table = ad4080_scale_table,
654+
.num_scales = ARRAY_SIZE(ad4080_scale_table),
655+
.num_channels = 2,
656+
.channels = ad4884_channels,
657+
.lvds_cnv_clk_cnt_max = 2,
658+
};
659+
644660
static int ad4080_setup_channel(struct ad4080_state *st, unsigned int ch)
645661
{
646662
struct device *dev = regmap_get_device(st->regmap[ch]);
@@ -843,6 +859,7 @@ static const struct spi_device_id ad4080_id[] = {
843859
{ "ad4087", (kernel_ulong_t)&ad4087_chip_info },
844860
{ "ad4088", (kernel_ulong_t)&ad4088_chip_info },
845861
{ "ad4880", (kernel_ulong_t)&ad4880_chip_info },
862+
{ "ad4884", (kernel_ulong_t)&ad4884_chip_info },
846863
{ }
847864
};
848865
MODULE_DEVICE_TABLE(spi, ad4080_id);
@@ -858,6 +875,7 @@ static const struct of_device_id ad4080_of_match[] = {
858875
{ .compatible = "adi,ad4087", &ad4087_chip_info },
859876
{ .compatible = "adi,ad4088", &ad4088_chip_info },
860877
{ .compatible = "adi,ad4880", &ad4880_chip_info },
878+
{ .compatible = "adi,ad4884", &ad4884_chip_info },
861879
{ }
862880
};
863881
MODULE_DEVICE_TABLE(of, ad4080_of_match);

0 commit comments

Comments
 (0)