Skip to content

Initial commit of LedsValve.p, LED driver for Valve Steam Machine - #87

Open
CalcProgrammer1 wants to merge 3 commits into
namazso:mainfrom
CalcProgrammer1:leds-valve
Open

Initial commit of LedsValve.p, LED driver for Valve Steam Machine#87
CalcProgrammer1 wants to merge 3 commits into
namazso:mainfrom
CalcProgrammer1:leds-valve

Conversation

@CalcProgrammer1

@CalcProgrammer1 CalcProgrammer1 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Still needs some work, but this was a quick port from the leds-valve.c Linux driver. It compiles and I have successfully used it to control the Valve Steam Machine with OpenRGB to the same level of functionality my Linux implementation has (direct control over independent LEDs, selecting built in effects, adjusting speed of built in effects, and adjusting brightness). Does not perform DMI verification of the vendor/product like the leds-valve.c driver does as PawnIO does not support DMI, so I'm doing that verification on the OpenRGB side before loading this module. Not all ioctls have been tested yet.

Implements #86

OpenRGB side changes: https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/3439

@CalcProgrammer1 CalcProgrammer1 changed the title Draft: Initial commit of leds-valve.p, LED driver for Valve Steam Machine Initial commit of leds-valve.p, LED driver for Valve Steam Machine Jul 30, 2026
@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

I've done some code cleanup and now I think it's ready for review.

One thing I'm still deciding on is whether to pass the RGB values in 3 separate Pawn cells or combine them into a single cell, it might be more efficient to do single cell and if I match the 0x00BBGGRR format that simplifies the OpenRGB side as that is the format our RGBColor type uses.

I renamed it from leds-valve.p to LedsValve.p to match the other module naming conventions. The ioctls implemented line up with the leds-valve.c sysfs entries in /sys/class/leds/valve-led[0-16] on Linux with the addition of ioctl_init for initializing the module.

@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

Another thing I am thinking of adding is an ioctl_get_led_count or something along those lines, as in the Linux implementation you can count the number of /sys/class/leds/valve-led[X] entries to determine LED count but here this method is not available.

@namazso have any thoughts on this MR? Ideally these ioctls, at least the ones from the common Linux framework, could be reused on other Linux multi-LED/RGB driver ports in the future.

@namazso

namazso commented Aug 9, 2026

Copy link
Copy Markdown
Owner

I just pushed a new "registry" branch, could you try using it to check baseboard vendor? \Registry\Machine\HARDWARE\DESCRIPTION\System\BIOS should contain various keys from SMBIOS.

@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

I'll look into testing the registry check this week.

@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

Implemented the registry check and verified on the Steam Machine. I moved the registry.inc file into the includes folder to get it to compile properly. I also had to write a string comparison function locally to compare the strings, that might be a good candidate to move to an include file (unless there's already a string compare function I am missing that I could use instead).

@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

Updated the merge request to add the registry check within the PawnIO module using your new registry include file. Confirmed that it works and intentionally corrupted the strings it checks the two parameters against to force it to fail and confirm it does not load even if OpenRGB attempts to load it.

@CalcProgrammer1 CalcProgrammer1 changed the title Initial commit of leds-valve.p, LED driver for Valve Steam Machine Initial commit of LedsValve.p, LED driver for Valve Steam Machine Aug 11, 2026
@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

Ready for review/merge. I cleaned up the registry info check (the original check I had would allow incorrect pairings OEM:Fremont and Valve:F7F where the Linux driver would not). I added functions for getting the number of LEDS and number of components for each LED, which could be useful if we reuse the same ioctls for future Linux-ported multi_intensity LED drivers. Verified latest build on hardware including the new ioctls.

@CalcProgrammer1

Copy link
Copy Markdown
Contributor Author

Removed all internal state tracking/global variables. Replaced with register reads where appropriate.

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