[PATCH v1 1/1] hwmon: (adc128d818): filter out 0x1ff reading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ASPEED i2c driver doesn't support SMBUS timeout thus we will get dirty
data while SCL hold time over 35ms, filter out default register value
0x1ff to avoid abnormal data reading.

Signed-off-by: Jerry C Chen <Jerry_C_Chen@xxxxxxxxxx>
---
 drivers/hwmon/adc128d818.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/adc128d818.c b/drivers/hwmon/adc128d818.c
index 5e805d4ee76a..8197d3f14ea7 100644
--- a/drivers/hwmon/adc128d818.c
+++ b/drivers/hwmon/adc128d818.c
@@ -88,7 +88,7 @@ static struct adc128_data *adc128_update_device(struct device *dev)
                for (i = 0; i < num_inputs[data->mode]; i++) {
                        rv = i2c_smbus_read_word_swapped(client,
                                                         ADC128_REG_IN(i));
-                       if (rv < 0)
+                       if (rv < 0 || rv == 511)
                                goto abort;
                        data->in[0][i] = rv >> 4;

--
2.25.1

WIWYNN PROPRIETARY
This email (and any attachments) contains proprietary or confidential information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or distribution of this email or the content of this email is strictly prohibited. If you are not the intended recipient, please notify the sender and delete this email immediately.





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux