linux_dsm_epyc7002/drivers/iio/adc
Alexandru Tachici d7857e4ee1 iio: adc: ad7124: Fix DT channel configuration
This patch fixes device tree channel configuration.

ad7124 driver reads channels configuration from the device tree.
It expects to find channel specifications as child nodes.
Before this patch ad7124 driver assumed that the child nodes are parsed
by for_each_available_child_of_node in the order 0,1,2,3...

This is wrong and the real order of the children can be seen by running:
dtc -I fs /sys/firmware/devicetree/base on the machine.

For example, running this on an rpi 3B+ yields the real
children order: 4,2,0,7,5,3,1,6

Before this patch the driver assigned the channel configuration
like this:
        - 0 <- 4
        - 1 <- 2
        - 2 <- 0
        ........
For example, the symptoms can be observed by connecting the 4th channel
to a 1V tension and then reading the in_voltage0-voltage19_raw sysfs
(multiplied of course by the scale) one would see that channel 0
measures 1V and channel 4 measures only noise.

Now the driver uses the reg property of each child in order to
correctly identify to which channel the parsed configuration
belongs to.

Fixes b3af341bbd: ("iio: adc: Add ad7124 support")
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-13 12:08:14 +01:00
..
ab8500-gpadc.c
ad799x.c
ad7124.c iio: adc: ad7124: Fix DT channel configuration 2020-01-13 12:08:14 +01:00
ad7266.c
ad7291.c
ad7292.c
ad7298.c
ad7476.c
ad7606_par.c
ad7606_spi.c
ad7606.c iio: adc: ad7606: fix reading unnecessary data from device 2019-12-08 18:07:40 +00:00
ad7606.h
ad7766.c
ad7768-1.c
ad7780.c
ad7791.c
ad7793.c
ad7887.c
ad7923.c
ad7949.c iio: ad7949: fix channels mixups 2019-12-08 18:10:30 +00:00
ad_sigma_delta.c
aspeed_adc.c
at91_adc.c
at91-sama5d2_adc.c
axp20x_adc.c
axp288_adc.c
bcm_iproc_adc.c
berlin2-adc.c
cc10001_adc.c
cpcap-adc.c
da9150-gpadc.c
dln2-adc.c
envelope-detector.c
ep93xx_adc.c
exynos_adc.c
fsl-imx25-gcq.c
hi8435.c
hx711.c
imx7d_adc.c
ina2xx-adc.c
ingenic-adc.c
intel_mrfld_adc.c iio: adc: intel_mrfld_adc: Allocating too much data in probe() 2019-12-08 18:10:29 +00:00
Kconfig
lp8788_adc.c
lpc18xx_adc.c
lpc32xx_adc.c
ltc2471.c
ltc2485.c
ltc2497.c
Makefile
max1027.c iio: adc: max1027: fix not unregistered iio trigger 2019-12-08 18:10:29 +00:00
max1118.c
max1363.c
max9611.c iio: adc: max9611: Fix too short conversion time delay 2019-12-08 18:10:30 +00:00
max11100.c
mcp320x.c
mcp3422.c
mcp3911.c
men_z188_adc.c
meson_saradc.c
mt6577_auxadc.c
mxs-lradc-adc.c
nau7802.c
npcm_adc.c
palmas_gpadc.c
qcom-pm8xxx-xoadc.c
qcom-spmi-adc5.c
qcom-spmi-iadc.c
qcom-spmi-vadc.c
qcom-vadc-common.c
qcom-vadc-common.h
rcar-gyroadc.c
rockchip_saradc.c
sc27xx_adc.c
sd_adc_modulator.c
spear_adc.c
stm32-adc-core.c
stm32-adc-core.h
stm32-adc.c
stm32-dfsdm-adc.c
stm32-dfsdm-core.c
stm32-dfsdm.h
stmpe-adc.c
stx104.c
sun4i-gpadc-iio.c
ti_am335x_adc.c
ti-adc081c.c
ti-adc084s021.c
ti-adc108s102.c
ti-adc128s052.c
ti-adc161s626.c
ti-adc0832.c
ti-adc12138.c
ti-ads124s08.c
ti-ads1015.c
ti-ads7950.c
ti-ads8344.c
ti-ads8688.c
ti-tlc4541.c
twl4030-madc.c
twl6030-gpadc.c
vf610_adc.c
viperboard_adc.c
xilinx-xadc-core.c
xilinx-xadc-events.c
xilinx-xadc.h