-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: sensor: adxl367: Added RTIO stream #80610
drivers: sensor: adxl367: Added RTIO stream #80610
Conversation
8af884f
to
aba1931
Compare
if (IS_ENABLED(CONFIG_ADXL367_STREAM)) { | ||
adxl367_stream_irq_handler(drv_data->dev); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely this should be in the block ifdefs below, where STREAM is an option for trigger handling.
Unclear how this would operate with both streaming and a work/thread trigger being called out. Likely problematic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are processing different IRQs (stream is expecting FIFO full or FIFO watermark and trigger is expecting Data ready or Activity threshold) so if both are enabled it should work ok. If for example, Data ready is triggered, stream code would call RTIO to read STATUS register (when callback is triggered it would determine that IRQ is not for the stream and do nothing) and adxl367_thread_cb would do the processing of that IRQ. Similar thing would happen when FIFO full would trigger (stream would do the processing and adxl367_thread_cb would do nothing). This is just my opinion. I could be wrong.
What platform are you testing this on? I am getting a usage fault with MAX32690 somewhere in spi_max32.c when using streaming mode. Trigger mode works fine. My build command is: foo@bar:~$ west build -p -b max32690fthr/max32690/m4 samples/sensor/accel_polling -- -DCONFIG_ADXL367_STREAM=y -DCONFIG_SENSOR_ASYNC_API=y -DCONFIG_SPI_RTIO=y Devicetree modification:
|
I am using apard32690 (also MAX32690). Regarding build command you do not need DCONFIG_ADXL367_STREAM. It will be set automatically with Kconfig. There are couple of bugs in the original part of a driver. One of them is causing exception when SPI driver with RTIO is used. I made another PR with bug fixes so please check #80617. |
1858798
to
4eb21c2
Compare
I will check that out, thanks. |
4eb21c2
to
6f7ac0f
Compare
5096fd2
to
920e496
Compare
39fa785
to
51adfed
Compare
Updated ADXL367 driver with RTIO stream functionality. RTIO stream is using both FIFO threshold and FIFO full triggers. Together with RTIO stream, RTIO async read is also implemented. Supported FIFO_CHANNEL configurations: - XYZ - X - Y - Z - XYZT - XT - YT - ZT Configurations with external ADC are currently not supported. Signed-off-by: Vladislav Pejic <[email protected]>
51adfed
to
c2fe01d
Compare
@teburd Can you please take a look at latest changes? |
write_status_addr->flags = RTIO_SQE_TRANSACTION; | ||
rtio_sqe_prep_read(read_status_reg, data->iodev, RTIO_PRIO_NORM, &data->status, 1, NULL); | ||
read_status_reg->flags = RTIO_SQE_CHAINED; | ||
rtio_sqe_prep_callback(check_status_reg, adxl367_process_status_cb, (void *)dev, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend using rtio_sqe_prep_callback_no_cqe for all of these to avoid creating a completion that you don't actually care about, but not a blocker if the driver is working
Updated ADXL367 driver with RTIO stream functionality. RTIO stream is using both FIFO threshold and FIFO full triggers. Together with RTIO stream, RTIO async read is also implemented. Supported FIFO_CHANNEL configurations:
Configurations with external ADC are currently not supported.
Signed-off-by: Vladislav Pejic [email protected]