* [PATCH] iio: imu: inv_icm42600: Fix I2C init possible nack
@ 2022-03-31 9:11 Jean-Baptiste Maneyrol
2022-04-02 16:25 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Baptiste Maneyrol @ 2022-03-31 9:11 UTC (permalink / raw)
To: jmaneyrol, jic23, lars; +Cc: linux-iio, Fawzi Khaber
From: Fawzi Khaber <fawzi.khaber@tdk.com>
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.
Signed-off-by: Fawzi Khaber <fawzi.khaber@tdk.com>
---
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
index 33d9afb1ba91..9c1e373a5daf 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
@@ -18,12 +18,16 @@ static int inv_icm42600_i2c_bus_setup(struct inv_icm42600_state *st)
unsigned int mask, val;
int ret;
- /* setup interface registers */
- ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
+ /*
+ * setup interface registers
+ * 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.
+ */
+ regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
INV_ICM42600_INTF_CONFIG6_MASK,
INV_ICM42600_INTF_CONFIG6_I3C_EN);
- if (ret)
- return ret;
+
ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4,
INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: imu: inv_icm42600: Fix I2C init possible nack
2022-03-31 9:11 [PATCH] iio: imu: inv_icm42600: Fix I2C init possible nack Jean-Baptiste Maneyrol
@ 2022-04-02 16:25 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-04-02 16:25 UTC (permalink / raw)
To: Jean-Baptiste Maneyrol; +Cc: lars, linux-iio, Fawzi Khaber
On Thu, 31 Mar 2022 11:11:21 +0200
Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> wrote:
> From: Fawzi Khaber <fawzi.khaber@tdk.com>
>
> 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.
>
> Signed-off-by: Fawzi Khaber <fawzi.khaber@tdk.com>
Jean-Baptiste, this needs your sign-off as well as you were part of the
path the patch is taking to mainline (see the DCO stuff in submitting
patches).
Thanks,
Jonathan
> ---
> drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
> index 33d9afb1ba91..9c1e373a5daf 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
> @@ -18,12 +18,16 @@ static int inv_icm42600_i2c_bus_setup(struct inv_icm42600_state *st)
> unsigned int mask, val;
> int ret;
>
> - /* setup interface registers */
> - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
> + /*
> + * setup interface registers
> + * 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.
> + */
> + regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
> INV_ICM42600_INTF_CONFIG6_MASK,
> INV_ICM42600_INTF_CONFIG6_I3C_EN);
> - if (ret)
> - return ret;
> +
Drop this additional blank line. One is enough!
>
> ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4,
> INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0);
> --
> 2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-02 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-31 9:11 [PATCH] iio: imu: inv_icm42600: Fix I2C init possible nack Jean-Baptiste Maneyrol
2022-04-02 16:25 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox