aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mxs.c
diff options
context:
space:
mode:
authorJanusz Użycki <j.uzycki@elproma.com.pl>2014-09-23 12:48:26 +0200
committerWolfram Sang <wsa@the-dreams.de>2014-10-03 03:35:49 +0200
commit030f940a535433605e6b4ee43f36189e5cace022 (patch)
tree21e7c18dcf261cdd186875fca17571047b060912 /drivers/i2c/busses/i2c-mxs.c
parenti2c: cros_ec: Remove EC_I2C_FLAG_10BIT (diff)
downloadlinux-dev-030f940a535433605e6b4ee43f36189e5cace022.tar.xz
linux-dev-030f940a535433605e6b4ee43f36189e5cace022.zip
i2c: mxs: detect No Slave Ack on SELECT in PIO mode
i2cdetect scanned i2c bus slow because the i2c-mxs driver ignored the NO_SLAVE_ACK bit during busy-waiting loop. Thanks to the patch, the speedup happens. Signed-off-by: Janusz Uzycki <j.uzycki@elproma.com.pl> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-mxs.c')
-rw-r--r--drivers/i2c/busses/i2c-mxs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 65a21fed08b5..07e1be6f8992 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -307,6 +307,9 @@ static int mxs_i2c_pio_wait_xfer_end(struct mxs_i2c_dev *i2c)
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
while (readl(i2c->regs + MXS_I2C_CTRL0) & MXS_I2C_CTRL0_RUN) {
+ if (readl(i2c->regs + MXS_I2C_CTRL1) &
+ MXS_I2C_CTRL1_NO_SLAVE_ACK_IRQ)
+ return -ENXIO;
if (time_after(jiffies, timeout))
return -ETIMEDOUT;
cond_resched();