Skip to content

Commit cf5b138

Browse files
slavysisjic23
authored andcommitted
drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c
After an I2C reset command, the mlx90632 needs some time before responding to other I2C commands. Without that delay, there is a chance that the I2C command(s) after the reset will not be accepted. Signed-off-by: Slaveyko Slaveykov <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Crt Mori <[email protected]> Fixes: e02472f ("iio:temperature:mlx90632: Adding extended calibration option") Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 7e6d978 commit cf5b138

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/iio/temperature/mlx90632.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ static int mlx90632_set_meas_type(struct regmap *regmap, u8 type)
248248
if (ret < 0)
249249
return ret;
250250

251+
/*
252+
* Give the mlx90632 some time to reset properly before sending a new I2C command
253+
* if this is not done, the following I2C command(s) will not be accepted.
254+
*/
255+
usleep_range(150, 200);
256+
251257
ret = regmap_write_bits(regmap, MLX90632_REG_CONTROL,
252258
(MLX90632_CFG_MTYP_MASK | MLX90632_CFG_PWR_MASK),
253259
(MLX90632_MTYP_STATUS(type) | MLX90632_PWR_STATUS_HALT));

0 commit comments

Comments
 (0)