diff options
author | Adriana Reus <adriana.reus@intel.com> | 2016-02-12 13:44:42 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-02-13 20:52:47 +0000 |
commit | c278ac0ecd198a3a1be5b2f1159ffec2e3107ecb (patch) | |
tree | e420c190e6cd77dbcacea6c463b942d7845cd8ba /drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | |
parent | f836c45922446df872250a12dd08e48978aceb2f (diff) | |
download | op-kernel-dev-c278ac0ecd198a3a1be5b2f1159ffec2e3107ecb.zip op-kernel-dev-c278ac0ecd198a3a1be5b2f1159ffec2e3107ecb.tar.gz |
iio: imu: inv-mpu6050: Fix interrupt pin configuration
The select/deselect_bypass duo writes the irq number into the interrupt
configuration register.
If there is a i2c slave device connected to the mpu (eg. a magnetometer)
then this can hinder interrupt delivery for the accelerometer and
gyroscope.
Set this register to the default configuration.
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu/inv_mpu6050/inv_mpu_core.c')
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 0852b7f..1121f4e 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -129,7 +129,7 @@ static int inv_mpu6050_select_bypass(struct i2c_adapter *adap, void *mux_priv, if (!ret) { st->powerup_count++; ret = inv_mpu6050_write_reg_unlocked(st, st->reg->int_pin_cfg, - st->client->irq | + INV_MPU6050_INT_PIN_CFG | INV_MPU6050_BIT_BYPASS_EN); } write_error: @@ -147,7 +147,7 @@ static int inv_mpu6050_deselect_bypass(struct i2c_adapter *adap, mutex_lock(&indio_dev->mlock); /* It doesn't really mattter, if any of the calls fails */ inv_mpu6050_write_reg_unlocked(st, st->reg->int_pin_cfg, - st->client->irq); + INV_MPU6050_INT_PIN_CFG); st->powerup_count--; if (!st->powerup_count) inv_mpu6050_write_reg_unlocked(st, st->reg->pwr_mgmt_1, |