Skip to content

SM8750: AYN Odin 3 - expose the two back paddles as gpio-keys#2940

Open
aanze wants to merge 1 commit into
ROCKNIX:nextfrom
aanze:odin3-back-paddles-gpio-keys
Open

SM8750: AYN Odin 3 - expose the two back paddles as gpio-keys#2940
aanze wants to merge 1 commit into
ROCKNIX:nextfrom
aanze:odin3-back-paddles-gpio-keys

Conversation

@aanze

@aanze aanze commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Goal: Make the AYN Odin 3's two back paddles (M1, M2) work. On stock ROCKNIX they emit nothing because there is no driver for them. This adds a gpio-keys node to the Odin 3 dts so they report buttons.
  • They are not on the gamepad MCU UART (rsinput) and not ADC despite AYN's Android adckey/keydetect.ko naming — they are plain active-low SoC TLMM GPIOs: M1 (left) = GPIO 3 → BTN_Z, M2 (right) = GPIO 7 → BTN_C (TLMM base 512 + offsets 3/7, RE'd from AYN's keydetect.ko).
  • BTN_Z/BTN_C are what AYN's firmware uses and what the existing ayn_mcu.yaml already maps to Left/RightPaddle1, so no InputPlumber change is needed.

Testing

  • Built and flashed on an AYN Odin 3.
  • Both paddles produce clean press/release (evtest) with no chatter; left → BTN_Z, right → BTN_C. Pins verified UNCLAIMED before use.

Additional Context

  • Single additive patch, Odin 3 only — no other device affected.
  • Pins referenced by TLMM offset (<&tlmm 3>, <&tlmm 7>), input + pull-up, 15ms debounce.

AI Usage

Did you use AI tools to help write this code? PARTIALLY — reverse-engineering and patch authoring assisted by AI; hardware findings verified on-device.

The Odin 3's two back "macro" paddles (M1, M2) do nothing on
stock ROCKNIX because there is no driver for them. They are not
on the gamepad MCU UART (rsinput) and not ADC despite AYN's
Android "adckey"/keydetect.ko naming - they are plain active-low
SoC TLMM GPIOs (M1 = GPIO 3, M2 = GPIO 7), reverse-engineered
from AYN's Android keydetect.ko (gpio_request 515/519 = TLMM
base 512 + offsets 3/7).

Add a gpio-keys node to the Odin 3 dts exposing them as BTN_Z
(M1, left) and BTN_C (M2, right) - the spare gamepad codes AYN's
own firmware uses and which the existing InputPlumber map
(ayn_mcu.yaml) already routes to Left/RightPaddle1, so they
become usable paddle buttons in games and Steam.
@aanze aanze force-pushed the odin3-back-paddles-gpio-keys branch from f093e17 to aa0c8d8 Compare June 28, 2026 14:04

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, could you merge this with 0047-arm64-dts-qcom-Add-AYN-Odin3.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants