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 AD4082, AD4085 and AD4088

Add support for the AD4082, AD4085 and AD4088 SAR ADCs. These devices
share the same resolution as their base variants but differ in LVDS CNV
clock count maximum:
- AD4082 (20-bit, like AD4080): lvds_cnv_clk_cnt_max 8 vs 7
- AD4085 (16-bit, like AD4084): lvds_cnv_clk_cnt_max 8 vs 2
- AD4088 (14-bit, like AD4087): lvds_cnv_clk_cnt_max 8 vs 1

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
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>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
419a96f8 6cfb965a

+45
+45
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 AD4082_CHIP_ID 0x0052 130 131 #define AD4083_CHIP_ID 0x0053 131 132 #define AD4084_CHIP_ID 0x0054 133 + #define AD4085_CHIP_ID 0x0055 132 134 #define AD4086_CHIP_ID 0x0056 133 135 #define AD4087_CHIP_ID 0x0057 136 + #define AD4088_CHIP_ID 0x0058 134 137 135 138 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 136 139 ··· 445 442 446 443 static const struct iio_chan_spec ad4081_channel = AD4080_CHANNEL_DEFINE(20, 32); 447 444 445 + static const struct iio_chan_spec ad4082_channel = AD4080_CHANNEL_DEFINE(20, 32); 446 + 448 447 static const struct iio_chan_spec ad4083_channel = AD4080_CHANNEL_DEFINE(16, 16); 449 448 450 449 static const struct iio_chan_spec ad4084_channel = AD4080_CHANNEL_DEFINE(16, 16); 451 450 451 + static const struct iio_chan_spec ad4085_channel = AD4080_CHANNEL_DEFINE(16, 16); 452 + 452 453 static const struct iio_chan_spec ad4086_channel = AD4080_CHANNEL_DEFINE(14, 16); 453 454 454 455 static const struct iio_chan_spec ad4087_channel = AD4080_CHANNEL_DEFINE(14, 16); 456 + 457 + static const struct iio_chan_spec ad4088_channel = AD4080_CHANNEL_DEFINE(14, 16); 455 458 456 459 static const struct ad4080_chip_info ad4080_chip_info = { 457 460 .name = "ad4080", ··· 477 468 .num_channels = 1, 478 469 .channels = &ad4081_channel, 479 470 .lvds_cnv_clk_cnt_max = 2, 471 + }; 472 + 473 + static const struct ad4080_chip_info ad4082_chip_info = { 474 + .name = "ad4082", 475 + .product_id = AD4082_CHIP_ID, 476 + .scale_table = ad4080_scale_table, 477 + .num_scales = ARRAY_SIZE(ad4080_scale_table), 478 + .num_channels = 1, 479 + .channels = &ad4082_channel, 480 + .lvds_cnv_clk_cnt_max = 8, 480 481 }; 481 482 482 483 static const struct ad4080_chip_info ad4083_chip_info = { ··· 509 490 .lvds_cnv_clk_cnt_max = 2, 510 491 }; 511 492 493 + static const struct ad4080_chip_info ad4085_chip_info = { 494 + .name = "ad4085", 495 + .product_id = AD4085_CHIP_ID, 496 + .scale_table = ad4080_scale_table, 497 + .num_scales = ARRAY_SIZE(ad4080_scale_table), 498 + .num_channels = 1, 499 + .channels = &ad4085_channel, 500 + .lvds_cnv_clk_cnt_max = 8, 501 + }; 502 + 512 503 static const struct ad4080_chip_info ad4086_chip_info = { 513 504 .name = "ad4086", 514 505 .product_id = AD4086_CHIP_ID, ··· 537 508 .num_channels = 1, 538 509 .channels = &ad4087_channel, 539 510 .lvds_cnv_clk_cnt_max = 1, 511 + }; 512 + 513 + static const struct ad4080_chip_info ad4088_chip_info = { 514 + .name = "ad4088", 515 + .product_id = AD4088_CHIP_ID, 516 + .scale_table = ad4080_scale_table, 517 + .num_scales = ARRAY_SIZE(ad4080_scale_table), 518 + .num_channels = 1, 519 + .channels = &ad4088_channel, 520 + .lvds_cnv_clk_cnt_max = 8, 540 521 }; 541 522 542 523 static int ad4080_setup(struct iio_dev *indio_dev) ··· 705 666 static const struct spi_device_id ad4080_id[] = { 706 667 { "ad4080", (kernel_ulong_t)&ad4080_chip_info }, 707 668 { "ad4081", (kernel_ulong_t)&ad4081_chip_info }, 669 + { "ad4082", (kernel_ulong_t)&ad4082_chip_info }, 708 670 { "ad4083", (kernel_ulong_t)&ad4083_chip_info }, 709 671 { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, 672 + { "ad4085", (kernel_ulong_t)&ad4085_chip_info }, 710 673 { "ad4086", (kernel_ulong_t)&ad4086_chip_info }, 711 674 { "ad4087", (kernel_ulong_t)&ad4087_chip_info }, 675 + { "ad4088", (kernel_ulong_t)&ad4088_chip_info }, 712 676 { } 713 677 }; 714 678 MODULE_DEVICE_TABLE(spi, ad4080_id); ··· 719 677 static const struct of_device_id ad4080_of_match[] = { 720 678 { .compatible = "adi,ad4080", &ad4080_chip_info }, 721 679 { .compatible = "adi,ad4081", &ad4081_chip_info }, 680 + { .compatible = "adi,ad4082", &ad4082_chip_info }, 722 681 { .compatible = "adi,ad4083", &ad4083_chip_info }, 723 682 { .compatible = "adi,ad4084", &ad4084_chip_info }, 683 + { .compatible = "adi,ad4085", &ad4085_chip_info }, 724 684 { .compatible = "adi,ad4086", &ad4086_chip_info }, 725 685 { .compatible = "adi,ad4087", &ad4087_chip_info }, 686 + { .compatible = "adi,ad4088", &ad4088_chip_info }, 726 687 { } 727 688 }; 728 689 MODULE_DEVICE_TABLE(of, ad4080_of_match);