linux-stable/drivers/iio/temperature
Nuno Sá 4753723f8b iio: ltc2983: fix device probe
commit b76d26d69e upstream.

There is no reason to assume that the IRQ rising edge (indicating that
the device start up phase is done) will happen after we request the IRQ.
If the device is already up by the time we request it, the call to
'wait_for_completion_timeout()' will timeout and we will fail the device
probe even though there's nothing wrong.

Fix it by just polling the status register until we get the indication that
the device is up and running. As a side effect of this fix, requesting the
IRQ is also moved to after the setup function.

Fixes: f110f3188e ("iio: temperature: Add support for LTC2983")
Reported-and-tested-by: Drew Fustini <drew@pdp7.com>
Reviewed-by: Drew Fustini <drew@pdp7.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210811133220.190264-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-18 13:40:08 +02:00
..
hid-sensor-temperature.c iio: hid-sensor-temperature: Fix issues of timestamp channel 2021-03-25 09:04:16 +01:00
iqs620at-temp.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
Kconfig iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER 2021-05-19 10:13:13 +02:00
ltc2983.c iio: ltc2983: fix device probe 2021-09-18 13:40:08 +02:00
Makefile iio: temperature: Add support for Azoteq IQS620AT temperature sensor 2020-03-27 08:25:50 +00:00
max31856.c iio: Remove superfluous of_node assignments 2020-06-14 14:20:08 +01:00
maxim_thermocouple.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
mlx90614.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
mlx90632.c drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c 2021-01-27 11:55:12 +01:00
tmp006.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
tmp007.c iio:temperature:tmp007: Drop of_match_ptr protection 2020-09-21 18:41:30 +01:00
tsys01.c iio:temperature:tsys01: Drop of_match_ptr protection 2020-09-21 18:41:30 +01:00
tsys02d.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00