aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2015-12-28 04:56:13 +0000
committerLuka Perkov <luka@openwrt.org>2015-12-28 04:56:13 +0000
commit1ebfdc24ef1b045b27a5fb1a893a53310a77739f (patch)
tree2ab3e54654c1a0be7b9692aea98ea1a5a0048884 /target/linux/imx6
parent0ffed64dbd59b66e9a5f86f65065b0d58822ff73 (diff)
downloadmaster-187ad058-1ebfdc24ef1b045b27a5fb1a893a53310a77739f.tar.gz
master-187ad058-1ebfdc24ef1b045b27a5fb1a893a53310a77739f.tar.bz2
master-187ad058-1ebfdc24ef1b045b27a5fb1a893a53310a77739f.zip
imx6: add i2c retries for Ventana /dev/i2c-0
On Ventana boards the Gateworks System Controller is the only device on I2C1 (/dev/i2c-0) and it can NAK transfers if it is busy in an ADC loop. Because this is a multi-function device with several slave addresses it is best to add retries at the controller level instead of within each slave driver. This adds a patch that adds 3 retries for i2c transactions only for Ventana boards and only for I2C1 Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48012 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/imx6')
-rw-r--r--target/linux/imx6/patches-4.3/207-i2c-imx-add-retries-for-NAK-s-on-ventana-boards.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/imx6/patches-4.3/207-i2c-imx-add-retries-for-NAK-s-on-ventana-boards.patch b/target/linux/imx6/patches-4.3/207-i2c-imx-add-retries-for-NAK-s-on-ventana-boards.patch
new file mode 100644
index 0000000000..bfb5707ff0
--- /dev/null
+++ b/target/linux/imx6/patches-4.3/207-i2c-imx-add-retries-for-NAK-s-on-ventana-boards.patch
@@ -0,0 +1,24 @@
+Index: linux-4.3/drivers/i2c/busses/i2c-imx.c
+===================================================================
+--- linux-4.3.orig/drivers/i2c/busses/i2c-imx.c 2015-11-01 16:05:25.000000000 -0800
++++ linux-4.3/drivers/i2c/busses/i2c-imx.c 2015-12-18 10:39:44.971158318 -0800
+@@ -461,6 +461,8 @@
+ {
+ if (imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR) & I2SR_RXAK) {
+ dev_dbg(&i2c_imx->adapter.dev, "<%s> No ACK\n", __func__);
++ if (i2c_imx->adapter.retries)
++ return -EAGAIN;
+ return -EIO; /* No ACK */
+ }
+
+@@ -1010,6 +1012,10 @@
+ i2c_imx->adapter.nr = pdev->id;
+ i2c_imx->adapter.dev.of_node = pdev->dev.of_node;
+ i2c_imx->base = base;
++ if (of_machine_is_compatible("gw,ventana") && phy_addr == 0x021a0000) {
++ dev_info(&pdev->dev, "Adding retries for Ventana GSC\n");
++ i2c_imx->adapter.retries = 3;
++ }
+
+ /* Get I2C clock */
+ i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);