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: adc128s052: Rename channel structs

The adc128s052 can be used to drive a few other ADCs but the TI's ADCs
it was originally intended for. The TI's IC variants model numbers don't
(trivially) explain the channel configuration (for a reader working with
other than TI's ICs).

Rename the channel configuration structures to explicitly explain they
are used for simple ADCs, having 2, 4 or 8 channels.

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

authored by

Matti Vaittinen and committed by
Jonathan Cameron
9e9b0b97 7fe5b83f

+21 -21
+21 -21
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 adc128s052_channels[] = { 102 + static const struct iio_chan_spec simple_2chan_adc_channels[] = { 103 + ADC128_VOLTAGE_CHANNEL(0), 104 + ADC128_VOLTAGE_CHANNEL(1), 105 + }; 106 + 107 + static const struct iio_chan_spec simple_4chan_adc_channels[] = { 108 + ADC128_VOLTAGE_CHANNEL(0), 109 + ADC128_VOLTAGE_CHANNEL(1), 110 + ADC128_VOLTAGE_CHANNEL(2), 111 + ADC128_VOLTAGE_CHANNEL(3), 112 + }; 113 + 114 + static const struct iio_chan_spec simple_8chan_adc_channels[] = { 103 115 ADC128_VOLTAGE_CHANNEL(0), 104 116 ADC128_VOLTAGE_CHANNEL(1), 105 117 ADC128_VOLTAGE_CHANNEL(2), ··· 122 110 ADC128_VOLTAGE_CHANNEL(7), 123 111 }; 124 112 125 - static const struct iio_chan_spec adc122s021_channels[] = { 126 - ADC128_VOLTAGE_CHANNEL(0), 127 - ADC128_VOLTAGE_CHANNEL(1), 128 - }; 129 - 130 - static const struct iio_chan_spec adc124s021_channels[] = { 131 - ADC128_VOLTAGE_CHANNEL(0), 132 - ADC128_VOLTAGE_CHANNEL(1), 133 - ADC128_VOLTAGE_CHANNEL(2), 134 - ADC128_VOLTAGE_CHANNEL(3), 135 - }; 136 - 137 113 static const char * const bd79104_regulators[] = { "iovdd" }; 138 114 139 115 static const struct adc128_configuration adc122s_config = { 140 - .channels = adc122s021_channels, 141 - .num_channels = ARRAY_SIZE(adc122s021_channels), 116 + .channels = simple_2chan_adc_channels, 117 + .num_channels = ARRAY_SIZE(simple_2chan_adc_channels), 142 118 .refname = "vref", 143 119 }; 144 120 145 121 static const struct adc128_configuration adc124s_config = { 146 - .channels = adc124s021_channels, 147 - .num_channels = ARRAY_SIZE(adc124s021_channels), 122 + .channels = simple_4chan_adc_channels, 123 + .num_channels = ARRAY_SIZE(simple_4chan_adc_channels), 148 124 .refname = "vref", 149 125 }; 150 126 151 127 static const struct adc128_configuration adc128s_config = { 152 - .channels = adc128s052_channels, 153 - .num_channels = ARRAY_SIZE(adc128s052_channels), 128 + .channels = simple_8chan_adc_channels, 129 + .num_channels = ARRAY_SIZE(simple_8chan_adc_channels), 154 130 .refname = "vref", 155 131 }; 156 132 157 133 static const struct adc128_configuration bd79104_config = { 158 - .channels = adc128s052_channels, 159 - .num_channels = ARRAY_SIZE(adc128s052_channels), 134 + .channels = simple_8chan_adc_channels, 135 + .num_channels = ARRAY_SIZE(simple_8chan_adc_channels), 160 136 .refname = "vdd", 161 137 .other_regulators = &bd79104_regulators, 162 138 .num_other_regulators = 1,