Skip to content

Commit b22299d

Browse files
ubiedakartben
authored andcommitted
sensor: icm45686: Rename REG_SPI_READ_BIT to REG_READ_BIT
So it's generic irrespective to the bus. Tested for I2C and SPI. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 1d4d742 commit b22299d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

drivers/sensor/tdk/icm45686/icm45686.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static inline void icm45686_submit_one_shot(const struct device *dev,
183183
return;
184184
}
185185

186-
uint8_t val = REG_ACCEL_DATA_X1_UI | REG_SPI_READ_BIT;
186+
uint8_t val = REG_ACCEL_DATA_X1_UI | REG_READ_BIT;
187187

188188
rtio_sqe_prep_tiny_write(write_sqe,
189189
data->rtio.iodev,

drivers/sensor/tdk/icm45686/icm45686_bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static inline int icm45686_bus_read(const struct device *dev,
3131
return -ENOMEM;
3232
}
3333

34-
reg = reg | REG_SPI_READ_BIT;
34+
reg = reg | REG_READ_BIT;
3535

3636
rtio_sqe_prep_write(write_sqe, iodev, RTIO_PRIO_HIGH, &reg, 1, NULL);
3737
write_sqe->flags |= RTIO_SQE_TRANSACTION;

drivers/sensor/tdk/icm45686/icm45686_reg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <zephyr/sys/byteorder.h>
1414

1515
/* Address value has a read bit */
16-
#define REG_SPI_READ_BIT BIT(7)
16+
#define REG_READ_BIT BIT(7)
1717

1818
/* Registers */
1919
/* Register Bank 0 */

drivers/sensor/tdk/icm45686/icm45686_stream.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void icm45686_handle_event_actions(struct rtio *ctx,
188188
buf->header.channels = 0x7F; /* Signal all channels are available */
189189
buf->header.fifo_count = data->stream.data.fifo_count;
190190

191-
read_reg = REG_FIFO_DATA | REG_SPI_READ_BIT;
191+
read_reg = REG_FIFO_DATA | REG_READ_BIT;
192192
rtio_sqe_prep_tiny_write(data_wr_sqe,
193193
data->rtio.iodev,
194194
RTIO_PRIO_HIGH,
@@ -253,7 +253,7 @@ static void icm45686_handle_event_actions(struct rtio *ctx,
253253
return;
254254
}
255255

256-
uint8_t read_reg = REG_ACCEL_DATA_X1_UI | REG_SPI_READ_BIT;
256+
uint8_t read_reg = REG_ACCEL_DATA_X1_UI | REG_READ_BIT;
257257

258258
rtio_sqe_prep_tiny_write(write_sqe,
259259
data->rtio.iodev,
@@ -360,7 +360,7 @@ static void icm45686_event_handler(const struct device *dev)
360360
}
361361

362362
/** Directly read Status Register to determine what triggered the event */
363-
val = REG_INT1_STATUS0 | REG_SPI_READ_BIT;
363+
val = REG_INT1_STATUS0 | REG_READ_BIT;
364364
rtio_sqe_prep_tiny_write(write_sqe,
365365
data->rtio.iodev,
366366
RTIO_PRIO_HIGH,
@@ -380,7 +380,7 @@ static void icm45686_event_handler(const struct device *dev)
380380
/** Preemptively read FIFO count so we can decide on the next callback
381381
* how much FIFO data we'd read (if needed).
382382
*/
383-
val = REG_FIFO_COUNT_0 | REG_SPI_READ_BIT;
383+
val = REG_FIFO_COUNT_0 | REG_READ_BIT;
384384
rtio_sqe_prep_tiny_write(write_fifo_ct_sqe,
385385
data->rtio.iodev,
386386
RTIO_PRIO_HIGH,

0 commit comments

Comments
 (0)