Commit 398da994 authored by Jean-Baptiste Maneyrol's avatar Jean-Baptiste Maneyrol Committed by Jonathan Cameron
Browse files

iio: imu: inv_mpu6050: reduce sleep time when turning regulators on



Turning vdd regulator on requires a consequent sleep for the
chip to power on correctly.
Turning vddio regulator is much faster.

Signed-off-by: default avatarJean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent c1bfe9c8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1201,7 +1201,7 @@ static int inv_mpu_core_enable_regulator_vddio(struct inv_mpu6050_state *st)
			"Failed to enable vddio regulator: %d\n", result);
	} else {
		/* Give the device a little bit of time to start up. */
		usleep_range(35000, 70000);
		usleep_range(3000, 5000);
	}

	return result;
@@ -1321,6 +1321,7 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
		dev_err(dev, "Failed to enable vdd regulator: %d\n", result);
		return result;
	}
	msleep(INV_MPU6050_POWER_UP_TIME);

	result = inv_mpu_core_enable_regulator_vddio(st);
	if (result) {