Re: [PATCH v5 1/1] drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 16 Dec 2020 13:57:20 +0200
Slaveyko Slaveykov <sis@xxxxxxxxxxx> wrote:

> 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.
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Reviewed-by: Crt Mori <cmo@xxxxxxxxxxx>
> Signed-off-by: Slaveyko Slaveykov <sis@xxxxxxxxxxx>

Note that this should have had a fixes tag so we know where to apply it whilst
backporting.  I took a look and ended up adding:
Fixes: e02472f74a81 ("iio:temperature:mlx90632: Adding extended calibration option")

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> ---
>  drivers/iio/temperature/mlx90632.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> index 503fe54a0bb9..608ccb1d8bc8 100644
> --- a/drivers/iio/temperature/mlx90632.c
> +++ b/drivers/iio/temperature/mlx90632.c
> @@ -248,6 +248,12 @@ static int mlx90632_set_meas_type(struct regmap *regmap, u8 type)
>  	if (ret < 0)
>  		return ret;
>  
> +	/*
> +	 * Give the mlx90632 some time to reset properly before sending a new I2C command
> +	 * if this is not done, the following I2C command(s) will not be accepted.
> +	 */
> +	usleep_range(150, 200);
> +
>  	ret = regmap_write_bits(regmap, MLX90632_REG_CONTROL,
>  				 (MLX90632_CFG_MTYP_MASK | MLX90632_CFG_PWR_MASK),
>  				 (MLX90632_MTYP_STATUS(type) | MLX90632_PWR_STATUS_HALT));




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux