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 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 <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
4028cbcf f11de952

+15
+15
drivers/iio/adc/ad4080.c
··· 127 127 #define AD4080_SPI_READ BIT(7) 128 128 #define AD4080_CHIP_ID 0x0050 129 129 #define AD4081_CHIP_ID 0x0051 130 + #define AD4083_CHIP_ID 0x0053 130 131 #define AD4084_CHIP_ID 0x0054 131 132 132 133 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 ··· 440 439 441 440 static const struct iio_chan_spec ad4081_channel = AD4080_CHANNEL_DEFINE(20, 32); 442 441 442 + static const struct iio_chan_spec ad4083_channel = AD4080_CHANNEL_DEFINE(16, 16); 443 + 443 444 static const struct iio_chan_spec ad4084_channel = AD4080_CHANNEL_DEFINE(16, 16); 444 445 445 446 static const struct ad4080_chip_info ad4080_chip_info = { ··· 462 459 .num_channels = 1, 463 460 .channels = &ad4081_channel, 464 461 .lvds_cnv_clk_cnt_max = 2, 462 + }; 463 + 464 + static const struct ad4080_chip_info ad4083_chip_info = { 465 + .name = "ad4083", 466 + .product_id = AD4083_CHIP_ID, 467 + .scale_table = ad4080_scale_table, 468 + .num_scales = ARRAY_SIZE(ad4080_scale_table), 469 + .num_channels = 1, 470 + .channels = &ad4083_channel, 471 + .lvds_cnv_clk_cnt_max = 5, 465 472 }; 466 473 467 474 static const struct ad4080_chip_info ad4084_chip_info = { ··· 640 627 static const struct spi_device_id ad4080_id[] = { 641 628 { "ad4080", (kernel_ulong_t)&ad4080_chip_info }, 642 629 { "ad4081", (kernel_ulong_t)&ad4081_chip_info }, 630 + { "ad4083", (kernel_ulong_t)&ad4083_chip_info }, 643 631 { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, 644 632 { } 645 633 }; ··· 649 635 static const struct of_device_id ad4080_of_match[] = { 650 636 { .compatible = "adi,ad4080", &ad4080_chip_info }, 651 637 { .compatible = "adi,ad4081", &ad4081_chip_info }, 638 + { .compatible = "adi,ad4083", &ad4083_chip_info }, 652 639 { .compatible = "adi,ad4084", &ad4084_chip_info }, 653 640 { } 654 641 };