b &= ~BIT_3050_AUX_IF_EN;
if (!enable) {
b |= BIT_3050_AUX_IF_EN;
- result = inv_plat_single_write(st, reg->user_ctrl, b);
+ result = inv_plat_single_write(st, reg->user_ctrl, b | st->i2c_dis);
return result;
} else {
/* Coming out of I2C is tricky due to several erratta. Do not
* bypass mode:
*/
usleep_range(MPU3050_NACK_MIN_TIME, MPU3050_NACK_MAX_TIME);
- result = inv_plat_single_write(st, reg->user_ctrl, b);
+ result = inv_plat_single_write(st, reg->user_ctrl, b | st->i2c_dis);
if (result)
return result;
/*
return result;
result = inv_plat_single_write(st, reg->user_ctrl,
- (b | BIT_3050_AUX_IF_RST));
+ (b | BIT_3050_AUX_IF_RST | st->i2c_dis));
if (result)
return result;
usleep_range(MPU3050_NACK_MIN_TIME, MPU3050_NACK_MAX_TIME);
if (result)
return result;
/* disable fifo reading */
- result = inv_plat_single_write(st, reg->user_ctrl, 0);
+ result = inv_plat_single_write(st, reg->user_ctrl, st->i2c_dis);
if (result)
return result;
/* clear FIFO */
- result = inv_plat_single_write(st, reg->user_ctrl, BIT_FIFO_RST);
+ result = inv_plat_single_write(st, reg->user_ctrl, BIT_FIFO_RST | st->i2c_dis);
if (result)
return result;
/* setup parameters */
}
/* enable FIFO reading */
- result = inv_plat_single_write(st, reg->user_ctrl, BIT_FIFO_EN);
+ result = inv_plat_single_write(st, reg->user_ctrl, BIT_FIFO_EN | st->i2c_dis);
if (result)
return result;
/* enable sensor output to FIFO */
st->chip_config.has_footer = 0;
/* reset fifo */
val = (BIT_3050_FIFO_RST | user_ctrl);
- result = inv_plat_single_write(st, reg->user_ctrl, val);
+ result = inv_plat_single_write(st, reg->user_ctrl, val | st->i2c_dis);
if (result)
goto reset_fifo_fail;
st->last_isr_time = get_time_ns();
return result;
result = inv_plat_single_write(st, reg->user_ctrl,
- BIT_FIFO_EN|user_ctrl);
+ BIT_FIFO_EN | user_ctrl | st->i2c_dis);
if (result)
return result;
} else {
}
/* enable FIFO reading and I2C master interface*/
result = inv_plat_single_write(st, reg->user_ctrl,
- BIT_FIFO_EN | user_ctrl);
+ BIT_FIFO_EN | user_ctrl | st->i2c_dis);
if (result)
return result;
/* enable sensor output to FIFO and FIFO footer*/
if (result)
goto reset_fifo_fail;
/* disable fifo reading */
- result = inv_plat_single_write(st, reg->user_ctrl, 0);
+ result = inv_plat_single_write(st, reg->user_ctrl, st->i2c_dis);
if (result)
goto reset_fifo_fail;
int_word = 0;
if (st->chip_config.dmp_on) {
val = (BIT_FIFO_RST | BIT_DMP_RST);
- result = inv_plat_single_write(st, reg->user_ctrl, val);
+ result = inv_plat_single_write(st, reg->user_ctrl, val | st->i2c_dis);
if (result)
goto reset_fifo_fail;
st->last_isr_time = get_time_ns();
if (st->chip_config.compass_enable &
(!st->chip_config.dmp_event_int_on))
val |= BIT_I2C_MST_EN;
- result = inv_plat_single_write(st, reg->user_ctrl, val);
+ result = inv_plat_single_write(st, reg->user_ctrl, val | st->i2c_dis);
if (result)
goto reset_fifo_fail;
} else {
/* reset FIFO and possibly reset I2C*/
val = BIT_FIFO_RST;
- result = inv_plat_single_write(st, reg->user_ctrl, val);
+ result = inv_plat_single_write(st, reg->user_ctrl, val | st->i2c_dis);
if (result)
goto reset_fifo_fail;
st->last_isr_time = get_time_ns();
val = BIT_FIFO_EN;
if (st->chip_config.compass_enable)
val |= BIT_I2C_MST_EN;
- result = inv_plat_single_write(st, reg->user_ctrl, val);
+ result = inv_plat_single_write(st, reg->user_ctrl, val | st->i2c_dis);
if (result)
goto reset_fifo_fail;
if (st->chip_config.compass_enable) {
result = inv_plat_single_write(st, reg->int_enable, 0);
if (result)
return result;
- result = inv_plat_single_write(st, reg->user_ctrl, 0);
+ result = inv_plat_single_write(st, reg->user_ctrl, st->i2c_dis);
} else {
result = inv_plat_single_write(st, reg->int_enable,
st->plat_data.int_config);