1
1
/* Bosch BMA4xx 3-axis accelerometer driver
2
2
*
3
3
* Copyright (c) 2023 Google LLC
4
+ * Copyright (c) 2024 Croxel Inc.
4
5
*
5
6
* SPDX-License-Identifier: Apache-2.0
6
7
*/
12
13
#include <zephyr/sys/__assert.h>
13
14
#include <zephyr/logging/log.h>
14
15
#include <zephyr/pm/device.h>
16
+ #include <zephyr/rtio/work.h>
15
17
16
18
LOG_MODULE_REGISTER (bma4xx , CONFIG_SENSOR_LOG_LEVEL );
17
19
#include "bma4xx.h"
@@ -425,9 +427,10 @@ static void bma4xx_submit_one_shot(const struct device *dev, struct rtio_iodev_s
425
427
rtio_iodev_sqe_ok (iodev_sqe , 0 );
426
428
}
427
429
428
- static void bma4xx_submit ( const struct device * dev , struct rtio_iodev_sqe * iodev_sqe )
430
+ static void bma4xx_submit_sync ( struct rtio_iodev_sqe * iodev_sqe )
429
431
{
430
432
const struct sensor_read_config * cfg = iodev_sqe -> sqe .iodev -> data ;
433
+ const struct device * dev = cfg -> sensor ;
431
434
432
435
/* TODO: Add streaming support */
433
436
if (!cfg -> is_streaming ) {
@@ -437,6 +440,15 @@ static void bma4xx_submit(const struct device *dev, struct rtio_iodev_sqe *iodev
437
440
}
438
441
}
439
442
443
+ static void bma4xx_submit (const struct device * dev , struct rtio_iodev_sqe * iodev_sqe )
444
+ {
445
+ struct rtio_work_req * req = rtio_work_req_alloc ();
446
+
447
+ __ASSERT_NO_MSG (req );
448
+
449
+ rtio_work_req_submit (req , iodev_sqe , bma4xx_submit_sync );
450
+ }
451
+
440
452
/*
441
453
* RTIO decoder
442
454
*/
0 commit comments