Skip to content

Commit 714c951

Browse files
jmaneyrol-invngregkh
authored andcommitted
iio: imu: inv_icm45600: fix INT1 drive bit inverted
commit 7ef74d9 upstream. Drive bit must be set for open-drain mode and be cleared for push-pull mode. Referring to datasheet DS-000576_ICM-45605.pdf section 17.23 INT1_CONFIG2. Fixes: 06674a7 ("iio: imu: inv_icm45600: add buffer support in iio devices") Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 33661bf commit 714c951

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/iio/imu/inv_icm45600/inv_icm45600.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ struct inv_icm45600_sensor_state {
205205
#define INV_ICM45600_SPI_SLEW_RATE_38NS 0
206206

207207
#define INV_ICM45600_REG_INT1_CONFIG2 0x0018
208-
#define INV_ICM45600_INT1_CONFIG2_PUSH_PULL BIT(2)
208+
#define INV_ICM45600_INT1_CONFIG2_OPEN_DRAIN BIT(2)
209209
#define INV_ICM45600_INT1_CONFIG2_LATCHED BIT(1)
210210
#define INV_ICM45600_INT1_CONFIG2_ACTIVE_HIGH BIT(0)
211211
#define INV_ICM45600_INT1_CONFIG2_ACTIVE_LOW 0x00

drivers/iio/imu/inv_icm45600/inv_icm45600_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ static int inv_icm45600_irq_init(struct inv_icm45600_state *st, int irq,
637637
break;
638638
}
639639

640-
if (!open_drain)
641-
val |= INV_ICM45600_INT1_CONFIG2_PUSH_PULL;
640+
if (open_drain)
641+
val |= INV_ICM45600_INT1_CONFIG2_OPEN_DRAIN;
642642

643643
ret = regmap_write(st->map, INV_ICM45600_REG_INT1_CONFIG2, val);
644644
if (ret)

0 commit comments

Comments
 (0)