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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad4080: add support for AD4086

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

Changes:
- Add AD4086_CHIP_ID definition (0x0056)
- Create ad4086_channel with 14-bit resolution and 16-bit storage
- Add ad4086_chip_info with lvds_cnv_clk_cnt_max = 4
- Register AD4086 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
916354e7 45e81d6a

+15
+15
drivers/iio/adc/ad4080.c
··· 129 129 #define AD4081_CHIP_ID 0x0051 130 130 #define AD4083_CHIP_ID 0x0053 131 131 #define AD4084_CHIP_ID 0x0054 132 + #define AD4086_CHIP_ID 0x0056 132 133 133 134 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 134 135 ··· 445 444 446 445 static const struct iio_chan_spec ad4084_channel = AD4080_CHANNEL_DEFINE(16, 16); 447 446 447 + static const struct iio_chan_spec ad4086_channel = AD4080_CHANNEL_DEFINE(14, 16); 448 + 448 449 static const struct ad4080_chip_info ad4080_chip_info = { 449 450 .name = "ad4080", 450 451 .product_id = AD4080_CHIP_ID, ··· 485 482 .num_channels = 1, 486 483 .channels = &ad4084_channel, 487 484 .lvds_cnv_clk_cnt_max = 2, 485 + }; 486 + 487 + static const struct ad4080_chip_info ad4086_chip_info = { 488 + .name = "ad4086", 489 + .product_id = AD4086_CHIP_ID, 490 + .scale_table = ad4080_scale_table, 491 + .num_scales = ARRAY_SIZE(ad4080_scale_table), 492 + .num_channels = 1, 493 + .channels = &ad4086_channel, 494 + .lvds_cnv_clk_cnt_max = 4, 488 495 }; 489 496 490 497 static int ad4080_setup(struct iio_dev *indio_dev) ··· 655 642 { "ad4081", (kernel_ulong_t)&ad4081_chip_info }, 656 643 { "ad4083", (kernel_ulong_t)&ad4083_chip_info }, 657 644 { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, 645 + { "ad4086", (kernel_ulong_t)&ad4086_chip_info }, 658 646 { } 659 647 }; 660 648 MODULE_DEVICE_TABLE(spi, ad4080_id); ··· 665 651 { .compatible = "adi,ad4081", &ad4081_chip_info }, 666 652 { .compatible = "adi,ad4083", &ad4083_chip_info }, 667 653 { .compatible = "adi,ad4084", &ad4084_chip_info }, 654 + { .compatible = "adi,ad4086", &ad4086_chip_info }, 668 655 { } 669 656 }; 670 657 MODULE_DEVICE_TABLE(of, ad4080_of_match);