[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200621225705.21666-1-chris.packham@alliedtelesis.co.nz>
Date: Mon, 22 Jun 2020 10:57:05 +1200
From: Chris Packham <chris.packham@...iedtelesis.co.nz>
To: wsa@...nel.org, andriy.shevchenko@...ux.intel.com
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
Chris Packham <chris.packham@...iedtelesis.co.nz>
Subject: [PATCH] i2c: algo-pca: Add 0x78 as SCL stuck low status
The PCA9665 datasheet says that I2CSTA = 78h indicates that SCL is stuck
low, this differs to the PCA9564 which uses 90h for this indication.
Treat either 0x78 or 0x90 as an indication that the SCL line is stuck.
Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
---
Based on looking through the PCA9564 and PCA9665 datasheets this should be
safe. The PCA9564 should not return 0x78 for any valid state and the PCA9665
should not return 0x90.
drivers/i2c/algos/i2c-algo-pca.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index 7f10312d1b88..e3017329cea8 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -314,6 +314,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
DEB2("BUS ERROR - SDA Stuck low\n");
pca_reset(adap);
goto out;
+ case 0x78: /* Bus error - SCL stuck low */
case 0x90: /* Bus error - SCL stuck low */
DEB2("BUS ERROR - SCL Stuck low\n");
pca_reset(adap);
--
2.27.0
Powered by blists - more mailing lists