Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: ad4080: add support for AD4087

Add support for AD4087 14-bit SAR ADC. The AD4087 differs from
AD4080 in resolution (14-bit vs 20-bit) and LVDS CNV clock count
maximum (1 vs 7).

Changes:
- Add AD4087_CHIP_ID definition (0x0057)
- Create ad4087_channel with 14-bit resolution and 16-bit storage
- Add ad4087_chip_info with lvds_cnv_clk_cnt_max = 1
- Register AD4087 in device ID and OF match tables

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
451a9c4a 24e6d7e9

+15
+15
drivers/iio/adc/ad4080.c
··· 130 130 #define AD4083_CHIP_ID 0x0053 131 131 #define AD4084_CHIP_ID 0x0054 132 132 #define AD4086_CHIP_ID 0x0056 133 + #define AD4087_CHIP_ID 0x0057 133 134 134 135 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 135 136 ··· 448 447 449 448 static const struct iio_chan_spec ad4086_channel = AD4080_CHANNEL_DEFINE(14, 16); 450 449 450 + static const struct iio_chan_spec ad4087_channel = AD4080_CHANNEL_DEFINE(14, 16); 451 + 451 452 static const struct ad4080_chip_info ad4080_chip_info = { 452 453 .name = "ad4080", 453 454 .product_id = AD4080_CHIP_ID, ··· 498 495 .num_channels = 1, 499 496 .channels = &ad4086_channel, 500 497 .lvds_cnv_clk_cnt_max = 4, 498 + }; 499 + 500 + static const struct ad4080_chip_info ad4087_chip_info = { 501 + .name = "ad4087", 502 + .product_id = AD4087_CHIP_ID, 503 + .scale_table = ad4080_scale_table, 504 + .num_scales = ARRAY_SIZE(ad4080_scale_table), 505 + .num_channels = 1, 506 + .channels = &ad4087_channel, 507 + .lvds_cnv_clk_cnt_max = 1, 501 508 }; 502 509 503 510 static int ad4080_setup(struct iio_dev *indio_dev) ··· 669 656 { "ad4083", (kernel_ulong_t)&ad4083_chip_info }, 670 657 { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, 671 658 { "ad4086", (kernel_ulong_t)&ad4086_chip_info }, 659 + { "ad4087", (kernel_ulong_t)&ad4087_chip_info }, 672 660 { } 673 661 }; 674 662 MODULE_DEVICE_TABLE(spi, ad4080_id); ··· 680 666 { .compatible = "adi,ad4083", &ad4083_chip_info }, 681 667 { .compatible = "adi,ad4084", &ad4084_chip_info }, 682 668 { .compatible = "adi,ad4086", &ad4086_chip_info }, 669 + { .compatible = "adi,ad4087", &ad4087_chip_info }, 683 670 { } 684 671 }; 685 672 MODULE_DEVICE_TABLE(of, ad4080_of_match);