Conversation
Fan control for Lenovo Yoga laptops that expose the EC mailbox at IO 0x5C0/0x5C4 (DSDT method MBEY). Verified on a Yoga Pro 9 16IMH9 (83DN), BIOS NKCN35WW. The Lenovo WMI classes (LENOVO_FAN_METHOD, LENOVO_GAMEZONE_DATA) are present in the MOF on these machines but have no instances, so the mailbox is the only interface available. Replaces WinRing0 usage in existing Yoga fan control tools. Only command 0xEF is accepted and both ports are fixed, so no general purpose port IO is exposed. The full mailbox handshake runs in the module, which keeps the user mode side to one ioctl per operation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hPSWGJHRXbqXYFhoWe5Et
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.
Adds a module for Lenovo Yoga laptops that expose the EC fan mailbox at IO ports 0x5C0/0x5C4.
Hardware
Verified on a Yoga Pro 9 16IMH9 (83DN), BIOS NKCN35WW, Core Ultra 9 185H.
The mailbox is declared in the DSDT:
Reply is 0xAC on success, 0xFA if unsupported. Probing sub 0x63 with args 0x00-0x13 shows only 0x01-0x03 are implemented; there are no temperature sensors behind this mailbox.
Why this is needed
LENOVO_FAN_METHODandLENOVO_GAMEZONE_DATAexist in the MOF on these machines but have no instances - Lenovo ships the Legion MOF on Yoga without implementing the ACPI methods - so LenovoLegionToolkit and similar tools do not work here. The mailbox is the only interface available.Existing Yoga fan control tools drive it through WinRing0, which is what this module is meant to replace.
The firmware fan curve is the practical motivation: under an all-core load it holds the fans at 26% with the package at 78-81 C. Forcing 45% drops the package about 4 C and the hottest core about 8 C within 20 seconds.
Scope
Command is fixed at 0xEF and both ports are hardcoded, so no general purpose port IO is exposed. Subcommand and argument are validated. The whole handshake runs inside the module, which also keeps the user mode side to a single ioctl per operation instead of roughly ten port accesses.
Compiles clean with
pawncc LenovoYogaEC.p -iinclude -C64 -;+ -(+ -p.Note on testing
The ioctl path could not be exercised end to end, because the official signed driver only loads modules signed by the project. The protocol itself is the one in use on this machine through WinRing0, byte for byte, and is confirmed working there.
🤖 Generated with Claude Code
https://claude.ai/code/session_014hPSWGJHRXbqXYFhoWe5Et