summaryrefslogtreecommitdiff
path: root/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
diff options
context:
space:
mode:
authorJean-Baptiste Maneyrol <jmaneyrol@invensense.com>2020-02-19 17:39:48 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-03-08 20:28:37 +0300
commita3aaf7770a8887cedf216becc5392e481ee1fcaa (patch)
tree50261074de888990da7701b81877d8a9e2bfa34e /drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
parent14c046ed17111b50aa9c5d8bd25d742421ac843c (diff)
downloadlinux-a3aaf7770a8887cedf216becc5392e481ee1fcaa.tar.xz
iio: imu: inv_mpu6050: set power on/off only once during all init
This way there is no need anymore to export the power function to i2c and spi modules. Bus setup is done inside init when power is on and the result is now checked. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c')
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
index 24df880248f2..6993d3b87bb0 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
@@ -78,22 +78,13 @@ static int inv_mpu_i2c_aux_setup(struct iio_dev *indio_dev)
/* enable i2c bypass when using i2c auxiliary bus */
if (inv_mpu_i2c_aux_bus(dev)) {
- ret = inv_mpu6050_set_power_itg(st, true);
- if (ret)
- return ret;
ret = regmap_write(st->map, st->reg->int_pin_cfg,
st->irq_mask | INV_MPU6050_BIT_BYPASS_EN);
if (ret)
- goto error;
- ret = inv_mpu6050_set_power_itg(st, false);
- if (ret)
- goto error;
+ return ret;
}
return 0;
-error:
- inv_mpu6050_set_power_itg(st, false);
- return ret;
}
/**