* [PATCH v5 0/1] Add delay after the addressed reset command in mlx90632.c
@ 2020-12-16 11:57 Slaveyko Slaveykov
2020-12-16 11:57 ` [PATCH v5 1/1] drivers: iio: temperature: " Slaveyko Slaveykov
2020-12-16 16:16 ` [PATCH v5 0/1] " Andy Shevchenko
0 siblings, 2 replies; 4+ messages in thread
From: Slaveyko Slaveykov @ 2020-12-16 11:57 UTC (permalink / raw)
To: Jonathan.Cameron, cmo
Cc: linux-iio, andy.shevchenko, lars, Slaveyko Slaveykov
The MLX90632 needs some time to reset properly after an I2C addressed reset
command. Thus a delay is added in the mlx90632.c.
v2 adds comments as advised by Andy Shevchenko.
v3 changes the comments style so that it matches the preferred style
for multi-line comments as suggested by Lars-Peter Clausen.
v4 fixes the comments style and it uses the appropriate usleep_range()
as suggested by Lars-Peter Clausen.
v5 Commit message and comments stylefixing as suggested by
Andy Shevchenko.
Slaveyko Slaveykov (1):
drivers: iio: temperature: Add delay after the addressed reset command
in mlx90632.c
drivers/iio/temperature/mlx90632.c | 6 ++++++
1 file changed, 6 insertions(+)
--
2.16.2.windows.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v5 1/1] drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c
2020-12-16 11:57 [PATCH v5 0/1] Add delay after the addressed reset command in mlx90632.c Slaveyko Slaveykov
@ 2020-12-16 11:57 ` Slaveyko Slaveykov
2020-12-29 17:09 ` Jonathan Cameron
2020-12-16 16:16 ` [PATCH v5 0/1] " Andy Shevchenko
1 sibling, 1 reply; 4+ messages in thread
From: Slaveyko Slaveykov @ 2020-12-16 11:57 UTC (permalink / raw)
To: Jonathan.Cameron, cmo
Cc: linux-iio, andy.shevchenko, lars, Slaveyko Slaveykov
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@gmail.com>
Reviewed-by: Crt Mori <cmo@melexis.com>
Signed-off-by: Slaveyko Slaveykov <sis@melexis.com>
---
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));
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v5 0/1] Add delay after the addressed reset command in mlx90632.c
2020-12-16 11:57 [PATCH v5 0/1] Add delay after the addressed reset command in mlx90632.c Slaveyko Slaveykov
2020-12-16 11:57 ` [PATCH v5 1/1] drivers: iio: temperature: " Slaveyko Slaveykov
@ 2020-12-16 16:16 ` Andy Shevchenko
1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-12-16 16:16 UTC (permalink / raw)
To: Slaveyko Slaveykov
Cc: Jonathan Cameron, Crt Mori, linux-iio, Lars-Peter Clausen
On Wed, Dec 16, 2020 at 1:58 PM Slaveyko Slaveykov <sis@melexis.com> wrote:
>
> The MLX90632 needs some time to reset properly after an I2C addressed reset
> command. Thus a delay is added in the mlx90632.c.
>
> v2 adds comments as advised by Andy Shevchenko.
>
> v3 changes the comments style so that it matches the preferred style
> for multi-line comments as suggested by Lars-Peter Clausen.
>
> v4 fixes the comments style and it uses the appropriate usleep_range()
> as suggested by Lars-Peter Clausen.
>
> v5 Commit message and comments stylefixing as suggested by
> Andy Shevchenko.
LGTM, thanks!
For the future it's not necessary to have a cover letter for a single patch.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 1/1] drivers: iio: temperature: Add delay after the addressed reset command in mlx90632.c
2020-12-16 11:57 ` [PATCH v5 1/1] drivers: iio: temperature: " Slaveyko Slaveykov
@ 2020-12-29 17:09 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2020-12-29 17:09 UTC (permalink / raw)
To: Slaveyko Slaveykov
Cc: Jonathan.Cameron, cmo, linux-iio, andy.shevchenko, lars
On Wed, 16 Dec 2020 13:57:20 +0200
Slaveyko Slaveykov <sis@melexis.com> 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@gmail.com>
> Reviewed-by: Crt Mori <cmo@melexis.com>
> Signed-off-by: Slaveyko Slaveykov <sis@melexis.com>
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));
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-29 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 11:57 [PATCH v5 0/1] Add delay after the addressed reset command in mlx90632.c Slaveyko Slaveykov
2020-12-16 11:57 ` [PATCH v5 1/1] drivers: iio: temperature: " Slaveyko Slaveykov
2020-12-29 17:09 ` Jonathan Cameron
2020-12-16 16:16 ` [PATCH v5 0/1] " Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.