diff options
author | Luka Perkov <luka@openwrt.org> | 2013-10-29 02:19:09 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2013-10-29 02:19:09 +0000 |
commit | e291d89f5c9c3d0de27c73d5f775964fc701aca6 (patch) | |
tree | 48c43554bbefd5a7697ab36dfb843b309209eea6 /target/linux/imx6/patches-3.12/0040-i2c-imx-retry-on-NAK.patch | |
parent | a9f1f034386bbd54d70524718e5017b35cc55f8b (diff) | |
download | master-187ad058-e291d89f5c9c3d0de27c73d5f775964fc701aca6.tar.gz master-187ad058-e291d89f5c9c3d0de27c73d5f775964fc701aca6.tar.bz2 master-187ad058-e291d89f5c9c3d0de27c73d5f775964fc701aca6.zip |
imx6: add initial 3.12 support
Signed-off-by: Luka Perkov <luka@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38574 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/imx6/patches-3.12/0040-i2c-imx-retry-on-NAK.patch')
-rw-r--r-- | target/linux/imx6/patches-3.12/0040-i2c-imx-retry-on-NAK.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/imx6/patches-3.12/0040-i2c-imx-retry-on-NAK.patch b/target/linux/imx6/patches-3.12/0040-i2c-imx-retry-on-NAK.patch new file mode 100644 index 0000000000..e876c6ed49 --- /dev/null +++ b/target/linux/imx6/patches-3.12/0040-i2c-imx-retry-on-NAK.patch @@ -0,0 +1,38 @@ +From: Tim Harvey <tharvey@gateworks.com> +Subject: [PATCH] i2c: imx: retry on NAK + +In case of busy i2c try again to get ACK. + +Signed-off-by: Tim Harvey <tharvey@gateworks.com> +Tested-by: Luka Perkov <luka@openwrt.org> +--- + drivers/i2c/busses/i2c-imx.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-imx.c ++++ b/drivers/i2c/busses/i2c-imx.c +@@ -62,6 +62,7 @@ + + /* Default value */ + #define IMX_I2C_BIT_RATE 100000 /* 100kHz */ ++#define IMX_I2C_MAX_RETRIES 3 /* number of retries to attempt */ + + /* IMX I2C registers */ + #define IMX_I2C_IADR 0x00 /* i2c slave address */ +@@ -198,7 +199,7 @@ static int i2c_imx_acked(struct imx_i2c_ + { + if (readb(i2c_imx->base + IMX_I2C_I2SR) & I2SR_RXAK) { + dev_dbg(&i2c_imx->adapter.dev, "<%s> No ACK\n", __func__); +- return -EIO; /* No ACK */ ++ return -EAGAIN; /* try again */ + } + + dev_dbg(&i2c_imx->adapter.dev, "<%s> ACK received\n", __func__); +@@ -533,6 +534,7 @@ static int __init i2c_imx_probe(struct p + i2c_imx->adapter.dev.parent = &pdev->dev; + i2c_imx->adapter.nr = pdev->id; + i2c_imx->adapter.dev.of_node = pdev->dev.of_node; ++ i2c_imx->adapter.retries = IMX_I2C_MAX_RETRIES; + i2c_imx->base = base; + + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); |