drivers: nfc: pn544: Add 1ms delay after I2C read and write
Mohan T [Wed, 4 Jan 2012 09:28:41 +0000 (14:28 +0530)]
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>

drivers/nfc/pn544.c

index 97a1f6b..91216e4 100644 (file)
@@ -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;
 }