mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 22:08:33 -04:00
iio: adc: ad7380: add adaq4381-4 support
adaq4381-4 is the 14 bits version of adaq4380-1 chip. Add support for it. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250226-ad7380-add-adaq4381-4-support-v1-1-f350ab872d37@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
1e30116da0
commit
f66d625c4d
@@ -15,6 +15,7 @@
|
||||
* ad7386/7/8-4 : https://www.analog.com/media/en/technical-documentation/data-sheets/ad7386-4-7387-4-7388-4.pdf
|
||||
* adaq4370-4 : https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4370-4.pdf
|
||||
* adaq4380-4 : https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4380-4.pdf
|
||||
* adaq4381-4 : https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4381-4.pdf
|
||||
*/
|
||||
|
||||
#include <linux/align.h>
|
||||
@@ -287,6 +288,7 @@ DEFINE_AD7380_2_CHANNEL(ad7381_channels, 14, 1, s);
|
||||
DEFINE_AD7380_4_CHANNEL(ad7380_4_channels, 16, 1, s);
|
||||
DEFINE_AD7380_4_CHANNEL(ad7381_4_channels, 14, 1, s);
|
||||
DEFINE_ADAQ4380_4_CHANNEL(adaq4380_4_channels, 16, 1, s);
|
||||
DEFINE_ADAQ4380_4_CHANNEL(adaq4381_4_channels, 14, 1, s);
|
||||
/* pseudo differential */
|
||||
DEFINE_AD7380_2_CHANNEL(ad7383_channels, 16, 0, s);
|
||||
DEFINE_AD7380_2_CHANNEL(ad7384_channels, 14, 0, s);
|
||||
@@ -599,6 +601,19 @@ static const struct ad7380_chip_info adaq4380_4_chip_info = {
|
||||
.timing_specs = &ad7380_4_timing,
|
||||
};
|
||||
|
||||
static const struct ad7380_chip_info adaq4381_4_chip_info = {
|
||||
.name = "adaq4381-4",
|
||||
.channels = adaq4381_4_channels,
|
||||
.num_channels = ARRAY_SIZE(adaq4381_4_channels),
|
||||
.num_simult_channels = 4,
|
||||
.supplies = adaq4380_supplies,
|
||||
.num_supplies = ARRAY_SIZE(adaq4380_supplies),
|
||||
.adaq_internal_ref_only = true,
|
||||
.has_hardware_gain = true,
|
||||
.available_scan_masks = ad7380_4_channel_scan_masks,
|
||||
.timing_specs = &ad7380_4_timing,
|
||||
};
|
||||
|
||||
struct ad7380_state {
|
||||
const struct ad7380_chip_info *chip_info;
|
||||
struct spi_device *spi;
|
||||
@@ -1582,6 +1597,7 @@ static const struct of_device_id ad7380_of_match_table[] = {
|
||||
{ .compatible = "adi,ad7388-4", .data = &ad7388_4_chip_info },
|
||||
{ .compatible = "adi,adaq4370-4", .data = &adaq4370_4_chip_info },
|
||||
{ .compatible = "adi,adaq4380-4", .data = &adaq4380_4_chip_info },
|
||||
{ .compatible = "adi,adaq4381-4", .data = &adaq4381_4_chip_info },
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -1602,6 +1618,7 @@ static const struct spi_device_id ad7380_id_table[] = {
|
||||
{ "ad7388-4", (kernel_ulong_t)&ad7388_4_chip_info },
|
||||
{ "adaq4370-4", (kernel_ulong_t)&adaq4370_4_chip_info },
|
||||
{ "adaq4380-4", (kernel_ulong_t)&adaq4380_4_chip_info },
|
||||
{ "adaq4381-4", (kernel_ulong_t)&adaq4381_4_chip_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, ad7380_id_table);
|
||||
|
||||
Reference in New Issue
Block a user