i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Wed, 1 Jul 2020 22:39:11 +0000 (10:39 +1200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jul 2020 07:35:56 +0000 (09:35 +0200)
commitac518a2693859c74e5e78ee800d795d16c16743a
treed56316eb3341f96500bd56ae2d7ca442a6b520da
parent0733b1a2be5daea27c48da09dc02f6d015b92312
i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665

[ Upstream commit cd217f2300793a106b49c7dfcbfb26e348bc7593 ]

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.

Based on looking through the PCA9564 and PCA9665 datasheets this should
be safe for both chips. The PCA9564 should not return 0x78 for any valid
state and the PCA9665 should not return 0x90.

Fixes: eff9ec95efaa ("i2c-algo-pca: Add PCA9665 support")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/algos/i2c-algo-pca.c