Repository navigation
iio: aop_motion: give each sensor its own trigger - #1038
Merged
Merged
Conversation
iio-sensor-proxy finds a buffered sensor through its trigger: it looks for "<name>-dev<id>" or "<name>-trigger", and without one it logs "Could not find trigger name associated with ..." and does not offer the sensor at all. The AOP accelerometer and gyroscope fill their buffers as the AOP reports, with no trigger, so on the J616s the accelerometer was missing from iio-sensor-proxy (HasAccelerometer false) and every boot logged that warning. Register a "<name>-dev<id>" trigger per device and make it the default, the way the HID sensor hub drivers do: the buffer is a triggered buffer whose poll function only stamps the time, and the report listener keeps pushing the scans. The trigger never fires. Only the device's own trigger is accepted. Add the IIO trigger headers to the Rust bindings and a helper for the inline iio_trigger_get(). Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Enabling a motion buffer hit WARN_ON_ONCE(IRQF_ONESHOT && !thread_fn) in __setup_irq(): the triggered buffer requests its poll function as a oneshot interrupt, and this one only had the time-stamping top half. Add a threaded half that completes the trigger. The trigger never fires, so it never runs. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iio-sensor-proxy finds a buffered IIO sensor through its trigger (
<name>-dev<id>or<name>-trigger). The AOP accelerometer and gyroscope fill their buffers from AOP reports with no trigger. On the J616s, iio-sensor-proxy logsCould not find trigger name associated with .../accel.1.auto/iio:device2every boot, and no trigger-based IIO client can use the buffer.This registers a
<name>-dev<id>trigger per device and makes it the default, the way the HID sensor hub drivers do. The buffer becomes a triggered buffer. Its poll function stamps the time and its threaded half only completes the trigger; the IRQ core warns about a oneshot poll function without one. The report listener keeps pushing the scans, and the trigger never fires.validate_trigger = iio_validate_own_triggerrefuses other triggers.It adds the IIO trigger headers to the Rust bindings and a helper for the inline
iio_trigger_get(). Kconfig now selectsIIO_TRIGGERED_BUFFER.Hardware test, J616s (7.3.0-aurora-motion1 = fleet17 2661d71 + these commits, tree identical to this branch; one-shot boot, fleet17 default untouched and restored after):
aop-sensors-accel-dev1andaop-sensors-gyro-devNexist and are the defaults. iio-sensor-proxy finds the accelerometer through its trigger and enables its buffer, and theCould not find trigger namewarning is gone. It then ignores the accelerometer by design, because the device labels itselfaccel-base; that's its policy for laptop-base accelerometers, so the display does not rotate.journalctl -b -p errempty.WARN_ON_ONCE(IRQF_ONESHOT && !thread_fn)when a buffer was enabled; the second commit fixes it, and the re-test above is with it.🤖 Generated with Claude Code