linux-uconsole/drivers/iio/adc
Geert Uytterhoeven 346812c25f iio: adc: max9611: Fix too short conversion time delay
[ Upstream commit 9fd229c478 ]

As of commit b9ddd50911 ("iio: adc: max9611: Fix temperature
reading in probe"), max9611 initialization sometimes fails on the
Salvator-X(S) development board with:

    max9611 4-007f: Invalid value received from ADC 0x8000: aborting
    max9611: probe of 4-007f failed with error -5

The max9611 driver tests communications with the chip by reading the die
temperature during the probe function, which returns an invalid value.

According to the datasheet, the typical ADC conversion time is 2 ms, but
no minimum or maximum values are provided.  Maxim Technical Support
confirmed this was tested with temperature Ta=25 degreeC, and promised
to inform me if a maximum/minimum value is available (they didn't get
back to me, so I assume it is not).

However, the driver assumes a 1 ms conversion time.  Usually the
usleep_range() call returns after more than 1.8 ms, hence it succeeds.
When it returns earlier, the data register may be read too early, and
the previous measurement value will be returned.  After boot, this is
the temperature POR (power-on reset) value, causing the failure above.

Fix this by increasing the delay from 1000-2000 µs to 3000-3300 µs.

Note that this issue has always been present, but it was exposed by the
aformentioned commit.

Fixes: 69780a3bbc ("iio: adc: Add Maxim max9611 ADC driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-09 10:18:55 +01:00
..
ad799x.c iio: adc: ad799x: fix probe error handling 2019-10-17 13:45:12 -07:00
ad7266.c
ad7291.c
ad7298.c
ad7476.c iio: adc: change license description 2018-01-30 18:33:28 +00:00
ad7766.c
ad7791.c iio: adc: ad7791: implement IIO_CHAN_INFO_SAMP_FREQ 2018-03-17 20:47:21 +00:00
ad7793.c iio: ad7793: implement IIO_CHAN_INFO_SAMP_FREQ 2018-03-17 20:33:01 +00:00
ad7887.c
ad7923.c
ad_sigma_delta.c iio: ad_sigma_delta: Properly handle SPI bus locking vs CS assertion 2019-05-31 06:46:24 -07:00
aspeed_adc.c iio: adc: aspeed: Fix error handling path 2018-01-14 11:01:13 +00:00
at91-sama5d2_adc.c iio: adc: at91-sama5d2_adc: fix up casting in at91_adc_read_info_raw() 2018-07-23 19:18:12 +01:00
at91_adc.c iio: adc: at91: disable adc channel interrupt in timeout case 2019-04-27 09:36:35 +02:00
axp20x_adc.c iio: adc: axp20x_adc: remove !! in favor of ternary condition 2018-02-24 12:19:45 +00:00
axp288_adc.c iio: adc: axp288: Override TS pin bias current for some models 2019-10-17 13:45:13 -07:00
bcm_iproc_adc.c
berlin2-adc.c
cc10001_adc.c
cpcap-adc.c iio: adc: cpcap: fix incorrect validation 2017-12-02 11:15:13 +00:00
da9150-gpadc.c
dln2-adc.c iio: dln2-adc: fix iio_triggered_buffer_postenable() position 2019-12-31 16:35:33 +01:00
envelope-detector.c
ep93xx_adc.c iio: ep93xx: remove redundant return value check of platform_get_resource() 2018-01-30 18:33:20 +00:00
exynos_adc.c iio: adc: exynos-adc: Use proper number of channels for Exynos4x12 2019-09-16 08:22:06 +02:00
fsl-imx25-gcq.c iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs() 2018-11-13 11:08:47 -08:00
hi8435.c
hx711.c iio: adc: hx711: fix bug in sampling of data 2019-10-17 13:45:12 -07:00
imx7d_adc.c iio: adc: fix spelling mistake: "Freeacale" -> "Freescale" 2018-05-22 18:17:57 +01:00
ina2xx-adc.c iio: adc: ina2xx: avoid kthread_stop() with stale task_struct 2018-07-07 17:06:39 +01:00
Kconfig iio: adc: stm32-dfsdm: fix unmet direct dependencies detected 2019-05-31 06:46:18 -07:00
lp8788_adc.c
lpc18xx_adc.c
lpc32xx_adc.c
ltc2471.c
ltc2485.c
ltc2497.c
Makefile iio: adc: Add Spreadtrum SC27XX PMICs ADC support 2018-06-30 18:59:40 +01:00
max1027.c iio: adc: max1027: Reset the device at probe time 2019-12-31 16:35:17 +01:00
max1118.c
max1363.c iio: adc: max1363: merge calls to of_match_device and of_device_get_match_data 2018-07-08 10:35:17 +01:00
max9611.c iio: adc: max9611: Fix too short conversion time delay 2020-01-09 10:18:55 +01:00
max11100.c
mcp320x.c
mcp3422.c
men_z188_adc.c
meson_saradc.c iio: adc: meson_saradc: Fix memory allocation order 2019-11-06 13:05:39 +01:00
mt6577_auxadc.c
mxs-lradc-adc.c
nau7802.c
palmas_gpadc.c
qcom-pm8xxx-xoadc.c iio: adc: fix warning in Qualcomm PM8xxx HK/XOADC driver 2019-04-05 22:32:57 +02:00
qcom-spmi-iadc.c
qcom-spmi-vadc.c
qcom-vadc-common.c
qcom-vadc-common.h
rcar-gyroadc.c iio: adc: gyroadc: fix uninitialized return code 2019-09-16 08:22:22 +02:00
rockchip_saradc.c
sc27xx_adc.c iio: adc: Add Spreadtrum SC27XX PMICs ADC support 2018-06-30 18:59:40 +01:00
sd_adc_modulator.c IIO: ADC: add sigma delta modulator support 2018-01-10 10:30:09 +00:00
spear_adc.c
stm32-adc-core.c iio: adc: stm32-adc: fix a race when using several adcs with dma and irq 2019-10-17 13:45:23 -07:00
stm32-adc-core.h iio: adc: stm32-adc: fix a race when using several adcs with dma and irq 2019-10-17 13:45:23 -07:00
stm32-adc.c iio: adc: stm32-adc: fix stopping dma 2019-11-12 19:20:40 +01:00
stm32-dfsdm-adc.c iio: adc: stm32-dfsdm: fix data type 2019-09-19 09:09:40 +02:00
stm32-dfsdm-core.c iio: adc: stm32-dfsdm: missing error case during probe 2019-07-31 07:26:56 +02:00
stm32-dfsdm.h IIO: ADC: add stm32 DFSDM core support 2018-01-10 10:30:11 +00:00
stx104.c iio: stx104: Implement get_multiple callback 2018-03-17 16:21:27 +00:00
sun4i-gpadc-iio.c
ti-adc081c.c
ti-adc084s021.c
ti-adc108s102.c
ti-adc128s052.c
ti-adc161s626.c iio: add SPDX identifier for various drivers 2018-02-18 11:55:19 +00:00
ti-adc0832.c
ti-adc12138.c
ti-ads1015.c
ti-ads7950.c iio: adc: ti-ads7950: Fix improper use of mlock 2019-05-31 06:46:25 -07:00
ti-ads8688.c iio: adc: ti-ads8688: fix timestamp is not updated in buffer 2019-06-09 09:17:15 +02:00
ti-tlc4541.c
ti_am335x_adc.c Drivers:iio:adc:ti_am335x_adc remove comparison to bool 2018-01-08 16:03:43 +01:00
twl4030-madc.c
twl6030-gpadc.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
vf610_adc.c
viperboard_adc.c
xilinx-xadc-core.c iio: adc: xilinx: prevent touching unclocked h/w on remove 2019-05-16 19:41:19 +02:00
xilinx-xadc-events.c
xilinx-xadc.h iio: adc: xilinx: Remove platform_get_irq from xadc_remove function 2018-07-29 12:52:21 +01:00