summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMohan T <mohant@nvidia.com>2012-01-04 14:58:41 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-01-06 17:09:39 +0530
commit24e1b8798463da5c2ce79897655be95b4722f001 (patch)
tree839300684e8c073ea2ba0618dc1b51743814da67 /drivers
parentadd78d0716b92d0e5aa3169bcddff8b523e272e6 (diff)
drivers: nfc: pn544: Add 1ms delay after I2C read and write
pn544 seems to be slow in handling I2C read/write requests. Even though pn544 acks the read/write but next operation fails. Bug: 915848 Bug: 914700 Bug: 914691 Bug: 915598 Change-Id: I7851d0d4b7c24810ad27f3e0fbd4542b52dc8a5e Signed-off-by: Mohan T <mohant@nvidia.com> Reviewed-on: http://git-master/r/72867 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rakesh Kumar <krakesh@nvidia.com> Reviewed-by: Alok Chauhan <alokc@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nfc/pn544.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/nfc/pn544.c b/drivers/nfc/pn544.c
index 97a1f6b869f0..91216e465e12 100644
--- a/drivers/nfc/pn544.c
+++ b/drivers/nfc/pn544.c
@@ -111,6 +111,10 @@ static ssize_t pn544_dev_read(struct file *filp, char __user *buf,
mutex_unlock(&pn544_dev->read_mutex);
+ /* pn544 seems to be slow in handling I2C read requests
+ * so add 1ms delay after recv operation */
+ udelay(1000);
+
if (ret < 0) {
pr_err("%s: i2c_master_recv returned %d\n", __func__, ret);
return ret;
@@ -156,6 +160,10 @@ static ssize_t pn544_dev_write(struct file *filp, const char __user *buf,
ret = -EIO;
}
+ /* pn544 seems to be slow in handling I2C write requests
+ * so add 1ms delay after I2C send oparation */
+ udelay(1000);
+
return ret;
}