mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
input: sensor: fix icm42607 deep sleep auto-rotate fail.
Type: Fix Redmine ID: #469056 Associated modifications: null. Test: deep sleep then test Automatic turnover. Change-Id: I5e45b0dd5724763d5b73d97b3556b53d27004f13 Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
This commit is contained in:
@@ -218,6 +218,8 @@ static int sensor_active(struct i2c_client *client, int enable, int rate)
|
||||
"%s: fail to set pwr_mgmt0(%d)\n", __func__, result);
|
||||
return result;
|
||||
}
|
||||
/*set powerdown will make scale change*/
|
||||
sensor_write_reg(client, ICM4260X_ACCEL_CONFIG0, 0x66);
|
||||
usleep_range(250, 260);
|
||||
|
||||
return result;
|
||||
@@ -231,8 +233,8 @@ static int icm4260x_set_default_register(struct i2c_client *client)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
status |= sensor_write_reg(client, ICM4260X_GYRO_CONFIG0, 0x06);
|
||||
status |= sensor_write_reg(client, ICM4260X_ACCEL_CONFIG0, 0x06);
|
||||
status |= sensor_write_reg(client, ICM4260X_GYRO_CONFIG0, 0x66);
|
||||
status |= sensor_write_reg(client, ICM4260X_ACCEL_CONFIG0, 0x66);
|
||||
status |= sensor_write_reg(client, ICM4260X_APEX_CONFIG0, 0x08);
|
||||
status |= sensor_write_reg(client, ICM4260X_APEX_CONFIG1, 0x02);
|
||||
status |= sensor_write_reg(client, ICM4260X_WOM_CONFIG, 0);
|
||||
@@ -332,10 +334,8 @@ static int sensor_init(struct i2c_client *client)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* set Full scale select for accelerometer UI interface output*/
|
||||
value = sensor_read_reg(client, ICM4260X_ACCEL_CONFIG0);
|
||||
value &= ~BIT_ACCEL_FSR;
|
||||
value |= ACCEL_FS_SEL << SHIFT_ACCEL_FS_SEL;
|
||||
/* set +-2g scale select for accelerometer UI interface output*/
|
||||
value = 0x66;
|
||||
ret = sensor_write_reg(client, ICM4260X_ACCEL_CONFIG0, value);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -47,6 +47,8 @@ static int sensor_active(struct i2c_client *client, int enable, int rate)
|
||||
"%s: fail to set pwr_mgmt0(%d)\n", __func__, result);
|
||||
return result;
|
||||
}
|
||||
/*set powerdown will make scale change*/
|
||||
sensor_write_reg(client, ICM4260X_GYRO_CONFIG0, 0x66);
|
||||
/* Gyroscope needs to be kept ON for a minimum of 45ms */
|
||||
usleep_range(45*1000, 45*1010);
|
||||
|
||||
@@ -64,10 +66,8 @@ static int sensor_init(struct i2c_client *client)
|
||||
* init on icm42607_acc.c
|
||||
*/
|
||||
|
||||
/* set Full scale select for accelerometer UI interface output*/
|
||||
value = sensor_read_reg(client, ICM4260X_GYRO_CONFIG0);
|
||||
value &= ~BIT_GYRO_FSR;
|
||||
value |= GYRO_FS_SEL << SHIFT_GYRO_FS_SEL;
|
||||
/* set +/-2g scale select for accelerometer UI interface output*/
|
||||
value = 0x66;
|
||||
ret = sensor_write_reg(client, ICM4260X_GYRO_CONFIG0, value);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user