struct inv_reg_map_s *reg;
int result;
int t_ind;
+ int timeout = 10;
if (!strcmp(name, "itg3500"))
st->chip_type = INV_ITG3500;
reg = &st->reg;
st->setup_reg(reg);
/* reset to make sure previous state are not there */
- result = inv_plat_single_write(st, reg->pwr_mgmt_1, BIT_H_RESET);
- if (result)
- return result;
+ while (timeout) {
+ result = inv_plat_single_write(st, reg->pwr_mgmt_1, BIT_H_RESET);
+ if (!result)
+ break;
+ pr_err("inv_mpu: reset chip failed, err = %d\n", result);
+ timeout--;
+ msleep(POWER_UP_TIME);
+ }
msleep(POWER_UP_TIME);
/* toggle power state */
result = st->set_power_state(st, false);
/*---- MPU9250 ----*/
#define MPU9250_ID 0x71 /* unique WHOAMI */
+/*---- MPU6880 ----*/
+#define MPU6880_ID 0x78 /* unique WHOAMI */
+
#define THREE_AXIS 3
#define GYRO_CONFIG_FSR_SHIFT 3
#define ACCL_CONFIG_FSR_SHIFT 3