From 4da602d0f09949085b67a42341268dcb004f22e7 Mon Sep 17 00:00:00 2001 From: Xiaohui Tao Date: Wed, 2 Oct 2013 13:26:39 -0700 Subject: 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 Reviewed-on: http://git-master/r/281110 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Collins Reviewed-by: Ankit Pashiney Tested-by: Robert Collins --- drivers/input/misc/mpu/inv_gyro.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/input') 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; } -- cgit v1.2.3