Skip to content

Commit 1759092

Browse files
qzedjwrdegoede
authored andcommitted
platform/surface: aggregator_registry: Add battery subsystem devices
Add battery subsystem (TC=0x02) devices (battery and AC) to the SSAM device registry. These devices need to be registered for 7th-generation Surface models. On 5th- and 6th-generation models, these devices are handled via the standard ACPI battery/AC interface, which in turn accesses the same SSAM interface via the Surface ACPI Notify (SAN) driver. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210212115439.1525216-4-luzmaximilian@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 797e785 commit 1759092

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

drivers/platform/surface/surface_aggregator_registry.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ static const struct software_node ssam_node_hub_base = {
4747
.parent = &ssam_node_root,
4848
};
4949

50+
/* AC adapter. */
51+
static const struct software_node ssam_node_bat_ac = {
52+
.name = "ssam:01:02:01:01:01",
53+
.parent = &ssam_node_root,
54+
};
55+
56+
/* Primary battery. */
57+
static const struct software_node ssam_node_bat_main = {
58+
.name = "ssam:01:02:01:01:00",
59+
.parent = &ssam_node_root,
60+
};
61+
62+
/* Secondary battery (Surface Book 3). */
63+
static const struct software_node ssam_node_bat_sb3base = {
64+
.name = "ssam:01:02:02:01:00",
65+
.parent = &ssam_node_hub_base,
66+
};
67+
5068
/* Devices for Surface Book 2. */
5169
static const struct software_node *ssam_node_group_sb2[] = {
5270
&ssam_node_root,
@@ -57,6 +75,9 @@ static const struct software_node *ssam_node_group_sb2[] = {
5775
static const struct software_node *ssam_node_group_sb3[] = {
5876
&ssam_node_root,
5977
&ssam_node_hub_base,
78+
&ssam_node_bat_ac,
79+
&ssam_node_bat_main,
80+
&ssam_node_bat_sb3base,
6081
NULL,
6182
};
6283

@@ -75,12 +96,16 @@ static const struct software_node *ssam_node_group_sl2[] = {
7596
/* Devices for Surface Laptop 3. */
7697
static const struct software_node *ssam_node_group_sl3[] = {
7798
&ssam_node_root,
99+
&ssam_node_bat_ac,
100+
&ssam_node_bat_main,
78101
NULL,
79102
};
80103

81104
/* Devices for Surface Laptop Go. */
82105
static const struct software_node *ssam_node_group_slg1[] = {
83106
&ssam_node_root,
107+
&ssam_node_bat_ac,
108+
&ssam_node_bat_main,
84109
NULL,
85110
};
86111

@@ -99,6 +124,8 @@ static const struct software_node *ssam_node_group_sp6[] = {
99124
/* Devices for Surface Pro 7. */
100125
static const struct software_node *ssam_node_group_sp7[] = {
101126
&ssam_node_root,
127+
&ssam_node_bat_ac,
128+
&ssam_node_bat_main,
102129
NULL,
103130
};
104131

0 commit comments

Comments
 (0)