Update v5.8 patches

Changes:
- SAM:
  - Fix a bug preventing SSAM client devices to be registered on the
    Surface Book 3.
  - Introduce SSAM device domains.
  - Rename modules, drivers, and source directories.
  - Split-up main header file.
  - Update and improve Kconfig options and help texts.
  - Internal restructuring, cleanup, and documentation.

- GPE:
  - Cleanup, fixes, and restructuring.

Links:
- SAM: 4b3ee5ad71
- GPE: 7c017f4d52
- kernel: 6ec5f0ebb0
This commit is contained in:
Maximilian Luz 2020-09-17 23:26:19 +02:00
parent 536da55ec6
commit 6a032ce25e
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02
8 changed files with 5055 additions and 4834 deletions

View file

@ -1,20 +1,19 @@
#
# Surface Aggregator Module
#
CONFIG_GPIO_SYSFS=y # required for SURFACE_SAM_HPS
CONFIG_SURFACE_SAM=m
CONFIG_SURFACE_SAM_SSH=m
CONFIG_SURFACE_SAM_SSH_ERROR_INJECTION=n
CONFIG_SURFACE_SAM_DEBUGFS=m
CONFIG_SURFACE_SAM_DEVICE_HUB=m
CONFIG_SURFACE_SAM_SAN=m
CONFIG_SURFACE_SAM_KBD=m
CONFIG_SURFACE_SAM_DTX=m
CONFIG_SURFACE_SAM_HPS=m
CONFIG_SURFACE_SAM_PERFMODE=m
CONFIG_SURFACE_SAM_HID=m
CONFIG_SURFACE_SAM_PSY=m
CONFIG_GPIO_SYSFS=y # required for SURFACE_HOTPLUG
CONFIG_SURFACE_AGGREGATOR=m
CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION=n
CONFIG_SURFACE_AGGREGATOR_BUS=y
CONFIG_SURFACE_AGGREGATOR_DEBUGFS=m
CONFIG_SURFACE_AGGREGATOR_REGISTRY=m
CONFIG_SURFACE_ACPI_NOTIFY=m
CONFIG_SURFACE_BATTERY=m
CONFIG_SURFACE_DTX=m
CONFIG_SURFACE_HID=m
CONFIG_SURFACE_HOTPLUG=m
CONFIG_SURFACE_KEYBOARD=m
CONFIG_SURFACE_PERFMODE=m
#
# IPTS touchscreen

View file

@ -1,4 +1,4 @@
From 4248e18d4612d02fd522eb8576037bd7781aece0 Mon Sep 17 00:00:00 2001
From 625c331320f55988c07ca78eeed5a41cfc3dee90 Mon Sep 17 00:00:00 2001
From: Chih-Wei Huang <cwhuang@linux.org.tw>
Date: Tue, 18 Sep 2018 11:01:37 +0800
Subject: [PATCH 1/6] surface3-oemb

View file

@ -1,4 +1,4 @@
From 002b3d0ffa9aa7541e6752b15d8d6779be2f5d08 Mon Sep 17 00:00:00 2001
From 7010639e23288d951d63e63284f0cfc3ac35211a Mon Sep 17 00:00:00 2001
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
Date: Thu, 20 Feb 2020 16:51:11 +0900
Subject: [PATCH 2/6] wifi

View file

@ -1,4 +1,4 @@
From 41b560b65cfa204af0e8d5b6682805dc10b26461 Mon Sep 17 00:00:00 2001
From eae15ff3bcf50d098fbda757e4dbd28e35798820 Mon Sep 17 00:00:00 2001
From: Dorian Stoll <dorian.stoll@tmsp.io>
Date: Thu, 30 Jul 2020 13:21:53 +0200
Subject: [PATCH 3/6] ipts

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
From 0007600e30673281468607934800bd079cad215e Mon Sep 17 00:00:00 2001
From 90f6a14cdb2a73a8c0e83e7db001560de582160d Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 25 Jul 2020 17:19:53 +0200
Subject: [PATCH 5/6] surface-sam-over-hid

View file

