Skip to content
Snippets Groups Projects
Commit 051df08f authored by Tim Harvey's avatar Tim Harvey Committed by Tom Rini
Browse files

board: gw_ventana: gsc: fix GSC read/write functions


commit 7c84319a ("dm: gpio: Correct use of -ENODEV in drivers")
changed the return code for an I2C NAK from -ENODEV to -EREMOTEIO.

Update the gsc_i2c_read and gsc_i2c_write functions for this change
to properly retry the transaction on a NAK meaning the GSC is busy.

Fixes: 7c84319a ("dm: gpio: Correct use of -ENODEV in drivers")
Signed-off-by: default avatarTim Harvey <tharvey@gateworks.com>
Reviewed-by: default avatarFabio Estevam <festevam@denx.de>
parent 0c60b657
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ int gsc_i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len) ...@@ -41,7 +41,7 @@ int gsc_i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
break; break;
debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr, debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr,
n, ret); n, ret);
if (ret != -ENODEV) if (ret != -EREMOTEIO)
break; break;
mdelay(10); mdelay(10);
} }
...@@ -60,7 +60,7 @@ int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) ...@@ -60,7 +60,7 @@ int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
break; break;
debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr, debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr,
n, ret); n, ret);
if (ret != -ENODEV) if (ret != -EREMOTEIO)
break; break;
mdelay(10); mdelay(10);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment