mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
driver: mpu: to support mpu6881/mpu6880
Change-Id: I731788cd35d27d2aab946ccb22f744aad85f7be3 Signed-off-by: Zorro Liu <lyx@rock-chips.com>
This commit is contained in:
parent
03078e9fda
commit
7943fd79ea
|
|
@ -1762,6 +1762,7 @@ int inv_check_chip_type(struct inv_mpu_iio_s *st, const char *name)
|
|||
struct inv_reg_map_s *reg;
|
||||
int result;
|
||||
int t_ind;
|
||||
int timeout = 10;
|
||||
|
||||
if (!strcmp(name, "itg3500"))
|
||||
st->chip_type = INV_ITG3500;
|
||||
|
|
@ -1787,9 +1788,14 @@ int inv_check_chip_type(struct inv_mpu_iio_s *st, const char *name)
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -647,6 +647,9 @@ struct inv_mpu_slave {
|
|||
/*---- 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
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ int inv_get_silicon_rev_mpu6500(struct inv_mpu_iio_s *st)
|
|||
if (result)
|
||||
return result;
|
||||
if (whoami != MPU6500_ID && whoami != MPU9250_ID &&
|
||||
whoami != MPU6515_ID)
|
||||
whoami != MPU6515_ID && whoami != MPU6880_ID)
|
||||
return -EINVAL;
|
||||
|
||||
/*memory read need more time after power up */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user