Skip to content

Support for Thermal Subsystem #59

@qzed

Description

@qzed

The thermal subsystem (TMP) currently lacks a driver for 7th and later generation models. This should be a SSAM client device driver and needs devices to be added to the registry (e.g. IDs ssam:01:03:<TID>:<IID>:<FUN>).

Since we can actually detect which sensor instances are available, there should probably be a thermal hub device managing (i.e. instantiating) individual sensor devices. It seems that there's also the possibility for having different target IDs ('TID') so it might be a good idea to have one hub per target ID. Hubs and sensor devices can be separated by function ID (FUN), e.g. hub has FUN=0 and sensor FUN=1.

There is some functionality to set sensor trip points, implementing this should also considered but might be something for a later time. First priority should be getting the values to sysfs in a format that e.g. thermald can read. Gen7 devices do have a DPTF config which seems to depend on those sensors, so we'll have to figure out what it expects and how to make that compatible, ideally so that thermald can automatically use that config, which should then result in behavior similar to Windows.

On the gen5 devices, these sensors have some ID string embedded in ACPI, which gives an indication what it is used for. Ideally we'd find a mapping for those on the gen7 devices as well. This might be encoded in the Windows driver, so might need some reverse engineering.

A list of currently known commands and events is provided here:

List of Thermal Subsystem Requests (TC = 0x03)
--------------------------------------------------------------------------------
CID IID TID Payload Response Name/Function Source
------------------------------------------------------------------------
0x01 #SEN 0x01 no yes ACPI/_TMP dsdt
0x02 0x00 0x01 no yes Get performance mode log
0x03 0x00 0x01 yes no Set performance mode log
0x04 0x00 0x01 no yes Get available sensors dsdt
0x09 #SEN 0x01 yes yes Set sensor trip point dsdt
Note: CID 0x09 is an Intel DPTF command.
List of Thermal Subsystem Events (TC = 0x03)
--------------------------------------------------------------------------------
CID IID TID Payload Name/Function Source
------------------------------------------------------------------------
0x0b #SEN 0x01 ? Notify sensor trip-point log+dsdt

See https://www.kernel.org/doc/html/latest/driver-api/surface_aggregator/client.html#adding-ssam-devices for documentation on client devices and drivers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: missing featureMissing feature that is confirmed working on Windows using the Surface Serial Hub (EC) device.D: Book 3Device: Surface Book 3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions