summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-at91-core.c
diff options
context:
space:
mode:
authorCodrin Ciubotariu <codrin.ciubotariu@microchip.com>2020-02-25 17:50:09 +0200
committerWolfram Sang <wsa@kernel.org>2020-05-05 16:37:21 +0200
commit73371d5f313aa056a451f84b652623da6054f89b (patch)
tree1052e339cc6101cf65a6ecc55823a160ad35cb3a /drivers/i2c/busses/i2c-at91-core.c
parente896be5ad1017aa710f8b979036a43d3e5b2f38d (diff)
i2c: at91: Send bus clear command if SDA is down
After a transfer timeout, some faulty I2C slave devices might hold down the SDA pin. We can generate a bus clear command, hoping that the slave might release the pins. If the CLEAR command is not supported, we will use gpio recovery, if available, to reset the bus. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-at91-core.c')
-rw-r--r--drivers/i2c/busses/i2c-at91-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c
index 3da1a8acecb5..e14edd236108 100644
--- a/drivers/i2c/busses/i2c-at91-core.c
+++ b/drivers/i2c/busses/i2c-at91-core.c
@@ -131,6 +131,7 @@ static struct at91_twi_pdata sama5d2_config = {
.has_dig_filtr = true,
.has_adv_dig_filtr = true,
.has_ana_filtr = true,
+ .has_clear_cmd = false, /* due to errata, CLEAR cmd is not working */
};
static struct at91_twi_pdata sam9x60_config = {
@@ -142,6 +143,7 @@ static struct at91_twi_pdata sam9x60_config = {
.has_dig_filtr = true,
.has_adv_dig_filtr = true,
.has_ana_filtr = true,
+ .has_clear_cmd = true,
};
static const struct of_device_id atmel_twi_dt_ids[] = {