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

iio: adc: ad4030: add support for ad4632-16 and ad4632-24

AD4632-24 and AD4632-16 are 2 channels ADCs. Both channels are
interleaved bit per bit on SDO line.

Both of them do not have evaluation board. As such, the support added
here can't be tested. Support is provided as best effort until someone get
their hands on one.

Signed-off-by: Esteban Blanc <eblanc@baylibre.com>
Link: https://patch.msgid.link/20250214-eblanc-ad4630_v1-v4-5-135dd66cab6a@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Esteban Blanc and committed by
Jonathan Cameron
ec25cf6f c8ed843c

+41
+41
drivers/iio/adc/ad4030.c
··· 35 35 #define AD4030_REG_CHIP_GRADE_AD4030_24_GRADE 0x10 36 36 #define AD4030_REG_CHIP_GRADE_AD4630_16_GRADE 0x03 37 37 #define AD4030_REG_CHIP_GRADE_AD4630_24_GRADE 0x00 38 + #define AD4030_REG_CHIP_GRADE_AD4632_16_GRADE 0x05 39 + #define AD4030_REG_CHIP_GRADE_AD4632_24_GRADE 0x02 38 40 #define AD4030_REG_CHIP_GRADE_MASK_CHIP_GRADE GENMASK(7, 3) 39 41 #define AD4030_REG_SCRATCH_PAD 0x0A 40 42 #define AD4030_REG_SPI_REVISION 0x0B ··· 108 106 #define AD4030_TCYC_NS 500 109 107 #define AD4030_TCYC_ADJUSTED_NS (AD4030_TCYC_NS - AD4030_TCNVL_NS) 110 108 #define AD4030_TRESET_PW_NS 50 109 + #define AD4632_TCYC_NS 2000 110 + #define AD4632_TCYC_ADJUSTED_NS (AD4632_TCYC_NS - AD4030_TCNVL_NS) 111 + #define AD4030_TRESET_COM_DELAY_MS 750 111 112 112 113 enum ad4030_out_mode { 113 114 AD4030_OUT_DATA_MD_DIFF, ··· 1166 1161 .tcyc_ns = AD4030_TCYC_ADJUSTED_NS, 1167 1162 }; 1168 1163 1164 + static const struct ad4030_chip_info ad4632_16_chip_info = { 1165 + .name = "ad4632-16", 1166 + .available_masks = ad4630_channel_masks, 1167 + .channels = { 1168 + AD4030_CHAN_DIFF(0, ad4030_16_scan_types), 1169 + AD4030_CHAN_DIFF(1, ad4030_16_scan_types), 1170 + AD4030_CHAN_CMO(2, 0), 1171 + AD4030_CHAN_CMO(3, 1), 1172 + IIO_CHAN_SOFT_TIMESTAMP(4), 1173 + }, 1174 + .grade = AD4030_REG_CHIP_GRADE_AD4632_16_GRADE, 1175 + .precision_bits = 16, 1176 + .num_voltage_inputs = 2, 1177 + .tcyc_ns = AD4632_TCYC_ADJUSTED_NS, 1178 + }; 1179 + 1180 + static const struct ad4030_chip_info ad4632_24_chip_info = { 1181 + .name = "ad4632-24", 1182 + .available_masks = ad4630_channel_masks, 1183 + .channels = { 1184 + AD4030_CHAN_DIFF(0, ad4030_24_scan_types), 1185 + AD4030_CHAN_DIFF(1, ad4030_24_scan_types), 1186 + AD4030_CHAN_CMO(2, 0), 1187 + AD4030_CHAN_CMO(3, 1), 1188 + IIO_CHAN_SOFT_TIMESTAMP(4), 1189 + }, 1190 + .grade = AD4030_REG_CHIP_GRADE_AD4632_24_GRADE, 1191 + .precision_bits = 24, 1192 + .num_voltage_inputs = 2, 1193 + .tcyc_ns = AD4632_TCYC_ADJUSTED_NS, 1194 + }; 1195 + 1169 1196 static const struct spi_device_id ad4030_id_table[] = { 1170 1197 { "ad4030-24", (kernel_ulong_t)&ad4030_24_chip_info }, 1171 1198 { "ad4630-16", (kernel_ulong_t)&ad4630_16_chip_info }, 1172 1199 { "ad4630-24", (kernel_ulong_t)&ad4630_24_chip_info }, 1200 + { "ad4632-16", (kernel_ulong_t)&ad4632_16_chip_info }, 1201 + { "ad4632-24", (kernel_ulong_t)&ad4632_24_chip_info }, 1173 1202 { } 1174 1203 }; 1175 1204 MODULE_DEVICE_TABLE(spi, ad4030_id_table); ··· 1212 1173 { .compatible = "adi,ad4030-24", .data = &ad4030_24_chip_info }, 1213 1174 { .compatible = "adi,ad4630-16", .data = &ad4630_16_chip_info }, 1214 1175 { .compatible = "adi,ad4630-24", .data = &ad4630_24_chip_info }, 1176 + { .compatible = "adi,ad4632-16", .data = &ad4632_16_chip_info }, 1177 + { .compatible = "adi,ad4632-24", .data = &ad4632_24_chip_info }, 1215 1178 { } 1216 1179 }; 1217 1180 MODULE_DEVICE_TABLE(of, ad4030_of_match);