kernel_optimize_test/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 b3af341bbd966: ("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 iio: adc: New driver for the AB8500 GPADC 2019-10-18 19:37:44 +01:00
ad_sigma_delta.c iio: adc: ad_sigma_delta: Export ad_sd_calibrate 2019-09-08 10:35:31 +01:00
ad799x.c iio: adc: ad799x: fix probe error handling 2019-10-09 19:11:29 +01:00
ad7124.c iio: adc: ad7124: Fix DT channel configuration 2020-01-13 12:08:14 +01:00
ad7266.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
ad7291.c
ad7292.c iio: adc: Add driver support for AD7292 2019-11-10 17:09:36 +00:00
ad7298.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
ad7476.c
ad7606_par.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
ad7606_spi.c iio: adc: ad7606: Add support for AD7606B ADC 2019-08-25 16:11:00 +01:00
ad7606.c iio: adc: ad7606: fix reading unnecessary data from device 2019-12-08 18:07:40 +00:00
ad7606.h iio: adc: ad7606: Add support for AD7606B ADC 2019-08-25 16:11:00 +01:00
ad7766.c
ad7768-1.c
ad7780.c
ad7791.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
ad7793.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
ad7887.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
ad7923.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
ad7949.c iio: ad7949: fix channels mixups 2019-12-08 18:10:30 +00:00
aspeed_adc.c iio: adc: aspeed: use devm_platform_ioremap_resource 2019-11-09 12:12:54 +00:00
at91_adc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
at91-sama5d2_adc.c iio: adc: at91-sama5d2: Replace 0 with NULL when clearing some pointers. 2019-10-18 19:48:45 +01:00
axp20x_adc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
axp288_adc.c iio: adc: axp288: Override TS pin bias current for some models 2019-10-09 19:11:27 +01:00
bcm_iproc_adc.c iio: adc: bcm_iproc_adc: drop a stray semicolon 2019-11-09 12:16:31 +00:00
berlin2-adc.c
cc10001_adc.c iio: adc: cc10001: use devm_platform_ioremap_resource 2019-11-09 12:18:22 +00:00
cpcap-adc.c iio: adc: cpcap-adc: Fix missing IRQF_ONESHOT as only threaded handler. 2019-10-18 20:02:50 +01:00
da9150-gpadc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
dln2-adc.c iio: dln2-adc: fix iio_triggered_buffer_postenable() position 2019-11-02 14:36:33 +00:00
envelope-detector.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
ep93xx_adc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
exynos_adc.c iio: adc: exynos: use devm_platform_ioremap_resource 2019-10-18 19:59:59 +01:00
fsl-imx25-gcq.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
hi8435.c iio: hi8435: Drop hi8435_remove() by using devres for remaining elements 2019-08-11 09:59:38 +01:00
hx711.c iio: adc: hx711: optimize performance in read cycle 2019-10-22 12:58:07 +01:00
imx7d_adc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
ina2xx-adc.c
ingenic-adc.c iio: adc: ingenic: Use devm_platform_ioremap_resource 2019-11-09 12:19:54 +00:00
intel_mrfld_adc.c iio: adc: intel_mrfld_adc: Allocating too much data in probe() 2019-12-08 18:10:29 +00:00
Kconfig iio: adc: Add driver support for AD7292 2019-11-10 17:09:36 +00:00
lp8788_adc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lpc18xx_adc.c iio: adc: lpc18xx: use devm_platform_ioremap_resource 2019-11-09 12:21:24 +00:00
lpc32xx_adc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
ltc2471.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 253 2019-06-05 17:30:27 +02:00
ltc2485.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ltc2497.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
Makefile iio: adc: Add driver support for AD7292 2019-11-10 17:09:36 +00:00
max1027.c iio: adc: max1027: fix not unregistered iio trigger 2019-12-08 18:10:29 +00:00
max1118.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330 2019-06-05 17:37:06 +02:00
max1363.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
max9611.c iio: adc: max9611: Fix too short conversion time delay 2019-12-08 18:10:30 +00:00
max11100.c
mcp320x.c iio: adc: mcp320x: Tidy up endian types in type cast. 2019-10-18 19:48:50 +01:00
mcp3422.c
mcp3911.c
men_z188_adc.c drivers: mcb: use symbol namespaces 2019-11-03 19:54:53 +01:00
meson_saradc.c iio: adc: meson_saradc: use devm_platform_ioremap_resource 2019-10-18 20:01:34 +01:00
mt6577_auxadc.c iio: adc: mt6577_auxdac: use devm_platform_ioremap_resource 2019-11-09 12:14:34 +00:00
mxs-lradc-adc.c
nau7802.c
npcm_adc.c iio: adc: npcm: use devm_platform_ioremap_resource 2019-11-09 12:22:58 +00:00
palmas_gpadc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
qcom-pm8xxx-xoadc.c
qcom-spmi-adc5.c
qcom-spmi-iadc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
qcom-spmi-vadc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
qcom-vadc-common.c
qcom-vadc-common.h
rcar-gyroadc.c iio: adc: rcar-gyroadc: use devm_platform_ioremap_resource 2019-11-09 12:24:55 +00:00
rockchip_saradc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
sc27xx_adc.c iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code 2019-10-13 08:53:34 +01:00
sd_adc_modulator.c
spear_adc.c iio: adc: spear_adc: Use devm_platform_ioremap_resource 2019-11-09 12:26:56 +00:00
stm32-adc-core.c iio: adc: stm32: allow to tune analog clock 2019-11-09 12:37:18 +00:00
stm32-adc-core.h iio: adc: stm32-adc: fix a race when using several adcs with dma and irq 2019-10-09 19:11:26 +01:00
stm32-adc.c Merge 5.4-rc7 into staging-next 2019-11-11 06:23:37 +01:00
stm32-dfsdm-adc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
stm32-dfsdm-core.c
stm32-dfsdm.h iio: adc: stm32-dfsdm: add fast mode support 2019-06-22 10:29:19 +01:00
stmpe-adc.c iio: adc: stmpe-adc: Cleanup endian type of local variable 2019-10-18 19:49:03 +01:00
stx104.c
sun4i-gpadc-iio.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
ti_am335x_adc.c
ti-adc081c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ti-adc084s021.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ti-adc108s102.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
ti-adc128s052.c
ti-adc161s626.c
ti-adc0832.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330 2019-06-05 17:37:06 +02:00
ti-adc12138.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330 2019-06-05 17:37:06 +02:00
ti-ads124s08.c
ti-ads1015.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330 2019-06-05 17:37:06 +02:00
ti-ads7950.c
ti-ads8344.c
ti-ads8688.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ti-tlc4541.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
twl4030-madc.c iio: adc: twl4030: Use false / true instead of 0 / 1 with booleans 2019-10-22 11:34:20 +01:00
twl6030-gpadc.c iio: Remove dev_err() usage after platform_get_irq() 2019-08-05 15:59:14 +01:00
vf610_adc.c iio: adc: vf610: use devm_platform_ioremap_resource 2019-11-09 12:28:21 +00:00
viperboard_adc.c
xilinx-xadc-core.c iio: adc: xilinx-xadc: use devm_platform_ioremap_resource 2019-10-18 20:05:58 +01:00
xilinx-xadc-events.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
xilinx-xadc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00