@ -1,4 +1,4 @@
From 2a3e106d1bc291b1f9656aaa129eca69b2509028 Mon Sep 17 00:00:00 2001
From 9f433a4b632e7b4e15dbaed41fc60fc1e5200488 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sun, 16 Aug 2020 23:39:56 +0200
Subject: [PATCH 6/6] surface-gpe
@ -6,8 +6,8 @@ Subject: [PATCH 6/6] surface-gpe
---
drivers/platform/x86/Kconfig | 9 +
drivers/platform/x86/Makefile | 1 +
drivers/platform/x86/surface_gpe.c | 303 +++++++++++++++++++++++++++++
3 files changed, 313 insertions(+)
drivers/platform/x86/surface_gpe.c | 307 +++++++++++++++++++++++++++++
3 files changed, 317 insertions(+)
create mode 100644 drivers/platform/x86/surface_gpe.c
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
@ -44,16 +44,19 @@ index 5156523b5863..ef0c3fcab319 100644
obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o
diff --git a/drivers/platform/x86/surface_gpe.c b/drivers/platform/x86/surface_gpe.c
new file mode 100644
index 000000000000..10e563f253b9
index 000000000000..2857e3862ca4
--- /dev/null
+++ b/drivers/platform/x86/surface_gpe.c
@@ -0,0 +1,303 @@
@@ -0,0 +1,307 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Surface GPE/Lid driver to enable wakeup from suspend via the lid by
+ * properly configuring the respective GPEs.
+ * properly configuring the respective GPEs. Required for wakeup via lid on
+ * newer Intel-based Microsoft Surface devices.
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/acpi.h>
+#include <linux/dmi.h>
+#include <linux/kernel.h>
@ -205,8 +208,9 @@ index 000000000000..10e563f253b9
+ acpi_status status;
+
+ status = acpi_set_gpe_wake_mask(NULL, lid->gpe_number, action);
+ if (status) {
+ dev_err(dev, "failed to set GPE wake mask: %d\n", status);
+ if (ACPI_FAILURE(status)) {
+ dev_err(dev, "failed to set GPE wake mask: %s\n",
+ acpi_format_exception(status));
+ return -EINVAL;
+ }
+
@ -229,40 +233,41 @@ index 000000000000..10e563f253b9
+{
+ struct surface_lid_device *lid;
+ u32 gpe_number;
+ int status;
+ acpi_status status;
+ int ret;
+
+ status = device_property_read_u32(&pdev->dev, "gpe", &gpe_number);
+ if (status)
+ return -ENODEV;
+
+ status = acpi_mark_gpe_for_wake(NULL, gpe_number);
+ if (status) {
+ dev_err(&pdev->dev, "failed to mark GPE for wake: %d\n", status);
+ return -EINVAL;
+ ret = device_property_read_u32(&pdev->dev, "gpe", &gpe_number);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to read 'gpe' property: %d\n", ret);
+ return ret;
+ }
+
+ status = acpi_enable_gpe(NULL, gpe_number);
+ if (status) {
+ dev_err(&pdev->dev, "failed to enable GPE: %d\n", status);
+ return -EINVAL;
+ }
+
+ lid = devm_kzalloc(&pdev->dev, sizeof(struct surface_lid_device),
+ GFP_KERNEL);
+ lid = devm_kzalloc(&pdev->dev, sizeof(*lid), GFP_KERNEL);
+ if (!lid)
+ return -ENOMEM;
+
+ lid->gpe_number = gpe_number;
+ platform_set_drvdata(pdev, lid);
+
+ status = surface_lid_enable_wakeup(&pdev->dev, false);
+ if (status) {
+ acpi_disable_gpe(NULL, gpe_number);
+ platform_set_drvdata(pdev, NULL);
+ return status;
+ status = acpi_mark_gpe_for_wake(NULL, gpe_number);
+ if (ACPI_FAILURE(status)) {
+ dev_err(&pdev->dev, "failed to mark GPE for wake: %s\n",
+ acpi_format_exception(status));
+ return -EINVAL;
+ }
+
+ return 0;
+ status = acpi_enable_gpe(NULL, gpe_number);
+ if (ACPI_FAILURE(status)) {
+ dev_err(&pdev->dev, "failed to enable GPE: %s\n",
+ acpi_format_exception(status));
+ return -EINVAL;
+ }
+
+ ret = surface_lid_enable_wakeup(&pdev->dev, false);
+ if (ret)
+ acpi_disable_gpe(NULL, gpe_number);
+
+ return ret;
+}
+
+static int surface_gpe_remove(struct platform_device *pdev)
@ -273,7 +278,6 @@ index 000000000000..10e563f253b9
+ surface_lid_enable_wakeup(&pdev->dev, false);
+ acpi_disable_gpe(NULL, lid->gpe_number);
+
+ platform_set_drvdata(pdev, NULL);
+ return 0;
+}
+
@ -292,58 +296,58 @@ index 000000000000..10e563f253b9
+static int __init surface_gpe_init(void)
+{
+ const struct dmi_system_id *match;
+ const struct property_entry *props;
+ struct platform_device *pdev;
+ struct fwnode_handle *fwnode;
+ int status;
+
+ match = dmi_first_match(dmi_lid_device_table);
+ if (!match) {
+ pr_info(KBUILD_MODNAME": no device detected, exiting\n");
+ return 0;
+ pr_info("no compatible Microsoft Surface device found, exiting\n");
+ return -ENODEV;
+ }
+
+ props = match->driver_data;
+
+ status = platform_driver_register(&surface_gpe_driver);
+ if (status)
+ return status;
+
+ pdev = platform_device_alloc("surface_gpe", PLATFORM_DEVID_NONE);
+ if (!pdev) {
+ platform_driver_unregister(&surface_gpe_driver);
+ return -ENOMEM;
+ fwnode = fwnode_create_software_node(match->driver_data, NULL);
+ if (IS_ERR(fwnode)) {
+ status = PTR_ERR(fwnode);
+ goto err_node;
+ }
+
+ fwnode = fwnode_create_software_node(props, NULL);
+ if (IS_ERR(fwnode)) {
+ platform_device_put(pdev);
+ platform_driver_unregister(&surface_gpe_driver);
+ return PTR_ERR(fwnode);
+ pdev = platform_device_alloc("surface_gpe", PLATFORM_DEVID_NONE);
+ if (!pdev) {
+ status = -ENOMEM;
+ goto err_alloc;
+ }
+
+ pdev->dev.fwnode = fwnode;
+
+ status = platform_device_add(pdev);
+ if (status) {
+ platform_device_put(pdev);
+ platform_driver_unregister(&surface_gpe_driver);
+ return status;
+ }
+ if (status)
+ goto err_add;
+
+ surface_gpe_device = pdev;
+ return 0;
+
+err_add:
+ platform_device_put(pdev);
+err_alloc:
+ fwnode_remove_software_node(fwnode);
+err_node:
+ platform_driver_unregister(&surface_gpe_driver);
+ return status;
+}
+module_init(surface_gpe_init);
+
+static void __exit surface_gpe_exit(void)
+{
+ if (!surface_gpe_device)
+ return;
+ struct fwnode_handle *fwnode = surface_gpe_device->dev.fwnode;
+
+ fwnode_remove_software_node(surface_gpe_device->dev.fwnode);
+ platform_device_unregister(surface_gpe_device);
+ platform_driver_unregister(&surface_gpe_driver);
+ fwnode_remove_software_node(fwnode);
+}
+module_exit(surface_gpe_exit);
+

View file

@ -38,14 +38,14 @@ validpgpkeys=(
)
sha256sums=('03f5e769e7b3365a5eaeea1369912f7f142f8c35f596367878831b0cd0330af1'
'181330a9cf4517abbbe29b93165bc859ad8ca14a43582f4e1d69aae2b5ecc2c9'
'1f65b3f042db87952468e99be3f1f688f62dda18401bf9716cb734f5571288b5'
'2639d6f278da82a70746d002d358197145a1916c45f495c39bb6e2ef168a676a'
'8dbaa21d2c03621b0c5d96c4fbcc7a839bea5a34a5f2279a409c3b404756e753'
'362368cb8b635d9f8ad06c5efbabe8e42347ab85d3f911df3b6d81041a67806b'
'445908dac8aa09cc141c2b67af6e3fb50c61ccadbe7e87be606f3e91db7cabfe'
'b7f1296eb5fcf6e0ddb31acc0b7ec7e672aeb075814f6d770abc1dd18ca95d3d'
'6a9a7ffdea6ac0e63d123538de3e0d32f819a1c0f98317e39a3fa13c463f0807'
'b2167ee13afadfb58b2bbe0ee5fe9b26319662b97dbb78f17d6521329f1aaffc'
'05a714876d7e2b97b14779ac5e1e66c95af5eb69c82574339afb803a43f1918b')
'e23c77883c3dca61c5ebc6689310bbb5b28f22255354bfb02a53a43e18354643'
'b7c4f87ca8b0b14ec5bc55cf6ed1eee9c0a567090448964cdb5b580625e386dc'
'd37b50ea734343fb48284583ea75363d39bc747e1f8fe5a10361d09bd791a805'
'91f33a243ac0d5368b1e3922d9c80444a5def0ff378aa5c498b558a542bf65ed'
'f5d45c9861ed0ec53590f82eed46f0ee3ef61a960d8aecf11c997f5e8e4e9789'
'dc8cb35b8a022ee544715bb91967c128863343da9f92bedb08ccf247d4669828')
export KBUILD_BUILD_HOST=archlinux