Skip to content

Commit b5d6ba0

Browse files
fkhaber-invnjic23
authored andcommitted
iio: imu: inv_icm42600: Fix I2C init possible nack
This register write to REG_INTF_CONFIG6 enables a spike filter that is impacting the line and can prevent the I2C ACK to be seen by the controller. So we don't test the return value. Fixes: 7297ef1 ("iio: imu: inv_icm42600: add I2C driver") Signed-off-by: Fawzi Khaber <fawzi.khaber@tdk.com> Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://lore.kernel.org/r/20220411111533.5826-1-jmaneyrol@invensense.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent e7e51eb commit b5d6ba0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ static int inv_icm42600_i2c_bus_setup(struct inv_icm42600_state *st)
1818
unsigned int mask, val;
1919
int ret;
2020

21-
/* setup interface registers */
22-
ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
23-
INV_ICM42600_INTF_CONFIG6_MASK,
24-
INV_ICM42600_INTF_CONFIG6_I3C_EN);
25-
if (ret)
26-
return ret;
21+
/*
22+
* setup interface registers
23+
* This register write to REG_INTF_CONFIG6 enables a spike filter that
24+
* is impacting the line and can prevent the I2C ACK to be seen by the
25+
* controller. So we don't test the return value.
26+
*/
27+
regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
28+
INV_ICM42600_INTF_CONFIG6_MASK,
29+
INV_ICM42600_INTF_CONFIG6_I3C_EN);
2730

2831
ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4,
2932
INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0);

0 commit comments

Comments
 (0)