diff options
author | Xiaohui Tao <xtao@nvidia.com> | 2013-10-02 13:26:39 -0700 |
---|---|---|
committer | Harshada Kale <hkale@nvidia.com> | 2013-10-07 00:04:32 -0700 |
commit | 4da602d0f09949085b67a42341268dcb004f22e7 (patch) | |
tree | d9310945d6078cce2479b2e99510776ca408c146 | |
parent | 7a880ee55ff6c88fd9a125932d71f6ba0f3a5541 (diff) |
input: misc: mpu: Check suspend status before i2c
During suspend/resume period, it is possible that the i2c transfer
still occurs after the power to the chip has already been cut. Add
shutdown to regulator control in order to avoid timeout when anyone
tries to send anything through the i2c bus when the chip has been
removed power.
Bug 1361923
Change-Id: I1cd37b56a7572955e1e8c29034d04c00c9c81e18
Signed-off-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-on: http://git-master/r/281110
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Ankit Pashiney <apashiney@nvidia.com>
Tested-by: Robert Collins <rcollins@nvidia.com>
-rw-r--r-- | drivers/input/misc/mpu/inv_gyro.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/input/misc/mpu/inv_gyro.c b/drivers/input/misc/mpu/inv_gyro.c index 65e375f9d2e6..5e1c52dfb0a5 100644 --- a/drivers/input/misc/mpu/inv_gyro.c +++ b/drivers/input/misc/mpu/inv_gyro.c @@ -773,6 +773,7 @@ static int nvi_vreg_dis_all(struct inv_gyro_state_s *inf) for (i = ARRAY_SIZE(nvi_vregs); i > 0; i--) err |= nvi_vreg_dis(inf, (i - 1)); + inf->shutdown = true; return err; } @@ -802,6 +803,7 @@ static int nvi_vreg_en_all(struct inv_gyro_state_s *inf) for (i = 0; i < ARRAY_SIZE(nvi_vregs); i++) err |= nvi_vreg_en(inf, i); + inf->shutdown = false; return err; } |