Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a78c0b2 authored by Bingzhe Cai's avatar Bingzhe Cai
Browse files

input: sensors: fix mma8x5x interrupt mode output rate issue



Accelerometer mma8x5x cannot change data output rate correctly in
interrupt due to wrong configuration value has been used.

Change-Id: I010cdf992267119cc8c54a855a33206920fc08e2
Signed-off-by: default avatarBingzhe Cai <bingzhec@codeaurora.org>
parent ce42a34f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ static struct sensors_classdev sensors_cdev = {
#define MMA_INT_ROUTING_CFG	0x01

#define MMA_POWER_CFG_MASK	0xFE
#define MMA_ODR_MASK		0x38

struct sensor_regulator {
	struct regulator *vreg;
@@ -408,7 +409,7 @@ static int mma8x5x_device_set_odr(struct i2c_client *client, u32 delay_ms)
	if (result < 0)
		goto out;

	val = (u8)result | val;
	val = ((u8)result & ~MMA_ODR_MASK) | val;
	result = i2c_smbus_write_byte_data(client, MMA8X5X_CTRL_REG1,
					   (val & MMA_POWER_CFG_MASK));
	if (result < 0)