staging:iio:adc:ad7280a: Use more conservative delays to allow 105C operation.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 6 Feb 2022 19:03:27 +0000 (19:03 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 21 Feb 2022 19:33:05 +0000 (19:33 +0000)
The datasheet provides timings for operating this device at up to 105
degrees centigrade. Adopt these more conservative timings.

Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-20-jic23@kernel.org
drivers/staging/iio/adc/ad7280a.c

index a7e1614..ef9d277 100644 (file)
 #define AD7280A_DEVADDR_ALL            0x1F
 
 static const unsigned short ad7280a_n_avg[4] = {1, 2, 4, 8};
-static const unsigned short ad7280a_t_acq_ns[4] = {465, 1010, 1460, 1890};
+static const unsigned short ad7280a_t_acq_ns[4] = {470, 1030, 1510, 1945};
 
 /* 5-bit device address is sent LSB first */
 static unsigned int ad7280a_devaddr(unsigned int addr)
@@ -869,7 +869,7 @@ static void ad7280_update_delay(struct ad7280_state *st)
         */
 
        st->readback_delay_us =
-               ((ad7280a_t_acq_ns[st->acquisition_time & 0x3] + 695) *
+               ((ad7280a_t_acq_ns[st->acquisition_time & 0x3] + 720) *
                        (AD7280A_NUM_CH * ad7280a_n_avg[st->oversampling_ratio & 0x3])) -
                ad7280a_t_acq_ns[st->acquisition_time & 0x3] + st->slave_num * 250;