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

iio: adc: rockchip_saradc: add support for rk3568 saradc

It is similar to other devices, but with 8 channels.

Signed-off-by: Simon Xue <xxm@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20210712014507.97477-1-xxm@rock-chips.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Simon Xue and committed by
Jonathan Cameron
7786da3b edf021d1

+21 -1
+21 -1
drivers/iio/adc/rockchip_saradc.c
··· 35 35 #define SARADC_DLY_PU_SOC_MASK 0x3f 36 36 37 37 #define SARADC_TIMEOUT msecs_to_jiffies(100) 38 - #define SARADC_MAX_CHANNELS 6 38 + #define SARADC_MAX_CHANNELS 8 39 39 40 40 struct rockchip_saradc_data { 41 41 const struct iio_chan_spec *channels; ··· 192 192 .clk_rate = 1000000, 193 193 }; 194 194 195 + static const struct iio_chan_spec rockchip_rk3568_saradc_iio_channels[] = { 196 + SARADC_CHANNEL(0, "adc0", 10), 197 + SARADC_CHANNEL(1, "adc1", 10), 198 + SARADC_CHANNEL(2, "adc2", 10), 199 + SARADC_CHANNEL(3, "adc3", 10), 200 + SARADC_CHANNEL(4, "adc4", 10), 201 + SARADC_CHANNEL(5, "adc5", 10), 202 + SARADC_CHANNEL(6, "adc6", 10), 203 + SARADC_CHANNEL(7, "adc7", 10), 204 + }; 205 + 206 + static const struct rockchip_saradc_data rk3568_saradc_data = { 207 + .channels = rockchip_rk3568_saradc_iio_channels, 208 + .num_channels = ARRAY_SIZE(rockchip_rk3568_saradc_iio_channels), 209 + .clk_rate = 1000000, 210 + }; 211 + 195 212 static const struct of_device_id rockchip_saradc_match[] = { 196 213 { 197 214 .compatible = "rockchip,saradc", ··· 219 202 }, { 220 203 .compatible = "rockchip,rk3399-saradc", 221 204 .data = &rk3399_saradc_data, 205 + }, { 206 + .compatible = "rockchip,rk3568-saradc", 207 + .data = &rk3568_saradc_data, 222 208 }, 223 209 {}, 224 210 };