Devlog · 17 November 2026

One gamepad, finally.

The previous entry ended with a userspace keyboard bridge. It worked, but every layer above it inherited the same assumption: the stick and the buttons are two devices. This entry is about removing that assumption one layer down — in the kernel — and the two traps that made it take longer than the port itself.
The R36S held in hand, screen showing a Flash game menu
The test unit. After the change, EmulationStation and RetroArch see one gamepad instead of a stick device and a key device.

What we ported

Arch R — a maintained Arch Linux build for the same hardware — carries a kernel driver called odroidgo3-joypad. It owns both the ADC stick (through an analog multiplexer) and the GPIO buttons, and registers them as a single input device. It is GPL-2.0, and its device tree node shows exactly how the board is wired.

We ported that driver to our Debian 13 + mainline 6.12 kernel. Two public APIs it relied on no longer exist in 6.12: input-polldev was removed in favour of input_setup_polling(), and the legacy GPIO helpers (of_get_named_gpio_flags) are gone, so the driver now reads the GPIO specifier flags itself. The input core’s open/closecallback signatures also changed.

On the device-tree side we switched the existing gamepad node’scompatible to odroidgo3-joypad, added the mux pins and the ADC channel, and deleted the old adc-joystick and mux nodes so nothing is reported twice. The button pins and key codes are ours, taken from the vendor device tree we had already verified — we did not copy another board’s button table.

Trap one: the node was still called `gpio-keys`

The driver compiled and was built in, but it never probed. The reason is subtle: the platform bus falls back to matching a driver and a device by name. Our device tree node was still named gpio-keys, which is also the name of the kernel’s generic GPIO key driver — registered much earlier in boot. It claimed the device before our driver was even registered.

Renaming the node to gamepad fixed it: now the only match is thecompatible string, and the device comes up asr36s_Gamepad on every boot.

Trap two: the old config was silently wrong

With the driver working, EmulationStation responded to the stick and buttons — but games did not, and pressing X opened the RetroArch menu. The cause was the inherited ArkOS retroarch.cfg: every gamepad binding for player one was set to nul, and the menu-toggle button was bound to button index 2 — which is X on this pad.

We replaced the bindings with explicit indices for the RetroArch udev joypad driver (B=0, A=1, X=2, Y=3, Select=8, Start=9, FN=10, D-pad 13–16), moved the menu to FN, and enabled analog_dpad_mode so the stick also works as a d-pad. The keyboard bridge and its service are now retired.

The Flash game mapping screen on the handheld, with a per-game profile
Per-game mapping: a small setup UI saves a profile next to the game, so a Flash title can use its own keys without files being copied by hand.

Where Flash stands

The reason all of this matters is the goal: running 4399-style Flash games natively on the device through Ruffle. With one standard gamepad, the runtime and the mapping layer no longer fight the kernel.

Current state, stated conservatively: twenty test SWFs launch and survive twenty seconds with no OOM and no kernel panic. Mouse click now works through an injected mapping layer. Bleach vs Naruto reaches character select and actual combat, with health bars and hit feedback, on the handheld — a 120-second recording, not a stability claim. We have not verified long sessions, saves across reboots, or every title.

Bleach vs Naruto running in combat on the R36S screen
Bleach vs Naruto in combat on the unit. The controls are the merged gamepad; the game itself is executed by the Ruffle runtime.
The Flash game category in EmulationStation on the handheld
The Flash category on the device: 25 test titles under one system entry, launched by the Ruffle runtime rather than an emulator core.

What is still not proven

Input is solved for the applications we tested. What remains is content: which Flash titles are actually playable end to end, which need per-game mapping, and which depend on servers that no longer exist. Those are product questions, not kernel ones — and they are the next thing we measure.

If you want the technical trail: the patches, device tree and the failure notes are in the input write-up and the repository.