Repository navigation
Conversation
…eed for Surface Laptop Go The Surface Laptop Go EC provides the same thermal sensor and fan speed interfaces as newer Surface models, but ssam_node_group_slg1 does not register them yet. Add both nodes so that surface_temp and surface_fan can bind. On the Surface Laptop Go 1, the separate fan profile command has no effect, so keep ssam_node_tmp_perf_profile without the has_fan property. ssam_node_group_slg1 is shared by the Surface Laptop Go 1, 2, and 3. This change has only been tested on a Surface Laptop Go 1, where surface_temp exposes the 11 EC thermal channels and surface_fan reports the fan speed; the Go 2 and Go 3 have not been tested on hardware. Signed-off-by: Yuchao Tang <neveltyc@gmail.com>
The SAM thermal subsystem supports applying a temperature offset via command 0x24. On Windows, the Surface Management Framework uses this command on sensor 9, which corresponds to the virtual sensor I_VTS1 that drives the EC fan curve. Command 0x24 takes a 5-byte payload containing the 1-based sensor index followed by a 32-bit IEEE 754 float offset in degrees Celsius, and has no response. Consequently, writes appear to succeed even on models or channels where the EC does not implement the command. Expose this command as the hwmon temp9_offset attribute in millidegrees Celsius, gated by the has_offset device property so it is only created on verified devices. Clamp the written value to +/- 5000 millidegrees Celsius and reset the EC offset to 0 at probe, driver removal, and system shutdown so the cached value and EC RAM stay in sync. Tested on a Surface Laptop Go 1, where writing to temp9_offset shifts temp9_input by the requested amount on the next EC update tick and adjusts the fan speed accordingly. Link: linux-surface/linux-surface#2383 Signed-off-by: Yuchao Tang <neveltyc@gmail.com>
…e Laptop Go 1 Add a thermal sensor software node with the has_offset property and use it for the Surface Laptop Go 1, where sensor 9 offset writes via command 0x24 have been verified on hardware. Split ssam_node_group_slg2 out from ssam_node_group_slg1 so that the Surface Laptop Go 2 and 3 keep the regular thermal sensor node until offset support is tested on them. Link: linux-surface/linux-surface#2383 Signed-off-by: Yuchao Tang <neveltyc@gmail.com>
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.
Based on #198.
This PR exposes the EC sensor offset command
TMP 0x24for sensor 9 throughsurface_tempand enables it on the Surface Laptop Go 1.1.
hwmon: surface_temp: Expose sensor 9 offset via HWMON_T_OFFSETI_VTS1on channel 9. On Windows, the Surface Management Framework adjustsI_VTS1by writing a temperature offset viaTMPcommand0x24. Without a driver interface, user-space thermal control has to send raw packets through/dev/surface/aggregatoras root.TMPcommand0x24on channel 9 as the standard hwmontemp9_offsetattribute in millidegrees Celsius, gated by thehas_offsetdevice property.±5000millidegrees Celsius, and reset the EC offset to0at probe, driver removal, and system shutdown so that the cached value and EC RAM stay in sync.2.
platform/surface: aggregator_registry: Enable sensor offset on Surface Laptop Go 1TMPcommand0x24has no response, and firmware support varies across Surface models.ssam_node_group_slg1is shared by the Surface Laptop Go 1, 2, and 3, while offset writes have only been tested on the Surface Laptop Go 1.ssam_node_tmp_sensors_with_offsetwith thehas_offsetproperty forssam_node_group_slg1, and splitssam_node_group_slg2out for the Surface Laptop Go 2 and 3 so they keep the read-only sensor node until tested on hardware.Testing
Tested on a Surface Laptop Go 1 with ACPI ID
MSHW0118and SAM firmware7.100.139:temp9_offsetis created under thesurface_thermalhwmon device.±5000millidegrees Celsius are clamped to±5000.temp9_offsetshiftstemp9_inputby the requested amount on the next 5-second EC tick and adjusts the fan speed accordingly.0.