linux_dsm_epyc7002/drivers/iio/adc
Eugen Hristev 97c54cf2a4 iio: adc: at91-sama5d2_adc: handle unfinished conversions
It can happen that on IRQ trigger, not all conversions are done if
we are enabling multiple channels.
The IRQ is triggered on first EOC (end of channel), but it can happen
that not all channels are done. This leads into erroneous reports to
userspace (zero values or previous values).
To solve this, in trigger handler, check if the mask of done channels
is the same as the mask of active scan channels.
If it's the same, proceed and push to buffers. Otherwise, use usleep
to sleep until the conversion is done or we timeout.
Normally, it should happen that in a short time fashion, all channels are
ready, since the first IRQ triggered.
If a hardware fault happens (for example the clock suddently dissappears),
the handler will not be completed, in which case we do not report anything to
userspace anymore.
Also, change from using the EOC interrupts to DRDY interrupt.
This helps with the fact that not 'n' interrupt statuses are enabled,
each being able to trigger an interrupt, and instead only data ready
interrupt can wake up the CPU. Like this, when data is ready, check in
handler which and how many channels are done. While the DRDY is raised,
other IRQs cannot occur. Once the channel data is being read, we ack the
IRQ and finish the conversion.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25 15:51:21 +01:00
..
ab8500-gpadc.c
ad799x.c iio: adc: ad799x: add pm_ops to disable the device completely 2019-12-15 11:42:14 +00:00
ad7091r5.c
ad7091r-base.c
ad7091r-base.h
ad7124.c iio: adc: ad7124: Add direct reg access 2020-03-08 17:28:31 +00:00
ad7192.c staging: iio: adc: ad7192: Re-indent enum labels 2020-03-23 11:43:42 +01:00
ad7266.c iio: ad7266: Convert to use GPIO descriptors 2019-12-15 11:42:16 +00:00
ad7291.c
ad7292.c iio: adc: ad9292: Use new structure for SPI transfer delays 2020-03-08 17:28:44 +00:00
ad7298.c
ad7476.c iio: adc: ad7476: implement devm_add_action_or_reset 2020-03-21 10:28:08 +00:00
ad7606_par.c
ad7606_spi.c
ad7606.c
ad7606.h
ad7766.c
ad7768-1.c
ad7780.c iio: adc: ad7780: define/use own IIO channel macros 2020-04-19 16:56:10 +01:00
ad7791.c iio: Fix misspellings of "Analog Devices" 2020-04-19 16:56:41 +01:00
ad7793.c iio: adc: ad7793: use read_avail iio hook for scale available 2020-04-19 16:56:15 +01:00
ad7887.c
ad7923.c iio: adc: ad7923: Add support for the ad7908/ad7918/ad7928 2019-12-29 15:20:03 +00:00
ad7949.c
ad9467.c iio: adc: ad9467: add support AD9467 ADC 2020-04-19 16:56:23 +01:00
ad_sigma_delta.c iio: adc: ad-sigma-delta: Allow custom IRQ flags 2020-01-18 11:43:16 +00:00
adi-axi-adc.c iio: adc: adi-axi-adc: add support for AXI ADC IP core 2020-04-19 16:56:22 +01:00
aspeed_adc.c
at91_adc.c iio: adc: at91-adc: Use devm_platform_ioremap_resource 2020-04-19 16:56:41 +01:00
at91-sama5d2_adc.c iio: adc: at91-sama5d2_adc: handle unfinished conversions 2020-04-25 15:51:21 +01:00
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 iio: adc: exynos: Silence warning about regulators during deferred probe 2020-03-08 17:28:44 +00:00
fsl-imx25-gcq.c iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource 2020-04-19 16:56:41 +01:00
hi8435.c
hx711.c
imx7d_adc.c
ina2xx-adc.c
ingenic-adc.c
intel_mrfld_adc.c iio: adc: intel_mrfld_adc: Use be16_to_cpu() instead of get_unaligned_be16() 2020-03-21 10:27:23 +00:00
Kconfig First set of new IIO device support, features and cleanup for the 5.8 cycle 2020-04-23 11:06:48 +02:00
lp8788_adc.c
lpc18xx_adc.c
lpc32xx_adc.c
ltc2471.c
ltc2485.c
ltc2496.c iio: adc: new driver to support Linear technology's ltc2496 2019-12-15 12:15:19 +00:00
ltc2497-core.c iio: adc: ltc2497: split protocol independent part in a separate module 2019-12-15 12:15:19 +00:00
ltc2497.c iio: adc: ltc2497: split protocol independent part in a separate module 2019-12-15 12:15:19 +00:00
ltc2497.h iio: adc: ltc2497: split protocol independent part in a separate module 2019-12-15 12:15:19 +00:00
Makefile First set of new IIO device support, features and cleanup for the 5.8 cycle 2020-04-23 11:06:48 +02:00
max1027.c
max1118.c iio: adc: max1118: Use new structure for SPI transfer delays 2020-03-08 17:28:44 +00:00
max1241.c iio: adc: Add MAX1241 driver 2020-04-19 16:56:31 +01:00
max1363.c iio: adc: max1363: replace uses of mlock 2020-04-19 16:56:13 +01:00
max9611.c First set of new device support, features and cleanups for IIO in the 5.6 cycle 2020-01-10 10:44:00 +01:00
max11100.c
mcp320x.c iio: adc: mcp320x: Use new structure for SPI transfer delays 2020-03-08 17:28:45 +00:00
mcp3422.c
mcp3911.c
men_z188_adc.c
meson_saradc.c
mt6577_auxadc.c
mxs-lradc-adc.c
nau7802.c
npcm_adc.c iio: adc: modify NPCM reset support 2020-02-14 15:06:24 +00:00
palmas_gpadc.c
qcom-pm8xxx-xoadc.c
qcom-spmi-adc5.c
qcom-spmi-iadc.c
qcom-spmi-vadc.c
qcom-vadc-common.c iio: adc: qcom-vadc-common: use <linux/units.h> helpers 2020-01-31 10:30:40 -08:00
qcom-vadc-common.h iio: adc: qcom-vadc-common: use <linux/units.h> helpers 2020-01-31 10:30:40 -08:00
rcar-gyroadc.c
rn5t618-adc.c iio: adc: rn5t618: Add ADC driver for RN5T618/RC5T619 2020-03-27 09:42:37 +00:00
rockchip_saradc.c
sc27xx_adc.c
sd_adc_modulator.c
spear_adc.c
stm32-adc-core.c iio: adc: stm32-adc: don't print an error on probe deferral 2020-01-18 14:22:00 +00:00
stm32-adc-core.h iio: adc: stm32-adc: Add check on overrun interrupt 2019-12-15 11:42:17 +00:00
stm32-adc.c iio: adc: stm32-adc: Use dma_request_chan() instead dma_request_slave_channel() 2020-01-12 11:34:09 +00:00
stm32-dfsdm-adc.c iio: adc: stm32-dfsdm: fix sleep in atomic context 2020-02-02 14:07:49 +00:00
stm32-dfsdm-core.c
stm32-dfsdm.h
stmpe-adc.c
stx104.c
sun4i-gpadc-iio.c iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource 2020-04-19 16:56:40 +01:00
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 iio: adc: ti-ads1015: Make use of device property API 2019-12-15 11:42:18 +00:00
ti-ads7950.c iio: adc: ti-ads7950: Fix a typo in an error message 2019-12-15 11:42:17 +00:00
ti-ads8344.c
ti-ads8688.c
ti-tlc4541.c iio: adc: ti-tlc4541: Use new structure for SPI transfer delays 2020-03-08 17:28:45 +00:00
twl4030-madc.c
twl6030-gpadc.c
vf610_adc.c
viperboard_adc.c
xilinx-xadc-core.c iio: xilinx-xadc: Fix typo 2020-04-19 16:56:33 +01:00
xilinx-xadc-events.c iio: xilinx-xadc: Fix typo in author's name 2020-03-21 10:25:35 +00:00
xilinx-xadc.h iio: xilinx-xadc: Fix typo in author's name 2020-03-21 10:25:35 +00:00