Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Documentation/ABI/testing/sysfs-class-power-surface
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,108 @@ Description:

Valid values: In micro-Wh or micro-Ah, depending on the power unit
of the battery

What: /sys/class/power_supply/<supply_name>/dptf/max_platform_power_mw
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
Maximum peak power the battery can deliver, in mW (DPTF PMAX).

The embedded controller provides this value for platform power
management (DPTF) and updates it when the power source changes
and on resume from suspend.
The attribute is only present on devices whose embedded
controller is known to provide the data.

Access: Read

What: /sys/class/power_supply/<supply_name>/dptf/max_steady_state_power_mw
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
Maximum sustained power the battery can deliver, in mW (DPTF PBSS).

The embedded controller provides this value for platform power
management (DPTF) and updates it when the power source changes
and on resume from suspend.
The attribute is only present on devices whose embedded
controller is known to provide the data.

Access: Read

What: /sys/class/power_supply/<supply_name>/dptf/high_freq_impedance_mohm
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
High-frequency impedance of the battery, in mOhm (DPTF RBHF).

The embedded controller provides this value for platform power
management (DPTF) and updates it when the power source changes
and on resume from suspend.
The attribute is only present on devices whose embedded
controller is known to provide the data.

Access: Read

What: /sys/class/power_supply/<supply_name>/dptf/no_load_voltage_mv
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
No-load voltage of the battery, in mV (DPTF VBNL).

The embedded controller provides this value for platform power
management (DPTF) and updates it when the power source changes
and on resume from suspend.
The attribute is only present on devices whose embedded
controller is known to provide the data.

Access: Read

What: /sys/class/power_supply/<supply_name>/dptf/available_input_power_mw
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
Power available to the platform from the connected power sources,
in mW, as reported by the embedded controller.

The embedded controller provides this value for platform power
management (DPTF) and updates it when the power source changes
and on resume from suspend.
The attribute is only present on devices whose embedded
controller is known to provide the data.

Access: Read

What: /sys/class/power_supply/<supply_name>/dptf/rest_of_platform_power_mw
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
Power of the rest of the platform, in mW (DPTF PROP), as reported
by the embedded controller.

The embedded controller provides this value for platform power
management (DPTF) and updates it when the power source changes
and on resume from suspend.
The attribute is only present on devices whose embedded
controller is known to provide the data.

Access: Read

What: /sys/class/power_supply/<supply_name>/dptf/adapter_rating_mw
Date: November 2026
KernelVersion: 7.4
Contact: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
Description:
Power rating of the connected adapter, in mW (DPTF ARTG), as
reported by the embedded controller. Reading it fails with
ENODATA while no rating is known. The attribute is only present
on devices whose embedded controller is known to provide the
value.

Access: Read
119 changes: 92 additions & 27 deletions drivers/platform/surface/surface_aggregator_registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ static const struct software_node ssam_node_hub_base = {
.parent = &ssam_node_root,
};

/* Property of the battery and AC adapter devices of an EC with DPTF support. */
static const struct property_entry ssam_node_has_dptf[] = {
PROPERTY_ENTRY_BOOL("has_dptf"),
{ }
};

/* AC adapter. */
static const struct software_node ssam_node_bat_ac = {
.name = "ssam:01:02:01:01:01",
Expand All @@ -67,6 +73,25 @@ static const struct software_node ssam_node_bat_main = {
static const struct software_node ssam_node_bat_sb3base = {
.name = "ssam:01:02:02:01:00",
.parent = &ssam_node_hub_base,
.properties = ssam_node_has_dptf,
};

/*
* AC adapter and primary battery of devices whose EC answers the DPTF
* requests (battery data, adapter rating). Sending these requests to an EC
* that does not support them runs into a timeout, so the drivers only send
* them if the device has the "has_dptf" property.
*/
static const struct software_node ssam_node_bat_ac_dptf = {
.name = "ssam:01:02:01:01:01",
.parent = &ssam_node_root,
.properties = ssam_node_has_dptf,
};

static const struct software_node ssam_node_bat_main_dptf = {
.name = "ssam:01:02:01:01:00",
.parent = &ssam_node_root,
.properties = ssam_node_has_dptf,
};

/* Platform profile / performance-mode device without a fan. */
Expand Down Expand Up @@ -237,8 +262,8 @@ static const struct software_node *ssam_node_group_gen5[] = {
static const struct software_node *ssam_node_group_sb3[] = {
&ssam_node_root,
&ssam_node_hub_base,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_bat_sb3base,
&ssam_node_tmp_perf_profile,
&ssam_node_bas_dtx,
Expand All @@ -249,7 +274,7 @@ static const struct software_node *ssam_node_group_sb3[] = {
NULL,
};

/* Devices for Surface Laptop 3 and 4. */
/* Devices for Surface Laptop 3 (13", Intel), without DPTF. */
static const struct software_node *ssam_node_group_sl3[] = {
&ssam_node_root,
&ssam_node_bat_ac,
Expand All @@ -261,11 +286,23 @@ static const struct software_node *ssam_node_group_sl3[] = {
NULL,
};

/* Devices for Surface Laptop 3 (15", AMD) and 4 (13", Intel; 15", AMD), with DPTF. */
static const struct software_node *ssam_node_group_sl3_dptf[] = {
&ssam_node_root,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile,
&ssam_node_hid_main_keyboard,
&ssam_node_hid_main_touchpad,
&ssam_node_hid_main_iid5,
NULL,
};

/* Devices for Surface Laptop 5. */
static const struct software_node *ssam_node_group_sl5[] = {
&ssam_node_root,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile_with_fan,
&ssam_node_tmp_sensors,
&ssam_node_fan_speed,
Expand All @@ -279,8 +316,8 @@ static const struct software_node *ssam_node_group_sl5[] = {
/* Devices for Surface Laptop 6. */
static const struct software_node *ssam_node_group_sl6[] = {
&ssam_node_root,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile_with_fan,
&ssam_node_tmp_sensors,
&ssam_node_fan_speed,
Expand All @@ -305,8 +342,8 @@ static const struct software_node *ssam_node_group_sl7[] = {
/* Devices for Surface Laptop Studio 1. */
static const struct software_node *ssam_node_group_sls1[] = {
&ssam_node_root,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile,
&ssam_node_pos_tablet_switch,
&ssam_node_hid_sam_keyboard,
Expand All @@ -321,8 +358,8 @@ static const struct software_node *ssam_node_group_sls1[] = {
/* Devices for Surface Laptop Studio 2. */
static const struct software_node *ssam_node_group_sls2[] = {
&ssam_node_root,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile_with_fan,
&ssam_node_tmp_sensors,
&ssam_node_fan_speed,
Expand All @@ -337,13 +374,13 @@ static const struct software_node *ssam_node_group_sls2[] = {
/* Devices for Surface Laptop Go. */
static const struct software_node *ssam_node_group_slg1[] = {
&ssam_node_root,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile,
NULL,
};

/* Devices for Surface Pro 7 and Surface Pro 7+. */
/* Devices for Surface Pro 7, without DPTF. */
static const struct software_node *ssam_node_group_sp7[] = {
&ssam_node_root,
&ssam_node_bat_ac,
Expand All @@ -352,12 +389,21 @@ static const struct software_node *ssam_node_group_sp7[] = {
NULL,
};

/* Devices for Surface Pro 7+, with DPTF. */
static const struct software_node *ssam_node_group_sp7_dptf[] = {
&ssam_node_root,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile,
NULL,
};

/* Devices for Surface Pro 8 */
static const struct software_node *ssam_node_group_sp8[] = {
&ssam_node_root,
&ssam_node_hub_kip,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile,
&ssam_node_kip_tablet_switch,
&ssam_node_hid_kip_keyboard,
Expand All @@ -369,7 +415,7 @@ static const struct software_node *ssam_node_group_sp8[] = {
NULL,
};

/* Devices for Surface Pro 9, 10 and 11 (Intel/x86) */
/* Devices for Surface Pro 12 (Intel/x86), without DPTF. */
static const struct software_node *ssam_node_group_sp9[] = {
&ssam_node_root,
&ssam_node_hub_kip,
Expand All @@ -388,12 +434,31 @@ static const struct software_node *ssam_node_group_sp9[] = {
NULL,
};

/* Devices for Surface Pro 9, 10 and 11 (Intel/x86), with DPTF. */
static const struct software_node *ssam_node_group_sp9_dptf[] = {
&ssam_node_root,
&ssam_node_hub_kip,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_perf_profile_with_fan,
&ssam_node_tmp_sensors,
&ssam_node_fan_speed,
&ssam_node_pos_tablet_switch,
&ssam_node_hid_kip_keyboard,
&ssam_node_hid_kip_penstash,
&ssam_node_hid_kip_touchpad,
&ssam_node_hid_kip_fwupd,
&ssam_node_hid_sam_sensors,
&ssam_node_hid_sam_ucm_ucsi,
NULL,
};

/* Devices for Surface Pro 9 5G (ARM/QCOM) */
static const struct software_node *ssam_node_group_sp9_5g[] = {
&ssam_node_root,
&ssam_node_hub_kip,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_sensors,
&ssam_node_hid_kip_keyboard,
&ssam_node_hid_kip_penstash,
Expand All @@ -408,8 +473,8 @@ static const struct software_node *ssam_node_group_sp9_5g[] = {
static const struct software_node *ssam_node_group_sp11[] = {
&ssam_node_root,
&ssam_node_hub_kip,
&ssam_node_bat_ac,
&ssam_node_bat_main,
&ssam_node_bat_ac_dptf,
&ssam_node_bat_main_dptf,
&ssam_node_tmp_sensors,
&ssam_node_hid_kip_keyboard,
&ssam_node_hid_kip_penstash,
Expand Down Expand Up @@ -446,19 +511,19 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
{ "MSHW0116", (unsigned long)ssam_node_group_sp7 },

/* Surface Pro 7+ */
{ "MSHW0119", (unsigned long)ssam_node_group_sp7 },
{ "MSHW0119", (unsigned long)ssam_node_group_sp7_dptf },

/* Surface Pro 8 */
{ "MSHW0263", (unsigned long)ssam_node_group_sp8 },

/* Surface Pro 9 */
{ "MSHW0343", (unsigned long)ssam_node_group_sp9 },
{ "MSHW0343", (unsigned long)ssam_node_group_sp9_dptf },

/* Surface Pro 10 */
{ "MSHW0510", (unsigned long)ssam_node_group_sp9 },
{ "MSHW0510", (unsigned long)ssam_node_group_sp9_dptf },

/* Surface Pro 11 */
{ "MSHW0583", (unsigned long)ssam_node_group_sp9 },
{ "MSHW0583", (unsigned long)ssam_node_group_sp9_dptf },

/* Surface Pro 12 (Intel) */
{ "MSHW0743", (unsigned long)ssam_node_group_sp9 },
Expand All @@ -479,10 +544,10 @@ static const struct acpi_device_id ssam_platform_hub_acpi_match[] = {
{ "MSHW0114", (unsigned long)ssam_node_group_sl3 },

/* Surface Laptop 3 (15", AMD) and 4 (15", AMD) */
{ "MSHW0110", (unsigned long)ssam_node_group_sl3 },
{ "MSHW0110", (unsigned long)ssam_node_group_sl3_dptf },

/* Surface Laptop 4 (13", Intel) */
{ "MSHW0250", (unsigned long)ssam_node_group_sl3 },
{ "MSHW0250", (unsigned long)ssam_node_group_sl3_dptf },

/* Surface Laptop 5 */
{ "MSHW0350", (unsigned long)ssam_node_group_sl5 },
Expand Down
Loading