aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/surface
diff options
context:
space:
mode:
authorMaximilian Luz <luzmaximilian@gmail.com>2021-02-12 12:54:36 +0100
committerHans de Goede <hdegoede@redhat.com>2021-03-06 10:23:26 +0100
commit17590927f7684b297a64ac64b332dd589d64d5a5 (patch)
treebc46b7b8b1972fd7444877d55415abc862215a65 /drivers/platform/surface
parentplatform/surface: aggregator_registry: Add base device hub (diff)
downloadlinux-dev-17590927f7684b297a64ac64b332dd589d64d5a5.tar.xz
linux-dev-17590927f7684b297a64ac64b332dd589d64d5a5.zip
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>
Diffstat (limited to 'drivers/platform/surface')
-rw-r--r--drivers/platform/surface/surface_aggregator_registry.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
index 6c23d75a044c..cde279692842 100644
--- a/drivers/platform/surface/surface_aggregator_registry.c
+++ b/drivers/platform/surface/surface_aggregator_registry.c
@@ -47,6 +47,24 @@ static const struct software_node ssam_node_hub_base = {
.parent = &ssam_node_root,
};
+/* AC adapter. */
+static const struct software_node ssam_node_bat_ac = {
+ .name = "ssam:01:02:01:01:01",
+ .parent = &ssam_node_root,
+};
+
+/* Primary battery. */
+static const struct software_node ssam_node_bat_main = {
+ .name = "ssam:01:02:01:01:00",
+ .parent = &ssam_node_root,
+};
+
+/* Secondary battery (Surface Book 3). */
+static const struct software_node ssam_node_bat_sb3base = {
+ .name = "ssam:01:02:02:01:00",
+ .parent = &ssam_node_hub_base,
+};
+
/* Devices for Surface Book 2. */
static const struct software_node *ssam_node_group_sb2[] = {
&ssam_node_root,
@@ -57,6 +75,9 @@ static const struct software_node *ssam_node_group_sb2[] = {
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_sb3base,
NULL,
};
@@ -75,12 +96,16 @@ static const struct software_node *ssam_node_group_sl2[] = {
/* Devices for Surface Laptop 3. */
static const struct software_node *ssam_node_group_sl3[] = {
&ssam_node_root,
+ &ssam_node_bat_ac,
+ &ssam_node_bat_main,
NULL,
};
/* 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,
NULL,
};
@@ -99,6 +124,8 @@ static const struct software_node *ssam_node_group_sp6[] = {
/* Devices for Surface Pro 7. */
static const struct software_node *ssam_node_group_sp7[] = {
&ssam_node_root,
+ &ssam_node_bat_ac,
+ &ssam_node_bat_main,
NULL,
};