iio: imu: mpu6050: Add support for vdd-supply regulator
authorStephan Gerhold <stephan@gerhold.net>
Thu, 7 Nov 2019 18:43:42 +0000 (19:43 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 10 Nov 2019 16:00:34 +0000 (16:00 +0000)
commit26a0ffeed95190c72da398ae9f655507dc87550f
tree777286ee0e1256b38e04cca5c8dd1caac518f2e7
parentea3b263e83ed706343b935b1b239ae15ecdf176a
iio: imu: mpu6050: Add support for vdd-supply regulator

MPU6050 has two power supply pins: VDD and VLOGIC, but the
mpu6050 driver only supports enabling one of them at the moment.
In some cases, they may need to be enabled separately.

Add an additional "vdd-supply" that stays enabled for as long as
the driver is loaded. We cannot turn off the VDD regulator during
suspend as this would cause register settings (FSR, sampling rate, ...)
to be lost.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h