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

iio: adc: ad4695: rename AD4695_MAX_VIN_CHANNELS

Rename AD4695_MAX_CHANNELS to AD4695_MAX_VIN_CHANNELS. It has been a
point of confusion that this macro is only the voltage input channels
and not all channels.

Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250507-iio-introduce-iio_declare_buffer_with_ts-v6-4-4aee1b9f1b89@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
76a67e39 51924ff5

+5 -5
+5 -5
drivers/iio/adc/ad4695.c
··· 105 105 #define AD4695_REG_ACCESS_SCLK_HZ (10 * MEGA) 106 106 107 107 /* Max number of voltage input channels. */ 108 - #define AD4695_MAX_CHANNELS 16 108 + #define AD4695_MAX_VIN_CHANNELS 16 109 109 110 110 enum ad4695_in_pair { 111 111 AD4695_IN_PAIR_REFGND, ··· 143 143 /* offload also requires separate gpio to manually control CNV */ 144 144 struct gpio_desc *cnv_gpio; 145 145 /* voltages channels plus temperature and timestamp */ 146 - struct iio_chan_spec iio_chan[AD4695_MAX_CHANNELS + 2]; 147 - struct ad4695_channel_config channels_cfg[AD4695_MAX_CHANNELS]; 146 + struct iio_chan_spec iio_chan[AD4695_MAX_VIN_CHANNELS + 2]; 147 + struct ad4695_channel_config channels_cfg[AD4695_MAX_VIN_CHANNELS]; 148 148 const struct ad4695_chip_info *chip_info; 149 149 int sample_freq_range[3]; 150 150 /* Reference voltage. */ ··· 157 157 * to control CS and add a delay between the last SCLK and next 158 158 * CNV rising edges. 159 159 */ 160 - struct spi_transfer buf_read_xfer[AD4695_MAX_CHANNELS * 2 + 3]; 160 + struct spi_transfer buf_read_xfer[AD4695_MAX_VIN_CHANNELS * 2 + 3]; 161 161 struct spi_message buf_read_msg; 162 162 /* Raw conversion data received. */ 163 - IIO_DECLARE_DMA_BUFFER_WITH_TS(u16, buf, AD4695_MAX_CHANNELS + 1); 163 + IIO_DECLARE_DMA_BUFFER_WITH_TS(u16, buf, AD4695_MAX_VIN_CHANNELS + 1); 164 164 u16 raw_data; 165 165 /* Commands to send for single conversion. */ 166 166 u16 cnv_cmd;