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

iio: adc: adc128s052: Support ROHM BD7910[0,1,2,3]

The ROHM BD79100, BD79101, BD79102, BD79103 are very similar ADCs as the
ROHM BD79104. The BD79100 has only 1 channel. BD79101 has 2 channels and
the BD79102 has 4 channels. Both BD79103 and BD79104 have 4 channels,
and, based on the data sheets, they seem identical from the software
point-of-view.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/bb7a775fd1a6135889a72ae63c45e2a4347a2aa5.1755504346.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matti Vaittinen and committed by
Jonathan Cameron
4340feb4 9e9b0b97

+36
+36
drivers/iio/adc/ti-adc128s052.c
··· 99 99 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) \ 100 100 } 101 101 102 + static const struct iio_chan_spec simple_1chan_adc_channels[] = { 103 + ADC128_VOLTAGE_CHANNEL(0), 104 + }; 105 + 102 106 static const struct iio_chan_spec simple_2chan_adc_channels[] = { 103 107 ADC128_VOLTAGE_CHANNEL(0), 104 108 ADC128_VOLTAGE_CHANNEL(1), ··· 144 140 .channels = simple_8chan_adc_channels, 145 141 .num_channels = ARRAY_SIZE(simple_8chan_adc_channels), 146 142 .refname = "vref", 143 + }; 144 + 145 + static const struct adc128_configuration bd79100_config = { 146 + .channels = simple_1chan_adc_channels, 147 + .num_channels = ARRAY_SIZE(simple_1chan_adc_channels), 148 + .refname = "vdd", 149 + .other_regulators = &bd79104_regulators, 150 + .num_other_regulators = 1, 151 + }; 152 + 153 + static const struct adc128_configuration bd79101_config = { 154 + .channels = simple_2chan_adc_channels, 155 + .num_channels = ARRAY_SIZE(simple_2chan_adc_channels), 156 + .refname = "vdd", 157 + .other_regulators = &bd79104_regulators, 158 + .num_other_regulators = 1, 159 + }; 160 + 161 + static const struct adc128_configuration bd79102_config = { 162 + .channels = simple_4chan_adc_channels, 163 + .num_channels = ARRAY_SIZE(simple_4chan_adc_channels), 164 + .refname = "vdd", 165 + .other_regulators = &bd79104_regulators, 166 + .num_other_regulators = 1, 147 167 }; 148 168 149 169 static const struct adc128_configuration bd79104_config = { ··· 238 210 { .compatible = "ti,adc124s021", .data = &adc124s_config }, 239 211 { .compatible = "ti,adc124s051", .data = &adc124s_config }, 240 212 { .compatible = "ti,adc124s101", .data = &adc124s_config }, 213 + { .compatible = "rohm,bd79100", .data = &bd79100_config }, 214 + { .compatible = "rohm,bd79101", .data = &bd79101_config }, 215 + { .compatible = "rohm,bd79102", .data = &bd79102_config }, 216 + { .compatible = "rohm,bd79103", .data = &bd79104_config }, 241 217 { .compatible = "rohm,bd79104", .data = &bd79104_config }, 242 218 { } 243 219 }; ··· 255 223 { "adc124s021", (kernel_ulong_t)&adc124s_config }, 256 224 { "adc124s051", (kernel_ulong_t)&adc124s_config }, 257 225 { "adc124s101", (kernel_ulong_t)&adc124s_config }, 226 + { "bd79100", (kernel_ulong_t)&bd79100_config }, 227 + { "bd79101", (kernel_ulong_t)&bd79101_config }, 228 + { "bd79102", (kernel_ulong_t)&bd79102_config }, 229 + { "bd79103", (kernel_ulong_t)&bd79104_config }, 258 230 { "bd79104", (kernel_ulong_t)&bd79104_config }, 259 231 { } 260 232 };