|
@@ -1,4 +1,4 @@
|
|
-From 496d12ef24c37996450d8f9ea53b4a86440be323 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 7a062af254fb0bfca0fb35f93fcaa0126692dd7e Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Thu, 28 Oct 2021 03:28:45 +0200
|
|
Date: Thu, 28 Oct 2021 03:28:45 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add initial support
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add initial support
|
|
@@ -56,9 +56,9 @@ index 1679811eff50..e70f4c63554e 100644
|
|
{ "MSHW0107", (unsigned long)ssam_node_group_gen5 },
|
|
{ "MSHW0107", (unsigned long)ssam_node_group_gen5 },
|
|
|
|
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 510309d4e8736c0c89929f433fe3af06880b9d8a Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 01b41cf45677d2d2bd0279de09b9cd63212e0046 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Wed, 2 Jun 2021 03:34:06 +0200
|
|
Date: Wed, 2 Jun 2021 03:34:06 +0200
|
|
Subject: [PATCH] platform/surface: aggregator: Make client device removal more
|
|
Subject: [PATCH] platform/surface: aggregator: Make client device removal more
|
|
@@ -181,9 +181,9 @@ index f636c5310321..cc257097eb05 100644
|
|
|
|
|
|
/**
|
|
/**
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From d59bcb9435c687d11ff535bad01244c3d6bf77e8 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From ceca307e9cba98e45560c70f6aacfc03330f5840 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Wed, 27 Oct 2021 02:06:38 +0200
|
|
Date: Wed, 27 Oct 2021 02:06:38 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Use generic client
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Use generic client
|
|
@@ -269,9 +269,9 @@ index e70f4c63554e..f6c639342b9d 100644
|
|
software_node_unregister_node_group(nodes);
|
|
software_node_unregister_node_group(nodes);
|
|
return 0;
|
|
return 0;
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 0e08c63523a2b62206efd172eb25022829cc4bce Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 976a6345f68996abd0a4fbdce40f635c19a6a854 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Wed, 27 Oct 2021 02:07:33 +0200
|
|
Date: Wed, 27 Oct 2021 02:07:33 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Rename device
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Rename device
|
|
@@ -320,9 +320,9 @@ index f6c639342b9d..ce2bd88feeaa 100644
|
|
set_secondary_fwnode(&pdev->dev, NULL);
|
|
set_secondary_fwnode(&pdev->dev, NULL);
|
|
software_node_unregister_node_group(nodes);
|
|
software_node_unregister_node_group(nodes);
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 886b35d68277037c6ba36024bdb56d3a0b3a9582 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 55b54fe60ce380e6ae486277b3d73cf9d972cbc7 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Tue, 8 Jun 2021 00:24:47 +0200
|
|
Date: Tue, 8 Jun 2021 00:24:47 +0200
|
|
Subject: [PATCH] platform/surface: aggregator: Allow devices to be marked as
|
|
Subject: [PATCH] platform/surface: aggregator: Allow devices to be marked as
|
|
@@ -441,9 +441,9 @@ index cc257097eb05..491aa7e9f4bc 100644
|
|
* ssam_device_get() - Increment reference count of SSAM client device.
|
|
* ssam_device_get() - Increment reference count of SSAM client device.
|
|
* @sdev: The device to increment the reference count of.
|
|
* @sdev: The device to increment the reference count of.
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From c7bd6479e8b468ade6e0c15d5adabb3c1d8cb3f9 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 92146078e5542d87b15669361a14110c4b6b1739 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Tue, 8 Jun 2021 00:48:22 +0200
|
|
Date: Tue, 8 Jun 2021 00:48:22 +0200
|
|
Subject: [PATCH] platform/surface: aggregator: Allow notifiers to avoid
|
|
Subject: [PATCH] platform/surface: aggregator: Allow notifiers to avoid
|
|
@@ -728,9 +728,9 @@ index 491aa7e9f4bc..16816c34da3e 100644
|
|
+
|
|
+
|
|
#endif /* _LINUX_SURFACE_AGGREGATOR_DEVICE_H */
|
|
#endif /* _LINUX_SURFACE_AGGREGATOR_DEVICE_H */
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From faf10ea439805d6624240df0e8d20c3b7de2fb0b Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 35d2b15b2bfdadc844678ea2596cc613c7568562 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Tue, 8 Jun 2021 01:20:49 +0200
|
|
Date: Tue, 8 Jun 2021 01:20:49 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Use client device
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Use client device
|
|
@@ -777,9 +777,9 @@ index ce2bd88feeaa..9f630e890ff7 100644
|
|
ssam_remove_clients(&sdev->dev);
|
|
ssam_remove_clients(&sdev->dev);
|
|
}
|
|
}
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From ed9f7aa089ba6c8d6804ca9848ea2a36e3ebfd05 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From e30843b08ba4ef74dcb2306db77124d781ead920 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Thu, 28 Oct 2021 03:37:06 +0200
|
|
Date: Thu, 28 Oct 2021 03:37:06 +0200
|
|
Subject: [PATCH] power/supply: surface_charger: Use client device wrappers for
|
|
Subject: [PATCH] power/supply: surface_charger: Use client device wrappers for
|
|
@@ -817,9 +817,9 @@ index a060c36c7766..59182d55742d 100644
|
|
|
|
|
|
static const struct spwr_psy_properties spwr_psy_props_adp1 = {
|
|
static const struct spwr_psy_properties spwr_psy_props_adp1 = {
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From da9cc91d8244343358c7da76f22067b7ce130b20 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From a1c90203399ea0f2ea8846a631bf218cd58af128 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Thu, 28 Oct 2021 03:38:09 +0200
|
|
Date: Thu, 28 Oct 2021 03:38:09 +0200
|
|
Subject: [PATCH] power/supply: surface_battery: Use client device wrappers for
|
|
Subject: [PATCH] power/supply: surface_battery: Use client device wrappers for
|
|
@@ -857,9 +857,9 @@ index 5ec2e6bb2465..540707882bb0 100644
|
|
}
|
|
}
|
|
|
|
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 096356dbf0b8fa07ae9fa04c0548a568db114bb1 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From f1ca8e0f72d5513a8ba5c12538cfbbfebc730837 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Tue, 8 Jun 2021 01:33:02 +0200
|
|
Date: Tue, 8 Jun 2021 01:33:02 +0200
|
|
Subject: [PATCH] HID: surface-hid: Add support for hot-removal
|
|
Subject: [PATCH] HID: surface-hid: Add support for hot-removal
|
|
@@ -968,9 +968,9 @@ index 5571e74abe91..d2e695e942b6 100644
|
|
return shid->ops.output_report(shid, reportnum, buf, len);
|
|
return shid->ops.output_report(shid, reportnum, buf, len);
|
|
|
|
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From bc7cfd188a34429c599f32a77d2dceeae0f8674d Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From e6d33d4464f41358ef24c3cdb23a8c289fcc1858 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Sun, 31 Oct 2021 12:34:08 +0100
|
|
Date: Sun, 31 Oct 2021 12:34:08 +0100
|
|
Subject: [PATCH] platform/surface: aggregator: Add comment for KIP subsystem
|
|
Subject: [PATCH] platform/surface: aggregator: Add comment for KIP subsystem
|
|
@@ -1006,9 +1006,9 @@ index c3de43edcffa..d1efac85caf1 100644
|
|
SSAM_SSH_TC_BLD = 0x10,
|
|
SSAM_SSH_TC_BLD = 0x10,
|
|
SSAM_SSH_TC_BAS = 0x11, /* Detachment system (Surface Book 2/3). */
|
|
SSAM_SSH_TC_BAS = 0x11, /* Detachment system (Surface Book 2/3). */
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 7ca9a066f94cd01d1c2b2498e0ebd6e283b9649d Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 3bdd0aceeb1073fa84b80fb00aec5304ce294c70 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Sun, 10 Oct 2021 23:56:23 +0200
|
|
Date: Sun, 10 Oct 2021 23:56:23 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add KIP device hub
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add KIP device hub
|
|
@@ -1320,9 +1320,9 @@ index 9f630e890ff7..4838ce6519a6 100644
|
|
platform_driver_unregister(&ssam_platform_hub_driver);
|
|
platform_driver_unregister(&ssam_platform_hub_driver);
|
|
}
|
|
}
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 1598a4c2c6eb031c15ae2bb3df90d34edae51b89 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 2ec1190e86f426b2c8d98797ae2a448abcb8e2bb Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Wed, 27 Oct 2021 22:33:03 +0200
|
|
Date: Wed, 27 Oct 2021 22:33:03 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add support for
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add support for
|
|
@@ -1418,9 +1418,9 @@ index 4838ce6519a6..c0e29c0514df 100644
|
|
};
|
|
};
|
|
|
|
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 1583027b968654e2cd12b6860423cb0fb75d5629 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 9b9b2b45bff1ff5bc1a64de0ee3a21074198aa3a Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Tue, 8 Jun 2021 03:19:20 +0200
|
|
Date: Tue, 8 Jun 2021 03:19:20 +0200
|
|
Subject: [PATCH] platform/surface: Add KIP tablet-mode switch
|
|
Subject: [PATCH] platform/surface: Add KIP tablet-mode switch
|
|
@@ -1762,9 +1762,9 @@ index 000000000000..458470067579
|
|
+MODULE_DESCRIPTION("Tablet mode switch driver for Surface devices using KIP subsystem");
|
|
+MODULE_DESCRIPTION("Tablet mode switch driver for Surface devices using KIP subsystem");
|
|
+MODULE_LICENSE("GPL");
|
|
+MODULE_LICENSE("GPL");
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|
|
-From 4109ded6a4d089e203e7b7c25984892f10e91f0a Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 226ea66ac2a99ef2c7c17d3d2b9e164d2d3efa00 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Wed, 27 Oct 2021 22:33:03 +0200
|
|
Date: Wed, 27 Oct 2021 22:33:03 +0200
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add support for tablet
|
|
Subject: [PATCH] platform/surface: aggregator_registry: Add support for tablet
|
|
@@ -1812,454 +1812,5 @@ index c0e29c0514df..eaf0054627a5 100644
|
|
};
|
|
};
|
|
|
|
|
|
--
|
|
--
|
|
-2.34.0
|
|
|
|
-
|
|
|
|
-From 4be5a5872682bd890911a48cee79f7f583ff4686 Mon Sep 17 00:00:00 2001
|
|
|
|
-From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
|
|
-Date: Thu, 28 Oct 2021 03:40:22 +0200
|
|
|
|
-Subject: [PATCH] power/supply: surface_battery: Add support for hot-removal
|
|
|
|
-
|
|
|
|
-In cases of hot-removal, further communication with the device should be
|
|
|
|
-avoided whenever possible, as it may fail and time out.
|
|
|
|
-
|
|
|
|
-Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
|
|
|
|
-Patchset: surface-sam
|
|
|
|
----
|
|
|
|
- drivers/power/supply/surface_battery.c | 6 ++++++
|
|
|
|
- 1 file changed, 6 insertions(+)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/power/supply/surface_battery.c b/drivers/power/supply/surface_battery.c
|
|
|
|
-index 540707882bb0..ebf1f96e9a89 100644
|
|
|
|
---- a/drivers/power/supply/surface_battery.c
|
|
|
|
-+++ b/drivers/power/supply/surface_battery.c
|
|
|
|
-@@ -156,6 +156,9 @@ static bool spwr_battery_present(struct spwr_battery_device *bat)
|
|
|
|
- {
|
|
|
|
- lockdep_assert_held(&bat->lock);
|
|
|
|
-
|
|
|
|
-+ if (ssam_device_is_hot_removed(bat->sdev))
|
|
|
|
-+ return false;
|
|
|
|
-+
|
|
|
|
- return le32_to_cpu(bat->sta) & SAM_BATTERY_STA_PRESENT;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-@@ -245,6 +248,9 @@ static int spwr_battery_update_bix_unlocked(struct spwr_battery_device *bat)
|
|
|
|
-
|
|
|
|
- lockdep_assert_held(&bat->lock);
|
|
|
|
-
|
|
|
|
-+ if (ssam_device_is_hot_removed(bat->sdev))
|
|
|
|
-+ return 0;
|
|
|
|
-+
|
|
|
|
- status = spwr_battery_load_sta(bat);
|
|
|
|
- if (status)
|
|
|
|
- return status;
|
|
|
|
---
|
|
|
|
-2.34.0
|
|
|
|
-
|
|
|
|
-From 9c7d3cfe6294ec72a2ce9c97c040a46ada4473c3 Mon Sep 17 00:00:00 2001
|
|
|
|
-From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
|
|
-Date: Sun, 31 Oct 2021 18:07:39 +0100
|
|
|
|
-Subject: [PATCH] platform/surface: aggregator_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 <luzmaximilian@gmail.com>
|
|
|
|
-Patchset: surface-sam
|
|
|
|
----
|
|
|
|
- .../surface/surface_aggregator_registry.c | 56 ++++++-------------
|
|
|
|
- 1 file changed, 16 insertions(+), 40 deletions(-)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
|
|
|
|
-index eaf0054627a5..d17f656b2dad 100644
|
|
|
|
---- a/drivers/platform/surface/surface_aggregator_registry.c
|
|
|
|
-+++ b/drivers/platform/surface/surface_aggregator_registry.c
|
|
|
|
-@@ -41,13 +41,7 @@ static const struct software_node ssam_node_root = {
|
|
|
|
- .name = "ssam_platform_hub",
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
--/* Base device hub (devices attached to Surface Book 3 base). */
|
|
|
|
--static const struct software_node ssam_node_hub_base = {
|
|
|
|
-- .name = "ssam:00:00:02:00:00",
|
|
|
|
-- .parent = &ssam_node_root,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--/* KIP device hub (connects keyboard cover devices on Surface Pro 8). */
|
|
|
|
-+/* KIP device hub (connects detachable keyboard/touchpad on Surface Pro 8 and Book 3). */
|
|
|
|
- static const struct software_node ssam_node_hub_kip = {
|
|
|
|
- .name = "ssam:01:0e:01:00:00",
|
|
|
|
- .parent = &ssam_node_root,
|
|
|
|
-@@ -65,10 +59,10 @@ static const struct software_node ssam_node_bat_main = {
|
|
|
|
- .parent = &ssam_node_root,
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
--/* Secondary battery (Surface Book 3). */
|
|
|
|
--static const struct software_node ssam_node_bat_sb3base = {
|
|
|
|
-+/* Secondary battery (Surface Book 3, managed via KIP hub). */
|
|
|
|
-+static const struct software_node ssam_node_bat_kip = {
|
|
|
|
- .name = "ssam:01:02:02:01:00",
|
|
|
|
-- .parent = &ssam_node_hub_base,
|
|
|
|
-+ .parent = &ssam_node_hub_kip,
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- /* Platform profile / performance-mode device. */
|
|
|
|
-@@ -143,30 +137,6 @@ static const struct software_node ssam_node_hid_main_iid5 = {
|
|
|
|
- .parent = &ssam_node_root,
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
--/* HID keyboard (base hub). */
|
|
|
|
--static const struct software_node ssam_node_hid_base_keyboard = {
|
|
|
|
-- .name = "ssam:01:15:02:01:00",
|
|
|
|
-- .parent = &ssam_node_hub_base,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--/* HID touchpad (base hub). */
|
|
|
|
--static const struct software_node ssam_node_hid_base_touchpad = {
|
|
|
|
-- .name = "ssam:01:15:02:03:00",
|
|
|
|
-- .parent = &ssam_node_hub_base,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--/* HID device instance 5 (unknown HID device, base hub). */
|
|
|
|
--static const struct software_node ssam_node_hid_base_iid5 = {
|
|
|
|
-- .name = "ssam:01:15:02:05:00",
|
|
|
|
-- .parent = &ssam_node_hub_base,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--/* HID device instance 6 (unknown HID device, base hub). */
|
|
|
|
--static const struct software_node ssam_node_hid_base_iid6 = {
|
|
|
|
-- .name = "ssam:01:15:02:06:00",
|
|
|
|
-- .parent = &ssam_node_hub_base,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
- /* HID keyboard (KIP hub). */
|
|
|
|
- static const struct software_node ssam_node_hid_kip_keyboard = {
|
|
|
|
- .name = "ssam:01:15:02:01:00",
|
|
|
|
-@@ -191,6 +161,12 @@ static const struct software_node ssam_node_hid_kip_iid5 = {
|
|
|
|
- .parent = &ssam_node_hub_kip,
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
-+/* HID device instance 6 (KIP hub, unknown HID device). */
|
|
|
|
-+static const struct software_node ssam_node_hid_kip_iid6 = {
|
|
|
|
-+ .name = "ssam:01:15:02:06:00",
|
|
|
|
-+ .parent = &ssam_node_hub_kip,
|
|
|
|
-+};
|
|
|
|
-+
|
|
|
|
- /*
|
|
|
|
- * Devices for 5th- and 6th-generations models:
|
|
|
|
- * - Surface Book 2,
|
|
|
|
-@@ -206,16 +182,16 @@ static const struct software_node *ssam_node_group_gen5[] = {
|
|
|
|
- /* Devices for Surface Book 3. */
|
|
|
|
- static const struct software_node *ssam_node_group_sb3[] = {
|
|
|
|
- &ssam_node_root,
|
|
|
|
-- &ssam_node_hub_base,
|
|
|
|
-+ &ssam_node_hub_kip,
|
|
|
|
- &ssam_node_bat_ac,
|
|
|
|
- &ssam_node_bat_main,
|
|
|
|
-- &ssam_node_bat_sb3base,
|
|
|
|
-+ &ssam_node_bat_kip,
|
|
|
|
- &ssam_node_tmp_pprof,
|
|
|
|
- &ssam_node_bas_dtx,
|
|
|
|
-- &ssam_node_hid_base_keyboard,
|
|
|
|
-- &ssam_node_hid_base_touchpad,
|
|
|
|
-- &ssam_node_hid_base_iid5,
|
|
|
|
-- &ssam_node_hid_base_iid6,
|
|
|
|
-+ &ssam_node_hid_kip_keyboard,
|
|
|
|
-+ &ssam_node_hid_kip_touchpad,
|
|
|
|
-+ &ssam_node_hid_kip_iid5,
|
|
|
|
-+ &ssam_node_hid_kip_iid6,
|
|
|
|
- NULL,
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
---
|
|
|
|
-2.34.0
|
|
|
|
-
|
|
|
|
-From 4317a9568b04494977bf91edab24a0148aaa9329 Mon Sep 17 00:00:00 2001
|
|
|
|
-From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
|
|
-Date: Sun, 31 Oct 2021 18:09:53 +0100
|
|
|
|
-Subject: [PATCH] platform/surface: aggregator_registry: Remove base hub driver
|
|
|
|
-
|
|
|
|
-The base hub was a virtual device hub for Surface System Aggregator
|
|
|
|
-Module (SSAM) client devices contained in the detachable Surface Book 3
|
|
|
|
-base. Remove it as it is no longer needed.
|
|
|
|
-
|
|
|
|
-In the previous change, we have moved all devices from the base hub to
|
|
|
|
-the KIP hub. That change has also removed the only base-hub-device that
|
|
|
|
-ever existed, as it was essentially replaced by the KIP-hub-device and
|
|
|
|
-thus was no longer needed. This means that there is no remaining
|
|
|
|
-hub-device against which the base hub driver can load, i.e. it is now
|
|
|
|
-essentially dead code. So remove the driver as well.
|
|
|
|
-
|
|
|
|
-Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
|
|
|
|
-Patchset: surface-sam
|
|
|
|
----
|
|
|
|
- .../surface/surface_aggregator_registry.c | 213 ------------------
|
|
|
|
- 1 file changed, 213 deletions(-)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
|
|
|
|
-index d17f656b2dad..590473220e9d 100644
|
|
|
|
---- a/drivers/platform/surface/surface_aggregator_registry.c
|
|
|
|
-+++ b/drivers/platform/surface/surface_aggregator_registry.c
|
|
|
|
-@@ -325,212 +325,6 @@ static int ssam_hub_register_clients(struct device *parent, struct ssam_controll
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
--/* -- SSAM base-hub driver. ------------------------------------------------- */
|
|
|
|
--
|
|
|
|
--/*
|
|
|
|
-- * Some devices (especially battery) may need a bit of time to be fully usable
|
|
|
|
-- * after being (re-)connected. This delay has been determined via
|
|
|
|
-- * experimentation.
|
|
|
|
-- */
|
|
|
|
--#define SSAM_BASE_UPDATE_CONNECT_DELAY msecs_to_jiffies(2500)
|
|
|
|
--
|
|
|
|
--enum ssam_base_hub_state {
|
|
|
|
-- SSAM_BASE_HUB_UNINITIALIZED,
|
|
|
|
-- SSAM_BASE_HUB_CONNECTED,
|
|
|
|
-- SSAM_BASE_HUB_DISCONNECTED,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--struct ssam_base_hub {
|
|
|
|
-- struct ssam_device *sdev;
|
|
|
|
--
|
|
|
|
-- enum ssam_base_hub_state state;
|
|
|
|
-- struct delayed_work update_work;
|
|
|
|
--
|
|
|
|
-- struct ssam_event_notifier notif;
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--SSAM_DEFINE_SYNC_REQUEST_R(ssam_bas_query_opmode, u8, {
|
|
|
|
-- .target_category = SSAM_SSH_TC_BAS,
|
|
|
|
-- .target_id = 0x01,
|
|
|
|
-- .command_id = 0x0d,
|
|
|
|
-- .instance_id = 0x00,
|
|
|
|
--});
|
|
|
|
--
|
|
|
|
--#define SSAM_BAS_OPMODE_TABLET 0x00
|
|
|
|
--#define SSAM_EVENT_BAS_CID_CONNECTION 0x0c
|
|
|
|
--
|
|
|
|
--static int ssam_base_hub_query_state(struct ssam_base_hub *hub, enum ssam_base_hub_state *state)
|
|
|
|
--{
|
|
|
|
-- u8 opmode;
|
|
|
|
-- int status;
|
|
|
|
--
|
|
|
|
-- status = ssam_retry(ssam_bas_query_opmode, hub->sdev->ctrl, &opmode);
|
|
|
|
-- if (status < 0) {
|
|
|
|
-- dev_err(&hub->sdev->dev, "failed to query base state: %d\n", status);
|
|
|
|
-- return status;
|
|
|
|
-- }
|
|
|
|
--
|
|
|
|
-- if (opmode != SSAM_BAS_OPMODE_TABLET)
|
|
|
|
-- *state = SSAM_BASE_HUB_CONNECTED;
|
|
|
|
-- else
|
|
|
|
-- *state = SSAM_BASE_HUB_DISCONNECTED;
|
|
|
|
--
|
|
|
|
-- return 0;
|
|
|
|
--}
|
|
|
|
--
|
|
|
|
--static ssize_t ssam_base_hub_state_show(struct device *dev, struct device_attribute *attr,
|
|
|
|
-- char *buf)
|
|
|
|
--{
|
|
|
|
-- struct ssam_base_hub *hub = dev_get_drvdata(dev);
|
|
|
|
-- bool connected = hub->state == SSAM_BASE_HUB_CONNECTED;
|
|
|
|
--
|
|
|
|
-- return sysfs_emit(buf, "%d\n", connected);
|
|
|
|
--}
|
|
|
|
--
|
|
|
|
--static struct device_attribute ssam_base_hub_attr_state =
|
|
|
|
-- __ATTR(state, 0444, ssam_base_hub_state_show, NULL);
|
|
|
|
--
|
|
|
|
--static struct attribute *ssam_base_hub_attrs[] = {
|
|
|
|
-- &ssam_base_hub_attr_state.attr,
|
|
|
|
-- NULL,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--static const struct attribute_group ssam_base_hub_group = {
|
|
|
|
-- .attrs = ssam_base_hub_attrs,
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--static void ssam_base_hub_update_workfn(struct work_struct *work)
|
|
|
|
--{
|
|
|
|
-- struct ssam_base_hub *hub = container_of(work, struct ssam_base_hub, update_work.work);
|
|
|
|
-- struct fwnode_handle *node = dev_fwnode(&hub->sdev->dev);
|
|
|
|
-- enum ssam_base_hub_state state;
|
|
|
|
-- int status = 0;
|
|
|
|
--
|
|
|
|
-- status = ssam_base_hub_query_state(hub, &state);
|
|
|
|
-- if (status)
|
|
|
|
-- return;
|
|
|
|
--
|
|
|
|
-- if (hub->state == state)
|
|
|
|
-- return;
|
|
|
|
-- hub->state = state;
|
|
|
|
--
|
|
|
|
-- if (hub->state == SSAM_BASE_HUB_CONNECTED)
|
|
|
|
-- status = ssam_hub_register_clients(&hub->sdev->dev, hub->sdev->ctrl, node);
|
|
|
|
-- else
|
|
|
|
-- ssam_remove_clients(&hub->sdev->dev);
|
|
|
|
--
|
|
|
|
-- if (status)
|
|
|
|
-- dev_err(&hub->sdev->dev, "failed to update base-hub devices: %d\n", status);
|
|
|
|
--}
|
|
|
|
--
|
|
|
|
--static u32 ssam_base_hub_notif(struct ssam_event_notifier *nf, const struct ssam_event *event)
|
|
|
|
--{
|
|
|
|
-- struct ssam_base_hub *hub = container_of(nf, struct ssam_base_hub, notif);
|
|
|
|
-- unsigned long delay;
|
|
|
|
--
|
|
|
|
-- if (event->command_id != SSAM_EVENT_BAS_CID_CONNECTION)
|
|
|
|
-- return 0;
|
|
|
|
--
|
|
|
|
-- if (event->length < 1) {
|
|
|
|
-- dev_err(&hub->sdev->dev, "unexpected payload size: %u\n", event->length);
|
|
|
|
-- return 0;
|
|
|
|
-- }
|
|
|
|
--
|
|
|
|
-- /*
|
|
|
|
-- * Delay update when the base is being connected to give devices/EC
|
|
|
|
-- * some time to set up.
|
|
|
|
-- */
|
|
|
|
-- delay = event->data[0] ? SSAM_BASE_UPDATE_CONNECT_DELAY : 0;
|
|
|
|
--
|
|
|
|
-- schedule_delayed_work(&hub->update_work, delay);
|
|
|
|
--
|
|
|
|
-- /*
|
|
|
|
-- * Do not return SSAM_NOTIF_HANDLED: The event should be picked up and
|
|
|
|
-- * consumed by the detachment system driver. We're just a (more or less)
|
|
|
|
-- * silent observer.
|
|
|
|
-- */
|
|
|
|
-- return 0;
|
|
|
|
--}
|
|
|
|
--
|
|
|
|
--static int __maybe_unused ssam_base_hub_resume(struct device *dev)
|
|
|
|
--{
|
|
|
|
-- struct ssam_base_hub *hub = dev_get_drvdata(dev);
|
|
|
|
--
|
|
|
|
-- schedule_delayed_work(&hub->update_work, 0);
|
|
|
|
-- return 0;
|
|
|
|
--}
|
|
|
|
--static SIMPLE_DEV_PM_OPS(ssam_base_hub_pm_ops, NULL, ssam_base_hub_resume);
|
|
|
|
--
|
|
|
|
--static int ssam_base_hub_probe(struct ssam_device *sdev)
|
|
|
|
--{
|
|
|
|
-- struct ssam_base_hub *hub;
|
|
|
|
-- int status;
|
|
|
|
--
|
|
|
|
-- hub = devm_kzalloc(&sdev->dev, sizeof(*hub), GFP_KERNEL);
|
|
|
|
-- if (!hub)
|
|
|
|
-- return -ENOMEM;
|
|
|
|
--
|
|
|
|
-- hub->sdev = sdev;
|
|
|
|
-- hub->state = SSAM_BASE_HUB_UNINITIALIZED;
|
|
|
|
--
|
|
|
|
-- hub->notif.base.priority = INT_MAX; /* This notifier should run first. */
|
|
|
|
-- hub->notif.base.fn = ssam_base_hub_notif;
|
|
|
|
-- hub->notif.event.reg = SSAM_EVENT_REGISTRY_SAM;
|
|
|
|
-- hub->notif.event.id.target_category = SSAM_SSH_TC_BAS,
|
|
|
|
-- hub->notif.event.id.instance = 0,
|
|
|
|
-- hub->notif.event.mask = SSAM_EVENT_MASK_NONE;
|
|
|
|
-- hub->notif.event.flags = SSAM_EVENT_SEQUENCED;
|
|
|
|
--
|
|
|
|
-- INIT_DELAYED_WORK(&hub->update_work, ssam_base_hub_update_workfn);
|
|
|
|
--
|
|
|
|
-- ssam_device_set_drvdata(sdev, hub);
|
|
|
|
--
|
|
|
|
-- status = ssam_device_notifier_register(sdev, &hub->notif);
|
|
|
|
-- if (status)
|
|
|
|
-- return status;
|
|
|
|
--
|
|
|
|
-- status = sysfs_create_group(&sdev->dev.kobj, &ssam_base_hub_group);
|
|
|
|
-- if (status)
|
|
|
|
-- goto err;
|
|
|
|
--
|
|
|
|
-- schedule_delayed_work(&hub->update_work, 0);
|
|
|
|
-- return 0;
|
|
|
|
--
|
|
|
|
--err:
|
|
|
|
-- ssam_device_notifier_unregister(sdev, &hub->notif);
|
|
|
|
-- cancel_delayed_work_sync(&hub->update_work);
|
|
|
|
-- ssam_remove_clients(&sdev->dev);
|
|
|
|
-- return status;
|
|
|
|
--}
|
|
|
|
--
|
|
|
|
--static void ssam_base_hub_remove(struct ssam_device *sdev)
|
|
|
|
--{
|
|
|
|
-- struct ssam_base_hub *hub = ssam_device_get_drvdata(sdev);
|
|
|
|
--
|
|
|
|
-- sysfs_remove_group(&sdev->dev.kobj, &ssam_base_hub_group);
|
|
|
|
--
|
|
|
|
-- ssam_device_notifier_unregister(sdev, &hub->notif);
|
|
|
|
-- cancel_delayed_work_sync(&hub->update_work);
|
|
|
|
-- ssam_remove_clients(&sdev->dev);
|
|
|
|
--}
|
|
|
|
--
|
|
|
|
--static const struct ssam_device_id ssam_base_hub_match[] = {
|
|
|
|
-- { SSAM_VDEV(HUB, 0x02, SSAM_ANY_IID, 0x00) },
|
|
|
|
-- { },
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--static struct ssam_device_driver ssam_base_hub_driver = {
|
|
|
|
-- .probe = ssam_base_hub_probe,
|
|
|
|
-- .remove = ssam_base_hub_remove,
|
|
|
|
-- .match_table = ssam_base_hub_match,
|
|
|
|
-- .driver = {
|
|
|
|
-- .name = "surface_aggregator_base_hub",
|
|
|
|
-- .probe_type = PROBE_PREFER_ASYNCHRONOUS,
|
|
|
|
-- .pm = &ssam_base_hub_pm_ops,
|
|
|
|
-- },
|
|
|
|
--};
|
|
|
|
--
|
|
|
|
--
|
|
|
|
- /* -- SSAM KIP-subsystem hub driver. ---------------------------------------- */
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
-@@ -886,10 +680,6 @@ static int __init ssam_device_hub_init(void)
|
|
|
|
- if (status)
|
|
|
|
- goto err_platform;
|
|
|
|
-
|
|
|
|
-- status = ssam_device_driver_register(&ssam_base_hub_driver);
|
|
|
|
-- if (status)
|
|
|
|
-- goto err_base;
|
|
|
|
--
|
|
|
|
- status = ssam_device_driver_register(&ssam_kip_hub_driver);
|
|
|
|
- if (status)
|
|
|
|
- goto err_kip;
|
|
|
|
-@@ -897,8 +687,6 @@ static int __init ssam_device_hub_init(void)
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
- err_kip:
|
|
|
|
-- ssam_device_driver_unregister(&ssam_base_hub_driver);
|
|
|
|
--err_base:
|
|
|
|
- platform_driver_unregister(&ssam_platform_hub_driver);
|
|
|
|
- err_platform:
|
|
|
|
- return status;
|
|
|
|
-@@ -908,7 +696,6 @@ module_init(ssam_device_hub_init);
|
|
|
|
- static void __exit ssam_device_hub_exit(void)
|
|
|
|
- {
|
|
|
|
- ssam_device_driver_unregister(&ssam_kip_hub_driver);
|
|
|
|
-- ssam_device_driver_unregister(&ssam_base_hub_driver);
|
|
|
|
- platform_driver_unregister(&ssam_platform_hub_driver);
|
|
|
|
- }
|
|
|
|
- module_exit(ssam_device_hub_exit);
|
|
|
|
---
|
|
|
|
-2.34.0
|
|
|
|
|
|
+2.34.1
|
|
|
|
|