Skip to content

Commit 74a72ba

Browse files
ramonabolboaca13jic23
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 6b8cffd commit 74a72ba

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
@@ -1289,6 +1289,7 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
12891289
struct device *dev = &st->adis.spi->dev;
12901290
const struct adis16475_sync *sync;
12911291
u32 sync_mode;
1292+
u16 val;
12921293

12931294
/* default to internal clk */
12941295
st->clk_freq = st->info->int_clk * 1000;
@@ -1350,8 +1351,9 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
13501351
* I'm keeping this for simplicity and avoiding extra variables
13511352
* in chip_info.
13521353
*/
1354+
val = ADIS16475_SYNC_MODE(sync->sync_mode);
13531355
ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL,
1354-
ADIS16475_SYNC_MODE_MASK, sync->sync_mode);
1356+
ADIS16475_SYNC_MODE_MASK, val);
13551357
if (ret)
13561358
return ret;
13571359

0 commit comments

Comments
 (0)