Skip to content

Commit 5d61f47

Browse files
ramonabolboaca13nunojsa
authored andcommitted
iio:imu: adis16475: Fix sync mode setting
Fix sync mode setting by applying the necessary shift bits. Fixes: fff7352 ("iio: imu: Add support for adis16475") Signed-off-by: Ramona Gradinariu <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 8507853 commit 5d61f47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iio/imu/adis16475.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
11311131
struct device *dev = &st->adis.spi->dev;
11321132
const struct adis16475_sync *sync;
11331133
u32 sync_mode;
1134+
u16 val;
11341135

11351136
/* default to internal clk */
11361137
st->clk_freq = st->info->int_clk * 1000;
@@ -1200,8 +1201,9 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
12001201
* I'm keeping this for simplicity and avoiding extra variables
12011202
* in chip_info.
12021203
*/
1204+
val = ADIS16475_SYNC_MODE(sync->sync_mode);
12031205
ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL,
1204-
ADIS16475_SYNC_MODE_MASK, sync->sync_mode);
1206+
ADIS16475_SYNC_MODE_MASK, val);
12051207
if (ret)
12061208
return ret;
12071209

0 commit comments

Comments
 (0)