summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDavid Yu <davyu@nvidia.com>2014-03-07 23:10:50 +0900
committerHarry Hong <hhong@nvidia.com>2014-03-12 17:42:22 -0700
commit1da62bf1062d08c46593a43444f598a187db5ac3 (patch)
tree76e9ad0cbbf8d52666a309a7650c3ff36b130be4 /drivers
parentce98dc80f689cbc3a75ebf316fc07a9e67580bf9 (diff)
input: misc: mpu: fix i2c arbitration lost
Arbitration lost occurs when regulators are turned on while another i2c device on the same bus is transferring data. This impacts all the slave devices on the same bus. tegra-i2c tegra11-i2c.0: --- register dump for debugging ---- tegra-i2c tegra11-i2c.0: I2C_CNFG - 0x2c00 tegra-i2c tegra11-i2c.0: I2C_PACKET_TRANSFER_STATUS - 0xff0021 tegra-i2c tegra11-i2c.0: I2C_FIFO_CONTROL - 0xe0 tegra-i2c tegra11-i2c.0: I2C_FIFO_STATUS - 0x800080 tegra-i2c tegra11-i2c.0: I2C_INT_MASK - 0xec tegra-i2c tegra11-i2c.0: I2C_INT_STATUS - 0x2 tegra-i2c tegra11-i2c.0: msg->len - 3 tegra-i2c tegra11-i2c.0: is_msg_write - 1 tegra-i2c tegra11-i2c.0: buf_remaining - 0 tegra-i2c tegra11-i2c.0: i2c transfer timed out, addr 0x001c, data 0x6a tegra-i2c tegra11-i2c.0: arbitration lost during communicate to add 0x69 tegra-i2c tegra11-i2c.0: Recovered Arbitration lost tegra-i2c tegra11-i2c.0: arbitration lost during communicate to add 0x1c tegra-i2c tegra11-i2c.0: Recovered Arbitration lost tegra-i2c tegra11-i2c.0: arbitration lost during communicate to add 0x1c tegra-i2c tegra11-i2c.0: Recovered Arbitration lost Bug 1461473 Change-Id: I417e1e81fa0a1628784f5e6062fa6f8e1979a038 Signed-off-by: David Yu <davyu@nvidia.com> Reviewed-on: http://git-master/r/379058 Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/misc/mpu/inv_gyro.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/misc/mpu/inv_gyro.c b/drivers/input/misc/mpu/inv_gyro.c
index 9b67b9f88748..402c54b23e78 100644
--- a/drivers/input/misc/mpu/inv_gyro.c
+++ b/drivers/input/misc/mpu/inv_gyro.c
@@ -814,8 +814,14 @@ static int nvi_vreg_en_all(struct inv_gyro_state_s *inf)
unsigned i;
int err = 0;
+#if LOCK_I2C_ON_REG_ON
+ i2c_lock_adapter(inf->sl_handle);
+#endif
for (i = 0; i < ARRAY_SIZE(nvi_vregs); i++)
err |= nvi_vreg_en(inf, i);
+#if LOCK_I2C_ON_REG_ON
+ i2c_unlock_adapter(inf->sl_handle);
+#endif
if (err == 1)
mdelay(9);
return err;