diff mbox series

[v2] iio: imu: inv_icm42600: Fix I2C init possible nack

Message ID 20220404084650.17377-1-jmaneyrol@invensense.com (mailing list archive)
State Superseded
Headers show
Series [v2] iio: imu: inv_icm42600: Fix I2C init possible nack | expand

Commit Message

Jean-Baptiste Maneyrol April 4, 2022, 8:46 a.m. UTC
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@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>
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Jonathan Cameron April 10, 2022, 5:10 p.m. UTC | #1
On Mon,  4 Apr 2022 10:46:50 +0200
Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> wrote:

> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>

From should be Fawzi as the first author of the patch.
Use 
git commit --amend --author="Fawzi Khaber <fawzi.khaber@tdk.com>"
To reset it appropriately - or confirm you are fine with me
tweaking that whilst applying.

> 
> 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>
> Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
I should have raised this last time...

Fixes tag needed if I'm going to take this through my fixes
branch / mark it for stable etc.

If you don't mind it going the slow way and not getting backported
then I can take it without.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 11 +++++++----
>  1 file changed, 7 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..01fd883c8459 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
> @@ -18,12 +18,15 @@ 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);
diff mbox series

Patch

diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
index 33d9afb1ba91..01fd883c8459 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
@@ -18,12 +18,15 @@  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);