SM8550: add AYANEO Pocket EVO eight-zone RGB and effect support - #3248
SM8550: add AYANEO Pocket EVO eight-zone RGB and effect support#3248mrdidit wants to merge 1 commit into
Conversation
|
I like the idea to expose the leds via a driver, but my issue with that is that it will be impossible to send frames to configure the gamepad mode... |
4d37950 to
2e5a9d1
Compare
|
Glad you like the idea. You’re right that once serdev owns the UART, /dev/ttyHS0 can’t be written directly anymore. For the Pocket EVO, I kept the existing gamepad setup inside the driver: the boot quirk writes xbox360 to gamepad_mode, and the driver sends the same binary and ASCII frames with the original 100 ms gaps, serialized with the RGB traffic. It also restores the mode after a real resume. |
|
Rebuilt and tested on the Pocket EVO. The driver registered cleanly, the boot quirk reported xbox360, and Gamepad Tester confirmed working input with the correct Xbox button layout. No related UART or driver errors appeared in dmesg. |
|
ok, then a couple of changes, give a more generic name, like "ayaneo,serial-mcu" (I think it could work on other ayaneo) |
|
and why "joystick-backlight-left-270" ? |
|
Thanks loki, The requested changes:
Rebuilt and tested on the Pocket EVO:
|
2e5a9d1 to
80c4894
Compare
| # | ||
| # RGB LED drivers | ||
| # | ||
| CONFIG_LEDS_AYANEO_POCKET_EVO=y |
| the device-wide green and blue percentages without corrupting semantic | ||
| caches. | ||
| --- | ||
| .../sysfs-driver-ayaneo-pocket-evo-rgb | 128 ++ |
There was a problem hiding this comment.
rename all ayaneo-pocket-evo-rgb to /ayaneo-serial-mcu
| @@ -0,0 +1,241 @@ | |||
| # AYANEO Pocket EVO RGB control | |||
|
@mrdidit it's a better implementation for the xbox mode and button layout. it also make sure the MCU is alive ignore the inputplumber changes, but check the dts changes for the other devices ACE/DMG (you can let out the SM8650 changes for now) |
|
Yep, I can merge the controller side into the current LED work. I’ll also complete the generic naming requested earlier: CONFIG_AYANEO_SERIAL_MCU, ayaneo-serial-mcu.c, and “AYANEO Serial MCU control”. The Pocket EVO RGB implementation will remain an explicitly gated device capability, not something exposed on every AYANEO MCU. AYANEO Serial MCU driver The common Device Tree node applies only to AYANEO Pocket devices inheriting qcs8550-ayaneo-pocket-common.dtsi; it does not affect other SM8550 manufacturers or devices. One thing I want to confirm before I start: moving the MCU node into the AYANEO common DTS means serdev owns the UART on all those devices. ACE has no RGB as far as I know, so there should be nothing to migrate there. DMG currently uses /dev/ttyHS0 for its Static RGB helper, and that path disappears once serdev owns the port. I have both an ACE and a DMG available, so I can hardware-validate the controller mode and button layout on both, as well as the DMG RGB path, before pushing anything. |
|
let's ignore the Pcoket DMG leds stuff (don't think nobody really own a Pocket DMG), but you are right to push back on the InputPlumber. |
|
I think Pocket S/ Pocket S 2K also have the led stuff... it's difficult to know if they have the same protocol... So I'm not really sure how to proceed. I'm in favor let's change and see whose complaining... It's not a critical feature, worst case: leds don't work... |
|
I have a DMG, so I traced stock GameWindow on Android and checked the command construction in its APK. This fills in the unresolved DMG part of my previous comment without changing the generic driver structure.
The current DMG helper does not match the present stock Android implementation: it uses 58 02, fixes 86 at ff, and sends one copy, while stock uses 58 08, writes brightness to both 86 and 87, and sends three copies. Since serdev ownership removes the raw /dev/ttyHS0 path, I’d rather migrate the DMG’s validated Static support than leave it broken. I can test the complete implementation on the hardware before pushing it. Also, was Pocket S2 left out only because this PR is currently scoped to SM8550? I implemented its working ROCKNIX RGB support a few weeks ago, and it uses the same 58 08 broadcast frame family. I’m fine leaving the actual SM8650 DTS and userspace migration for a follow-up, but the generic driver and variant model should be able to support it without another redesign. The resulting structure would remain:
|
|
sounds good, I'll check Pocket S2 after this |
|
@loki666 one process question. The current AGENTS.md says not to carry direct kernel patches and to pull upstream sources dynamically. This PR carries the AYANEO serial-MCU driver as an SM8550 kernel patch, following the implementation requested in review. Is that approach acceptable here, or should the driver live elsewhere and be pulled in? |
|
AYANEO serial-MCU driver is not an upstream patch, and never will |
Summary
Implement eight-zone analogue-stick RGB control for the AYANEO Pocket EVO
through its serial MCU UART protocol.
This adds:
ayaneo,serial-mcucompatibleayaneo,xbox360-modeproperty for board-specific controller setupTesting
Hardware tested on an AYANEO Pocket EVO:
ayaneo-serial-mcuwith ABI version 3ayaneo,xbox360-modeenabled the board-specific controller bootstrapgamepad_modesysfs control and userspace boot writer were removedleft-zone-270 left-zone-0 left-zone-90 left-zone-180 right-zone-270 right-zone-0 right-zone-90 right-zone-1804.0–4.2 seconds
40/350/40/350/350 mspassed repeated testsrejected
15 20, raw100 100, zero-channel, and invalid calibration writeswere tested
preserving semantic readback
without restarting
independently to both physical sticks
effect, and calibration
related UART, restore, effect, or locking errors
W=1without warningsAdditional Context
driver is its only owner.
ayaneo,serial-mcuname.ayaneo,xbox360-mode.resume only when that property is present.
writer.
unchanged.
without changing existing EmulationStation behaviour.
The 3.87 seconds of programmed guard delay applies only to genuinely mixed
per-quadrant eight-zone Static transactions. Hardware testing observed complete
writes around 4.0–4.2 seconds, with the first frame visible immediately.
Matching-ring and independent per-stick Static layouts use faster
broadcast/per-ring paths. Breath, RGB Breath, Rainbow, and Reactive use
separate effect paths and apply almost instantly.
The
calibrationattribute allows applications or scripts to persist andrestore a user-selected green/blue pair:
15 20: hardware-tested Pocket EVO default/reset100 100: raw RGB outputRequested RGB values remain unchanged in layout and effect readback.
Calibration applies to mixed-red colours used by Static, single-colour Breath,
and Reactive. Pure red, green, blue, and cyan remain raw. RGB Breath and Rainbow
retain their captured hardware behaviour and are not recalculated when
calibration changes.
At the absolute minimum of the single-colour Breath curve, calibrated orange
can briefly appear green. The remainder of the cycle is correct. This is a
possible future brightness-dependent calibration improvement and does not
affect Static, RGB Breath, Rainbow, or Reactive operation.
The generic fake-suspend change only supplies a scoped suspend/resume phase to
the device LED helper. Other LED calls retain their existing behaviour.
Manual command usage
The device-wide ABI lives on the parent serial device. The direct Pocket EVO
path is:
Applications should discover the bound device rather than hard-code its bus
name:
Inspect the interface and current state:
Set device-wide calibration:
Applications or scripts can persist a user's custom pair and restore it after
boot. Invalid values are rejected without replacing the active calibration.
The existing helper provides matching or independent per-stick Static control.
Its argument order is brightness, right RGB, then left RGB:
That example makes the right ring blue and the left ring red at brightness 180.
The four-value compatibility form applies one colour to both rings:
A complete eight-zone layout contains one
R G B brightnessgroup for eachzone in the order reported by
zone_index. This example makes the left ringred at brightness 128 and the right ring blue at brightness 255:
Select device-wide effects:
Reactive arguments are brightness, idle RGB, then active RGB. The example uses
calibrated orange while idle and blue during stick movement.
Blank and restore output without replacing the retained layout, effect, or
calibration:
These sysfs writes require the normal privileged access used by ROCKNIX
services.
AI Usage
While ROCKNIX doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? YES