Skip to content

Commit 44e223b

Browse files
committed
registry: Use KIP hub for Surface Book 3 base devices
It turns out that the Surface Book 3 manages the devices contained in its detachable base via the KIP hub as well, similarly to the Surface Pro 8 and Surface Pro X. So move them over to the KIP hub. Right now, we (mis-)use the detachment subsystem (DTX), which is designed for handling detachment requests and physical locking of the base, to properly remove and re-attach Surface System Aggregator Module (SSAM) client devices contained in the base. This system does not seem to be intended for managing the (sub-)devices contained in the base, which may need some time to be set up properly. The KIP subsystem seems to be the intended subsystem for managing those devices, thus let's use that one instead. Note that this also changes the way in which devices on the Surface Book 3 are removed when they have been detached, specifically from normal removal to hot-removal (avoiding further communication with the embedded controller). It seems that the "communication timeout after device removal" issue does also occur on the Surface Book 3, but has so far been missed as it does not happen reliably every time. Switching to hot-removal fixes this issue and should not have any noticable drawbacks. Signed-off-by: Maximilian Luz <[email protected]>
1 parent c59436f commit 44e223b

File tree

1 file changed

+16
-40
lines changed

1 file changed

+16
-40
lines changed

module/src/clients/surface_aggregator_registry.c

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ static const struct software_node ssam_node_root = {
4141
.name = "ssam_platform_hub",
4242
};
4343

44-
/* Base device hub (devices attached to Surface Book 3 base). */
45-
static const struct software_node ssam_node_hub_base = {
46-
.name = "ssam:00:00:02:00:00",
47-
.parent = &ssam_node_root,
48-
};
49-
50-
/* KIP device hub (connects keyboard cover devices on Surface Pro 8). */
44+
/* KIP device hub (connects detachable keyboard/touchpad on Surface Pro 8 and Book 3). */
5145
static const struct software_node ssam_node_hub_kip = {
5246
.name = "ssam:01:0e:01:00:00",
5347
.parent = &ssam_node_root,
@@ -65,10 +59,10 @@ static const struct software_node ssam_node_bat_main = {
6559
.parent = &ssam_node_root,
6660
};
6761

68-
/* Secondary battery (Surface Book 3). */
69-
static const struct software_node ssam_node_bat_sb3base = {
62+
/* Secondary battery (Surface Book 3, managed via KIP hub). */
63+
static const struct software_node ssam_node_bat_kip = {
7064
.name = "ssam:01:02:02:01:00",
71-
.parent = &ssam_node_hub_base,
65+
.parent = &ssam_node_hub_kip,
7266
};
7367

7468
/* Platform profile / performance-mode device. */
@@ -143,30 +137,6 @@ static const struct software_node ssam_node_hid_main_iid5 = {
143137
.parent = &ssam_node_root,
144138
};
145139

146-
/* HID keyboard (base hub). */
147-
static const struct software_node ssam_node_hid_base_keyboard = {
148-
.name = "ssam:01:15:02:01:00",
149-
.parent = &ssam_node_hub_base,
150-
};
151-
152-
/* HID touchpad (base hub). */
153-
static const struct software_node ssam_node_hid_base_touchpad = {
154-
.name = "ssam:01:15:02:03:00",
155-
.parent = &ssam_node_hub_base,
156-
};
157-
158-
/* HID device instance 5 (unknown HID device, base hub). */
159-
static const struct software_node ssam_node_hid_base_iid5 = {
160-
.name = "ssam:01:15:02:05:00",
161-
.parent = &ssam_node_hub_base,
162-
};
163-
164-
/* HID device instance 6 (unknown HID device, base hub). */
165-
static const struct software_node ssam_node_hid_base_iid6 = {
166-
.name = "ssam:01:15:02:06:00",
167-
.parent = &ssam_node_hub_base,
168-
};
169-
170140
/* HID keyboard (KIP hub). */
171141
static const struct software_node ssam_node_hid_kip_keyboard = {
172142
.name = "ssam:01:15:02:01:00",
@@ -191,6 +161,12 @@ static const struct software_node ssam_node_hid_kip_iid5 = {
191161
.parent = &ssam_node_hub_kip,
192162
};
193163

164+
/* HID device instance 6 (KIP hub, unknown HID device). */
165+
static const struct software_node ssam_node_hid_kip_iid6 = {
166+
.name = "ssam:01:15:02:06:00",
167+
.parent = &ssam_node_hub_kip,
168+
};
169+
194170
/*
195171
* Devices for 5th- and 6th-generations models:
196172
* - Surface Book 2,
@@ -206,16 +182,16 @@ static const struct software_node *ssam_node_group_gen5[] = {
206182
/* Devices for Surface Book 3. */
207183
static const struct software_node *ssam_node_group_sb3[] = {
208184
&ssam_node_root,
209-
&ssam_node_hub_base,
185+
&ssam_node_hub_kip,
210186
&ssam_node_bat_ac,
211187
&ssam_node_bat_main,
212-
&ssam_node_bat_sb3base,
188+
&ssam_node_bat_kip,
213189
&ssam_node_tmp_pprof,
214190
&ssam_node_bas_dtx,
215-
&ssam_node_hid_base_keyboard,
216-
&ssam_node_hid_base_touchpad,
217-
&ssam_node_hid_base_iid5,
218-
&ssam_node_hid_base_iid6,
191+
&ssam_node_hid_kip_keyboard,
192+
&ssam_node_hid_kip_touchpad,
193+
&ssam_node_hid_kip_iid5,
194+
&ssam_node_hid_kip_iid6,
219195
NULL,
220196
};
221197

0 commit comments

Comments
 (0)