FAILED: patch "[PATCH] iio: humidity: hdc100x: Add margin to the conversion time" failed to apply to 4.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 84edec86f449adea9ee0b4912a79ab8d9d65abb7 Mon Sep 17 00:00:00 2001
From: Chris Lesiak <[email protected]>
Date: Mon, 14 Jun 2021 09:18:20 -0500
Subject: [PATCH] iio: humidity: hdc100x: Add margin to the conversion time
The datasheets have the following note for the conversion time
specification: "This parameter is specified by design and/or characterization and it is not tested in production."
Parts have been seen that require more time to do 14-bit conversions for the relative humidity channel. The result is ENXIO due to the address phase of a transfer not getting an ACK.
Delay an additional 1 ms per conversion to allow for additional margin.
drivers/iio/humidity/hdc100x.c +4 -2
@@ -25,6 +25,8 @@#include <linux/iio/trigger_consumer.h> #include <linux/iio/triggered_buffer.h> +#include <linux/time.h> +#define HDC100X_REG_TEMP 0x00#define HDC100X_REG_HUMIDITY 0x01
@@ -166,7 +168,7 @@ static int hdc100x_get_measurement(struct hdc100x_data *data, struct iio_chan_spec const *chan) {struct i2c_client *client = data->client; -int delay = data->adc_int_us[chan->address]; +int delay = data->adc_int_us[chan->address] +1 *USEC_PER_MSEC ;int ret;__be16 val;
@@ -316,7 +318,7 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p)struct iio_dev *indio_dev = pf->indio_dev;struct hdc100x_data *data =iio_priv (indio_dev);struct i2c_client *client = data->client; -int delay = data->adc_int_us[0 ] + data->adc_int_us[1 ]; +int delay = data->adc_int_us[0 ] + data->adc_int_us[1 ] +2 *USEC_PER_MSEC ;int ret;/* dual read starts at temp register */