Skip to content

Commit

Permalink
iio:imu: adis16475: Fix sync mode setting
Browse files Browse the repository at this point in the history
Fix sync mode setting by applying the necessary shift bits.

Fixes: fff7352 ("iio: imu: Add support for adis16475")
Signed-off-by: Ramona Gradinariu <ramona.bolboaca13@gmail.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240405045309.816328-2-ramona.bolboaca13@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
ramonabolboaca13 authored and nunojsa committed Apr 9, 2024
1 parent 8507853 commit 5d61f47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/iio/imu/adis16475.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
struct device *dev = &st->adis.spi->dev;
const struct adis16475_sync *sync;
u32 sync_mode;
u16 val;

/* default to internal clk */
st->clk_freq = st->info->int_clk * 1000;
Expand Down Expand Up @@ -1200,8 +1201,9 @@ static int adis16475_config_sync_mode(struct adis16475 *st)
* I'm keeping this for simplicity and avoiding extra variables
* in chip_info.
*/
val = ADIS16475_SYNC_MODE(sync->sync_mode);
ret = __adis_update_bits(&st->adis, ADIS16475_REG_MSG_CTRL,
ADIS16475_SYNC_MODE_MASK, sync->sync_mode);
ADIS16475_SYNC_MODE_MASK, val);
if (ret)
return ret;

Expand Down

0 comments on commit 5d61f47

Please sign in to comment.