diff --git a/sys-kernel/surface-sources/files/6.10/0001-secureboot.patch b/sys-kernel/surface-sources/files/6.10/0001-secureboot.patch index f1dc041..5f70268 100644 --- a/sys-kernel/surface-sources/files/6.10/0001-secureboot.patch +++ b/sys-kernel/surface-sources/files/6.10/0001-secureboot.patch @@ -1,4 +1,4 @@ -From 252c5b2e65865a2a3aa6a5400f204c47d22490ee Mon Sep 17 00:00:00 2001 +From f042429d0ea3d440fa70f9c51c8197bb208f0a88 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 9 Jun 2024 19:48:58 +0200 Subject: [PATCH] Revert "efi/x86: Set the PE/COFF header's NX compat flag @@ -35,3 +35,78 @@ index b5c79f43359b..a1bbedd989e4 100644 -- 2.46.0 +From db11088db25ece8759f2db44ae62b144575a3649 Mon Sep 17 00:00:00 2001 +From: "J. Eduardo" +Date: Sun, 25 Aug 2024 14:17:45 +0200 +Subject: [PATCH] PM: hibernate: Add a lockdown_hibernate parameter + +This allows the user to tell the kernel that they know better (namely, +they secured their swap properly), and that it can enable hibernation. + +Signed-off-by: Kelvie Wong +Link: https://github.com/linux-surface/kernel/pull/158 +Link: https://gist.github.com/brknkfr/95d1925ccdbb7a2d18947c168dfabbee +Patchset: secureboot +--- + Documentation/admin-guide/kernel-parameters.txt | 5 +++++ + kernel/power/hibernate.c | 10 +++++++++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt +index c82446cef8e2..2ae1a6fda7f9 100644 +--- a/Documentation/admin-guide/kernel-parameters.txt ++++ b/Documentation/admin-guide/kernel-parameters.txt +@@ -3000,6 +3000,11 @@ + to extract confidential information from the kernel + are also disabled. + ++ lockdown_hibernate [HIBERNATION] ++ Enable hibernation even if lockdown is enabled. Enable this only if ++ your swap is encrypted and secured properly, as an attacker can ++ modify the kernel offline during hibernation. ++ + locktorture.acq_writer_lim= [KNL] + Set the time limit in jiffies for a lock + acquisition. Acquisitions exceeding this limit +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index 0a213f69a9e4..8e4f9dcc9f4c 100644 +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -37,6 +37,7 @@ + #include "power.h" + + ++static int lockdown_hibernate; + static int nocompress; + static int noresume; + static int nohibernate; +@@ -92,7 +93,7 @@ void hibernate_release(void) + bool hibernation_available(void) + { + return nohibernate == 0 && +- !security_locked_down(LOCKDOWN_HIBERNATION) && ++ (lockdown_hibernate || !security_locked_down(LOCKDOWN_HIBERNATION)) && + !secretmem_active() && !cxl_mem_active(); + } + +@@ -1422,6 +1423,12 @@ static int __init nohibernate_setup(char *str) + return 1; + } + ++static int __init lockdown_hibernate_setup(char *str) ++{ ++ lockdown_hibernate = 1; ++ return 1; ++} ++ + static const char * const comp_alg_enabled[] = { + #if IS_ENABLED(CONFIG_CRYPTO_LZO) + COMPRESSION_ALGO_LZO, +@@ -1480,3 +1487,4 @@ __setup("hibernate=", hibernate_setup); + __setup("resumewait", resumewait_setup); + __setup("resumedelay=", resumedelay_setup); + __setup("nohibernate", nohibernate_setup); ++__setup("lockdown_hibernate", lockdown_hibernate_setup); +-- +2.46.0 + diff --git a/sys-kernel/surface-sources/files/6.10/0002-surface3-oemb.patch b/sys-kernel/surface-sources/files/6.10/0002-surface3-oemb.patch index 82db24a..75bf3ef 100644 --- a/sys-kernel/surface-sources/files/6.10/0002-surface3-oemb.patch +++ b/sys-kernel/surface-sources/files/6.10/0002-surface3-oemb.patch @@ -1,4 +1,4 @@ -From 1146270e92aee0b612dfe695bcf8f7131a19bcf3 Mon Sep 17 00:00:00 2001 +From 3b00df63072f59df6b111ad853b87094b3536442 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 18 Oct 2020 16:42:44 +0900 Subject: [PATCH] (surface3-oemb) add DMI matches for Surface 3 with broken DMI diff --git a/sys-kernel/surface-sources/files/6.10/0003-mwifiex.patch b/sys-kernel/surface-sources/files/6.10/0003-mwifiex.patch index 8e214c3..7f41717 100644 --- a/sys-kernel/surface-sources/files/6.10/0003-mwifiex.patch +++ b/sys-kernel/surface-sources/files/6.10/0003-mwifiex.patch @@ -1,4 +1,4 @@ -From 800e9cfe84a3eadd4dc9ae700940068e77fa8a12 Mon Sep 17 00:00:00 2001 +From 4ed887721124fdef2427143d1df5c56f42527b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 3 Nov 2020 13:28:04 +0100 Subject: [PATCH] mwifiex: Add quirk resetting the PCI bridge on MS Surface @@ -165,7 +165,7 @@ index d6ff964aec5b..5d30ae39d65e 100644 -- 2.46.0 -From d51c5a356fee57c99a8d181825f8f941f34749d7 Mon Sep 17 00:00:00 2001 +From 894aa28465f66434a8c253eee50347f682c40117 Mon Sep 17 00:00:00 2001 From: Tsuchiya Yuto Date: Sun, 4 Oct 2020 00:11:49 +0900 Subject: [PATCH] mwifiex: pcie: disable bridge_d3 for Surface gen4+ @@ -320,7 +320,7 @@ index 5d30ae39d65e..c14eb56eb911 100644 -- 2.46.0 -From 317cde3654592dcb3e072d0d2fe7b4e5598cc078 Mon Sep 17 00:00:00 2001 +From bca01a7cadbd3152491c45ae9d427478447cc483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 25 Mar 2021 11:33:02 +0100 Subject: [PATCH] Bluetooth: btusb: Lower passive lescan interval on Marvell @@ -356,7 +356,7 @@ Patchset: mwifiex 1 file changed, 15 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 789c492df6fa..1e766b6c1f9a 100644 +index 0927f51867c2..3d3573829631 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -65,6 +65,7 @@ static struct usb_driver btusb_driver; diff --git a/sys-kernel/surface-sources/files/6.10/0004-ath10k.patch b/sys-kernel/surface-sources/files/6.10/0004-ath10k.patch index 886f510..c420e57 100644 --- a/sys-kernel/surface-sources/files/6.10/0004-ath10k.patch +++ b/sys-kernel/surface-sources/files/6.10/0004-ath10k.patch @@ -1,4 +1,4 @@ -From 268a79fb66862ef22294397a425fd074fc336c34 Mon Sep 17 00:00:00 2001 +From 285063f8ccb7722b6eb27a6401fed87c86fd2e7f Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 27 Feb 2021 00:45:52 +0100 Subject: [PATCH] ath10k: Add module parameters to override board files diff --git a/sys-kernel/surface-sources/files/6.10/0005-ipts.patch b/sys-kernel/surface-sources/files/6.10/0005-ipts.patch index 3114422..67e11af 100644 --- a/sys-kernel/surface-sources/files/6.10/0005-ipts.patch +++ b/sys-kernel/surface-sources/files/6.10/0005-ipts.patch @@ -1,4 +1,4 @@ -From 9904c59dbdd422b811974893bab69fc5b4bc9a03 Mon Sep 17 00:00:00 2001 +From 60cbae0f851d06cd4c356b29377ecbadfb08f874 Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Thu, 30 Jul 2020 13:21:53 +0200 Subject: [PATCH] mei: me: Add Icelake device ID for iTouch @@ -37,7 +37,7 @@ index 6589635f8ba3..a1df48a434e2 100644 -- 2.46.0 -From b0d9ceae2f95a4e4093b07580bedc10821374555 Mon Sep 17 00:00:00 2001 +From 681a57dea0faeceb03b50752abbafb85341b981c Mon Sep 17 00:00:00 2001 From: Liban Hannan Date: Tue, 12 Apr 2022 23:31:12 +0100 Subject: [PATCH] iommu: Use IOMMU passthrough mode for IPTS @@ -61,7 +61,7 @@ Patchset: ipts 1 file changed, 29 insertions(+) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c -index f55ec1fd7942..8d95579436a9 100644 +index e9bea0305c26..6ee97bf7b6a9 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -40,6 +40,11 @@ @@ -144,7 +144,7 @@ index f55ec1fd7942..8d95579436a9 100644 -- 2.46.0 -From ee1ebc3f9ec7a8418f418902817b5c5f4b51c21d Mon Sep 17 00:00:00 2001 +From 56f5368c0bfde7b931fcb183cc779db625978f51 Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Sun, 11 Dec 2022 12:00:59 +0100 Subject: [PATCH] hid: Add support for Intel Precise Touch and Stylus diff --git a/sys-kernel/surface-sources/files/6.10/0006-ithc.patch b/sys-kernel/surface-sources/files/6.10/0006-ithc.patch index 3a28a55..d8afcc3 100644 --- a/sys-kernel/surface-sources/files/6.10/0006-ithc.patch +++ b/sys-kernel/surface-sources/files/6.10/0006-ithc.patch @@ -1,4 +1,4 @@ -From 0d0e07366b425e953d6dab698d62dbe9a7546994 Mon Sep 17 00:00:00 2001 +From 19b03c0a9c68f00487ed8c07163e819da9c63fdd Mon Sep 17 00:00:00 2001 From: Dorian Stoll Date: Sun, 11 Dec 2022 12:03:38 +0100 Subject: [PATCH] iommu: intel: Disable source id verification for ITHC @@ -39,7 +39,7 @@ index e4a70886678c..961a33b87c24 100644 -- 2.46.0 -From 19a947aa5cc417bd43656cf9d8bf010abdc6bc3f Mon Sep 17 00:00:00 2001 +From 9f355143af2087aff4c4c1a6db46e6595e8ec5d4 Mon Sep 17 00:00:00 2001 From: quo Date: Sun, 11 Dec 2022 12:10:54 +0100 Subject: [PATCH] hid: Add support for Intel Touch Host Controller diff --git a/sys-kernel/surface-sources/files/6.10/0007-surface-sam.patch b/sys-kernel/surface-sources/files/6.10/0007-surface-sam.patch index 7eae091..13ebbe5 100644 --- a/sys-kernel/surface-sources/files/6.10/0007-surface-sam.patch +++ b/sys-kernel/surface-sources/files/6.10/0007-surface-sam.patch @@ -1,59 +1,4 @@ -From 17af44bcfe971e7b9dddad3735fad70bbda3fbf9 Mon Sep 17 00:00:00 2001 -From: Maximilian Luz -Date: Fri, 19 Apr 2024 20:41:47 +0200 -Subject: [PATCH] platform/surface: aggregator: Fix warning when controller is - destroyed in probe - -There is a small window in ssam_serial_hub_probe() where the controller -is initialized but has not been started yet. Specifically, between -ssam_controller_init() and ssam_controller_start(). Any failure in this -window, for example caused by a failure of serdev_device_open(), -currently results in an incorrect warning being emitted. - -In particular, any failure in this window results in the controller -being destroyed via ssam_controller_destroy(). This function checks the -state of the controller and, in an attempt to validate that the -controller has been cleanly shut down before we try and deallocate any -resources, emits a warning if that state is not SSAM_CONTROLLER_STOPPED. - -However, since we have only just initialized the controller and have not -yet started it, its state is SSAM_CONTROLLER_INITIALIZED. Note that this -is the only point at which the controller has this state, as it will -change after we start the controller with ssam_controller_start() and -never revert back. Further, at this point no communication has taken -place and the sender and receiver threads have not been started yet (and -we may not even have an open serdev device either). - -Therefore, it is perfectly safe to call ssam_controller_destroy() with a -state of SSAM_CONTROLLER_INITIALIZED. This, however, means that the -warning currently being emitted is incorrect. Fix it by extending the -check. - -Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") -Signed-off-by: Maximilian Luz -Patchset: surface-sam ---- - drivers/platform/surface/aggregator/controller.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c -index 7fc602e01487..7e89f547999b 100644 ---- a/drivers/platform/surface/aggregator/controller.c -+++ b/drivers/platform/surface/aggregator/controller.c -@@ -1354,7 +1354,8 @@ void ssam_controller_destroy(struct ssam_controller *ctrl) - if (ctrl->state == SSAM_CONTROLLER_UNINITIALIZED) - return; - -- WARN_ON(ctrl->state != SSAM_CONTROLLER_STOPPED); -+ WARN_ON(ctrl->state != SSAM_CONTROLLER_STOPPED && -+ ctrl->state != SSAM_CONTROLLER_INITIALIZED); - - /* - * Note: New events could still have been received after the previous --- -2.46.0 - -From 00b833401e8060eb50db269e0681383454a74848 Mon Sep 17 00:00:00 2001 +From 1c0c81136657ad8656e5d713d0d8282d70413e53 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 22 Oct 2023 14:57:11 +0200 Subject: [PATCH] platform/surface: aggregator_registry: Add support for @@ -86,7 +31,7 @@ index 1c4d74db08c9..f826489dc69d 100644 -- 2.46.0 -From 9e13165394bf1898d05c7d5a4a5adb1767d2307e Mon Sep 17 00:00:00 2001 +From 74e058609a1229cfd478690ae2ad0fbb209ee6ed Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 20 Nov 2023 19:47:00 +0100 Subject: [PATCH] platform/surface: aggregator_registry: Add support for @@ -156,7 +101,7 @@ index f826489dc69d..ef59a7b66667 100644 -- 2.46.0 -From 83719d2cd70ad6ac1df993782e757ded15e881cc Mon Sep 17 00:00:00 2001 +From 61ed1a703286c45a6f9de31053a8041e7e54cd4d Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 9 Jun 2024 20:05:57 +0200 Subject: [PATCH] platform/surface: aggregator_registry: Add support for @@ -174,7 +119,7 @@ Patchset: surface-sam 1 file changed, 19 insertions(+) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c -index ef59a7b66667..70a2ea5a1957 100644 +index ef59a7b66667..a20ccf49731c 100644 --- a/drivers/platform/surface/surface_aggregator_registry.c +++ b/drivers/platform/surface/surface_aggregator_registry.c @@ -273,6 +273,22 @@ static const struct software_node *ssam_node_group_sl5[] = { @@ -205,7 +150,7 @@ index ef59a7b66667..70a2ea5a1957 100644 { "MSHW0350", (unsigned long)ssam_node_group_sl5 }, + /* Surface Laptop 6 */ -+ { "MSHW0530", (unsigned long)ssam_node_group_sl5 }, ++ { "MSHW0530", (unsigned long)ssam_node_group_sl6 }, + /* Surface Laptop Go 1 */ { "MSHW0118", (unsigned long)ssam_node_group_slg1 }, @@ -213,7 +158,7 @@ index ef59a7b66667..70a2ea5a1957 100644 -- 2.46.0 -From c188646846cc6e9db1134eb62208d088ce615312 Mon Sep 17 00:00:00 2001 +From be2709e2a0ddebba3887d730a2e61b7bec2a06f2 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 30 Dec 2023 18:07:54 +0100 Subject: [PATCH] hwmon: Add thermal sensor driver for Surface Aggregator @@ -441,7 +386,7 @@ index 000000000000..48c3e826713f -- 2.46.0 -From 31d334453ebc65b7868bf33b1963553586e64fa3 Mon Sep 17 00:00:00 2001 +From 15ba0027e4d72f580255f8776ee251c94f81cab1 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 30 Dec 2023 18:12:23 +0100 Subject: [PATCH] hwmon: surface_temp: Add support for sensor names @@ -636,7 +581,7 @@ index 48c3e826713f..4c08926139db 100644 -- 2.46.0 -From 36174000616d130e9b4655d69eb3bd5b07adbecb Mon Sep 17 00:00:00 2001 +From b80e50b1a90e22d3a200b085cac567905e56543c Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 10 Jun 2024 21:47:47 +0200 Subject: [PATCH] platform/surface: aggregator_registry: Add fan and thermal @@ -648,7 +593,7 @@ Patchset: surface-sam 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c -index 70a2ea5a1957..6b568804f70b 100644 +index a20ccf49731c..2b20c74bbe6d 100644 --- a/drivers/platform/surface/surface_aggregator_registry.c +++ b/drivers/platform/surface/surface_aggregator_registry.c @@ -265,7 +265,9 @@ static const struct software_node *ssam_node_group_sl5[] = { @@ -665,7 +610,7 @@ index 70a2ea5a1957..6b568804f70b 100644 -- 2.46.0 -From e32f317be4ad620fb6683b62ad9e883f37e17f57 Mon Sep 17 00:00:00 2001 +From 06973bc3db29f5d009d4de6298e0496490c811ee Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 10 Jun 2024 21:48:02 +0200 Subject: [PATCH] platform/surface: aggregator_registry: Add fan and thermal @@ -677,7 +622,7 @@ Patchset: surface-sam 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c -index 6b568804f70b..9046df95c043 100644 +index 2b20c74bbe6d..1e7e7ebeb074 100644 --- a/drivers/platform/surface/surface_aggregator_registry.c +++ b/drivers/platform/surface/surface_aggregator_registry.c @@ -312,7 +312,9 @@ static const struct software_node *ssam_node_group_sls2[] = { @@ -694,7 +639,7 @@ index 6b568804f70b..9046df95c043 100644 -- 2.46.0 -From ebf64f6dcf1bdf0dbe80b5ec5e3d4b8a6cfab41e Mon Sep 17 00:00:00 2001 +From 01cab9f250e8dc4b6a2e784467487f7eb03e7afe Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 28 Jun 2024 22:31:37 +0200 Subject: [PATCH] platform/surface: aggregator_registry: Add Support for @@ -706,7 +651,7 @@ Patchset: surface-sam 1 file changed, 22 insertions(+) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c -index 9046df95c043..058f4edd8b66 100644 +index 1e7e7ebeb074..ec9eb4d375b9 100644 --- a/drivers/platform/surface/surface_aggregator_registry.c +++ b/drivers/platform/surface/surface_aggregator_registry.c @@ -377,6 +377,25 @@ static const struct software_node *ssam_node_group_sp9[] = { diff --git a/sys-kernel/surface-sources/files/6.10/0008-surface-sam-over-hid.patch b/sys-kernel/surface-sources/files/6.10/0008-surface-sam-over-hid.patch index d07a285..43c028a 100644 --- a/sys-kernel/surface-sources/files/6.10/0008-surface-sam-over-hid.patch +++ b/sys-kernel/surface-sources/files/6.10/0008-surface-sam-over-hid.patch @@ -1,4 +1,4 @@ -From 8dac7a369f2f1c461750a3c3f6d93caae9566ace Mon Sep 17 00:00:00 2001 +From 6e7285d272dd52c42f6e2f17264a88abe8460a99 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 25 Jul 2020 17:19:53 +0200 Subject: [PATCH] i2c: acpi: Implement RawBytes read access @@ -51,14 +51,14 @@ quirk-like interface into the I2C core. Signed-off-by: Maximilian Luz Patchset: surface-sam-over-hid --- - drivers/i2c/i2c-core-acpi.c | 35 +++++++++++++++++++++++++++++++++++ - 1 file changed, 35 insertions(+) + drivers/i2c/i2c-core-acpi.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c -index 14ae0cfc325e..a3a9f81fb47f 100644 +index 14ae0cfc325e..6197c5252d2a 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c -@@ -639,6 +639,28 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client, +@@ -639,6 +639,27 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client, return (ret == 1) ? 0 : -EIO; } @@ -66,7 +66,7 @@ index 14ae0cfc325e..a3a9f81fb47f 100644 + u8 *data, u8 data_len) +{ + struct i2c_msg msgs[1]; -+ int ret = AE_OK; ++ int ret; + + msgs[0].addr = client->addr; + msgs[0].flags = client->flags; @@ -74,7 +74,6 @@ index 14ae0cfc325e..a3a9f81fb47f 100644 + msgs[0].buf = data; + + ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); -+ + if (ret < 0) { + dev_err(&client->adapter->dev, "i2c write failed: %d\n", ret); + return ret; @@ -87,7 +86,7 @@ index 14ae0cfc325e..a3a9f81fb47f 100644 static acpi_status i2c_acpi_space_handler(u32 function, acpi_physical_address command, u32 bits, u64 *value64, -@@ -740,6 +762,19 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command, +@@ -740,6 +761,19 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command, } break; @@ -110,7 +109,7 @@ index 14ae0cfc325e..a3a9f81fb47f 100644 -- 2.46.0 -From fe964119c511036a560d1dfcbec1196ae4ed1621 Mon Sep 17 00:00:00 2001 +From 0ce0983a58d19778a010c55e6ca16e344a28b4a1 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 13 Feb 2021 16:41:18 +0100 Subject: [PATCH] platform/surface: Add driver for Surface Book 1 dGPU switch @@ -128,8 +127,8 @@ Patchset: surface-sam-over-hid --- drivers/platform/surface/Kconfig | 7 + drivers/platform/surface/Makefile | 1 + - .../surface/surfacebook1_dgpu_switch.c | 162 ++++++++++++++++++ - 3 files changed, 170 insertions(+) + .../surface/surfacebook1_dgpu_switch.c | 136 ++++++++++++++++++ + 3 files changed, 144 insertions(+) create mode 100644 drivers/platform/surface/surfacebook1_dgpu_switch.c diff --git a/drivers/platform/surface/Kconfig b/drivers/platform/surface/Kconfig @@ -164,35 +163,28 @@ index 53344330939b..7efcd0cdb532 100644 obj-$(CONFIG_SURFACE_HOTPLUG) += surface_hotplug.o diff --git a/drivers/platform/surface/surfacebook1_dgpu_switch.c b/drivers/platform/surface/surfacebook1_dgpu_switch.c new file mode 100644 -index 000000000000..8b816ed8f35c +index 000000000000..68db237734a1 --- /dev/null +++ b/drivers/platform/surface/surfacebook1_dgpu_switch.c -@@ -0,0 +1,162 @@ +@@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + -+#include +#include +#include +#include + -+ -+#ifdef pr_fmt -+#undef pr_fmt -+#endif -+#define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__ -+ -+ -+static const guid_t dgpu_sw_guid = GUID_INIT(0x6fd05c69, 0xcde3, 0x49f4, -+ 0x95, 0xed, 0xab, 0x16, 0x65, 0x49, 0x80, 0x35); ++/* MSHW0040/VGBI DSM UUID: 6fd05c69-cde3-49f4-95ed-ab1665498035 */ ++static const guid_t dgpu_sw_guid = ++ GUID_INIT(0x6fd05c69, 0xcde3, 0x49f4, ++ 0x95, 0xed, 0xab, 0x16, 0x65, 0x49, 0x80, 0x35); + +#define DGPUSW_ACPI_PATH_DSM "\\_SB_.PCI0.LPCB.EC0_.VGBI" +#define DGPUSW_ACPI_PATH_HGON "\\_SB_.PCI0.RP05.HGON" +#define DGPUSW_ACPI_PATH_HGOF "\\_SB_.PCI0.RP05.HGOF" + -+ +static int sb1_dgpu_sw_dsmcall(void) +{ -+ union acpi_object *ret; ++ union acpi_object *obj; + acpi_handle handle; + acpi_status status; + @@ -200,67 +192,66 @@ index 000000000000..8b816ed8f35c + if (status) + return -EINVAL; + -+ ret = acpi_evaluate_dsm_typed(handle, &dgpu_sw_guid, 1, 1, NULL, ACPI_TYPE_BUFFER); -+ if (!ret) ++ obj = acpi_evaluate_dsm_typed(handle, &dgpu_sw_guid, 1, 1, NULL, ACPI_TYPE_BUFFER); ++ if (!obj) + return -EINVAL; + -+ ACPI_FREE(ret); ++ ACPI_FREE(obj); + return 0; +} + -+static int sb1_dgpu_sw_hgon(void) ++static int sb1_dgpu_sw_hgon(struct device *dev) +{ + struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_status status; + + status = acpi_evaluate_object(NULL, DGPUSW_ACPI_PATH_HGON, NULL, &buf); + if (status) { -+ pr_err("failed to run HGON: %d\n", status); ++ dev_err(dev, "failed to run HGON: %d\n", status); + return -EINVAL; + } + -+ if (buf.pointer) -+ ACPI_FREE(buf.pointer); ++ ACPI_FREE(buf.pointer); + -+ pr_info("turned-on dGPU via HGON\n"); ++ dev_info(dev, "turned-on dGPU via HGON\n"); + return 0; +} + -+static int sb1_dgpu_sw_hgof(void) ++static int sb1_dgpu_sw_hgof(struct device *dev) +{ + struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL}; + acpi_status status; + + status = acpi_evaluate_object(NULL, DGPUSW_ACPI_PATH_HGOF, NULL, &buf); + if (status) { -+ pr_err("failed to run HGOF: %d\n", status); ++ dev_err(dev, "failed to run HGOF: %d\n", status); + return -EINVAL; + } + -+ if (buf.pointer) -+ ACPI_FREE(buf.pointer); ++ ACPI_FREE(buf.pointer); + -+ pr_info("turned-off dGPU via HGOF\n"); ++ dev_info(dev, "turned-off dGPU via HGOF\n"); + return 0; +} + -+ +static ssize_t dgpu_dsmcall_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) +{ -+ int status, value; ++ bool value; ++ int status; + -+ status = kstrtoint(buf, 0, &value); ++ status = kstrtobool(buf, &value); + if (status < 0) + return status; + -+ if (value != 1) -+ return -EINVAL; ++ if (!value) ++ return 0; + + status = sb1_dgpu_sw_dsmcall(); + + return status < 0 ? status : len; +} ++static DEVICE_ATTR_WO(dgpu_dsmcall); + +static ssize_t dgpu_power_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) @@ -273,37 +264,20 @@ index 000000000000..8b816ed8f35c + return status; + + if (power) -+ status = sb1_dgpu_sw_hgon(); ++ status = sb1_dgpu_sw_hgon(dev); + else -+ status = sb1_dgpu_sw_hgof(); ++ status = sb1_dgpu_sw_hgof(dev); + + return status < 0 ? status : len; +} -+ -+static DEVICE_ATTR_WO(dgpu_dsmcall); +static DEVICE_ATTR_WO(dgpu_power); + +static struct attribute *sb1_dgpu_sw_attrs[] = { + &dev_attr_dgpu_dsmcall.attr, + &dev_attr_dgpu_power.attr, -+ NULL, ++ NULL +}; -+ -+static const struct attribute_group sb1_dgpu_sw_attr_group = { -+ .attrs = sb1_dgpu_sw_attrs, -+}; -+ -+ -+static int sb1_dgpu_sw_probe(struct platform_device *pdev) -+{ -+ return sysfs_create_group(&pdev->dev.kobj, &sb1_dgpu_sw_attr_group); -+} -+ -+static int sb1_dgpu_sw_remove(struct platform_device *pdev) -+{ -+ sysfs_remove_group(&pdev->dev.kobj, &sb1_dgpu_sw_attr_group); -+ return 0; -+} ++ATTRIBUTE_GROUPS(sb1_dgpu_sw); + +/* + * The dGPU power seems to be actually handled by MSHW0040. However, that is @@ -312,17 +286,16 @@ index 000000000000..8b816ed8f35c + */ +static const struct acpi_device_id sb1_dgpu_sw_match[] = { + { "MSHW0041", }, -+ { }, ++ { } +}; +MODULE_DEVICE_TABLE(acpi, sb1_dgpu_sw_match); + +static struct platform_driver sb1_dgpu_sw = { -+ .probe = sb1_dgpu_sw_probe, -+ .remove = sb1_dgpu_sw_remove, + .driver = { + .name = "surfacebook1_dgpu_switch", + .acpi_match_table = sb1_dgpu_sw_match, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, ++ .dev_groups = sb1_dgpu_sw_groups, + }, +}; +module_platform_driver(sb1_dgpu_sw); diff --git a/sys-kernel/surface-sources/files/6.10/0009-surface-button.patch b/sys-kernel/surface-sources/files/6.10/0009-surface-button.patch index 34a615d..7a8f8ac 100644 --- a/sys-kernel/surface-sources/files/6.10/0009-surface-button.patch +++ b/sys-kernel/surface-sources/files/6.10/0009-surface-button.patch @@ -1,4 +1,4 @@ -From d811fb8e32e1327baf131c85522aee281f4281af Mon Sep 17 00:00:00 2001 +From 81f45954e36d6ce9e5f217bde8149cb3f5d1ff6c Mon Sep 17 00:00:00 2001 From: Sachi King Date: Tue, 5 Oct 2021 00:05:09 +1100 Subject: [PATCH] Input: soc_button_array - support AMD variant Surface devices @@ -75,7 +75,7 @@ index f6d060377d18..b8603f74eb28 100644 -- 2.46.0 -From e21138766921f4a22e710b4858f75f98e308c61d Mon Sep 17 00:00:00 2001 +From 94aa734ec2fd6eef10ae5155c1ba2e6d063f73f8 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Tue, 5 Oct 2021 00:22:57 +1100 Subject: [PATCH] platform/surface: surfacepro3_button: don't load on amd diff --git a/sys-kernel/surface-sources/files/6.10/0010-surface-typecover.patch b/sys-kernel/surface-sources/files/6.10/0010-surface-typecover.patch index cad4656..7cd7e1e 100644 --- a/sys-kernel/surface-sources/files/6.10/0010-surface-typecover.patch +++ b/sys-kernel/surface-sources/files/6.10/0010-surface-typecover.patch @@ -1,4 +1,4 @@ -From a19b7328ccb6c090354593fa039e5283140a5e69 Mon Sep 17 00:00:00 2001 +From 1525b314caae3999007352990890172d87358d8c Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sat, 18 Feb 2023 01:02:49 +0100 Subject: [PATCH] USB: quirks: Add USB_QUIRK_DELAY_INIT for Surface Go 3 @@ -39,7 +39,7 @@ index 13171454f959..a83beefd25f3 100644 -- 2.46.0 -From 99fb371b3a11e3c3d67d29673508911b81a1408c Mon Sep 17 00:00:00 2001 +From 0e0e42f91887b34bb83cc84d29228b7464001558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 5 Nov 2020 13:09:45 +0100 Subject: [PATCH] hid/multitouch: Turn off Type Cover keyboard backlight when @@ -272,7 +272,7 @@ index 56fc78841f24..a266449065a0 100644 -- 2.46.0 -From 7b797164a3f2ecf402b8f24d5123e74914b09064 Mon Sep 17 00:00:00 2001 +From 393718e523dac04097a037778d4896e88b4a0d96 Mon Sep 17 00:00:00 2001 From: PJungkamp Date: Fri, 25 Feb 2022 12:04:25 +0100 Subject: [PATCH] hid/multitouch: Add support for surface pro type cover tablet diff --git a/sys-kernel/surface-sources/files/6.10/0011-surface-shutdown.patch b/sys-kernel/surface-sources/files/6.10/0011-surface-shutdown.patch index 87316e4..f8cebf0 100644 --- a/sys-kernel/surface-sources/files/6.10/0011-surface-shutdown.patch +++ b/sys-kernel/surface-sources/files/6.10/0011-surface-shutdown.patch @@ -1,4 +1,4 @@ -From e26e0570db9e2dbb37e075ef7a88270fe793fb94 Mon Sep 17 00:00:00 2001 +From 85df3c0422688b4010a1cd9079511b1a0e2b38a8 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 19 Feb 2023 22:12:24 +0100 Subject: [PATCH] PCI: Add quirk to prevent calling shutdown mehtod diff --git a/sys-kernel/surface-sources/files/6.10/0012-surface-gpe.patch b/sys-kernel/surface-sources/files/6.10/0012-surface-gpe.patch index 0dd835c..a6da37a 100644 --- a/sys-kernel/surface-sources/files/6.10/0012-surface-gpe.patch +++ b/sys-kernel/surface-sources/files/6.10/0012-surface-gpe.patch @@ -1,4 +1,4 @@ -From bed56a2a67db8c5934008ed83fa0bbd71360ab02 Mon Sep 17 00:00:00 2001 +From e17a29ddcf58b4e9b43234c8ad4b6a73fddbe0d4 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Sun, 12 Mar 2023 01:41:57 +0100 Subject: [PATCH] platform/surface: gpe: Add support for Surface Pro 9 diff --git a/sys-kernel/surface-sources/files/6.10/0013-cameras.patch b/sys-kernel/surface-sources/files/6.10/0013-cameras.patch index 9f36fc5..9a6b91e 100644 --- a/sys-kernel/surface-sources/files/6.10/0013-cameras.patch +++ b/sys-kernel/surface-sources/files/6.10/0013-cameras.patch @@ -1,4 +1,4 @@ -From 0a70aafbfa7ad39054c0974e428935c9d9e48cf1 Mon Sep 17 00:00:00 2001 +From 6a5e5f7496e5e5a86dd43da8bdf955fb2cb330e5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 10 Oct 2021 20:56:57 +0200 Subject: [PATCH] ACPI: delay enumeration of devices with a _DEP pointing to an @@ -58,7 +58,7 @@ Patchset: cameras 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 503773707e01..a292a20c4315 100644 +index cdc5a74092c7..e3a16c14a29e 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2176,6 +2176,9 @@ static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, @@ -74,7 +74,7 @@ index 503773707e01..a292a20c4315 100644 -- 2.46.0 -From bdae5b6a0e462398fa6035a2f0de8efae144abe4 Mon Sep 17 00:00:00 2001 +From 839e164bf1650a36b9c5c955035e900cdea017da Mon Sep 17 00:00:00 2001 From: zouxiaoh Date: Fri, 25 Jun 2021 08:52:59 +0800 Subject: [PATCH] iommu: intel-ipu: use IOMMU passthrough mode for Intel IPUs @@ -100,7 +100,7 @@ Patchset: cameras 1 file changed, 30 insertions(+) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c -index 8d95579436a9..cbfb59ed5985 100644 +index 6ee97bf7b6a9..a1f86bde277a 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -45,6 +45,13 @@ @@ -184,7 +184,7 @@ index 8d95579436a9..cbfb59ed5985 100644 -- 2.46.0 -From aa044fab288ddf51ad963effe090d0b548d83243 Mon Sep 17 00:00:00 2001 +From b9a1edc6bbf4fa65e14a530bf353fea2838cafc6 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Sun, 10 Oct 2021 20:57:02 +0200 Subject: [PATCH] platform/x86: int3472: Enable I2c daisy chain @@ -221,7 +221,7 @@ index 1e107fd49f82..e3e1696e7f0e 100644 -- 2.46.0 -From 12da0a015e6d71071561668950a4fb5e33220af8 Mon Sep 17 00:00:00 2001 +From 139109dc8f358284091d856e8c8a96117a359d8e Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 2 Mar 2023 12:59:39 +0000 Subject: [PATCH] platform/x86: int3472: Remap reset GPIO for INT347E @@ -239,19 +239,20 @@ polarity of the pin to match the driver's expectation. Signed-off-by: Daniel Scally Patchset: cameras --- - drivers/platform/x86/intel/int3472/discrete.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) + drivers/platform/x86/intel/int3472/discrete.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c -index 07b302e09340..1d3097bc7e48 100644 +index 07b302e09340..baad1e50ca81 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c -@@ -83,12 +83,26 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347 +@@ -83,12 +83,27 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347 const char *func, u32 polarity) { int ret; + const struct acpi_device_id ov7251_ids[] = { + { "INT347E" }, ++ { } + }; if (int3472->n_sensor_gpios >= INT3472_MAX_SENSOR_GPIOS) { @@ -267,7 +268,7 @@ index 07b302e09340..1d3097bc7e48 100644 + */ + if (!strcmp(func, "reset") && !acpi_match_device_ids(int3472->sensor, ov7251_ids)) { + func = "enable"; -+ polarity = GPIO_ACTIVE_HIGH; ++ polarity ^= GPIO_ACTIVE_LOW; + } + ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios], @@ -276,7 +277,7 @@ index 07b302e09340..1d3097bc7e48 100644 -- 2.46.0 -From ddc65d1014592b1fe4d6e16c9badcc928e577b3b Mon Sep 17 00:00:00 2001 +From 8d89dfb5a37b9bf23909612e70cded7e0e6713fe Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 21 Mar 2023 13:45:26 +0000 Subject: [PATCH] media: i2c: Clarify that gain is Analogue gain in OV7251 @@ -315,7 +316,7 @@ index 30f61e04ecaf..9c1292ca8552 100644 -- 2.46.0 -From ea560c5a7e55695438ac99fbd363352991fe62af Mon Sep 17 00:00:00 2001 +From b528a28460ee1cd74d6a5c9fd156cd3275124610 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 22 Mar 2023 11:01:42 +0000 Subject: [PATCH] media: v4l2-core: Acquire privacy led in @@ -366,7 +367,7 @@ index 89c7192148df..44eca113e772 100644 -- 2.46.0 -From 0c59f9eee1c8dc8ea4d99f8b1a07b342ef5e425d Mon Sep 17 00:00:00 2001 +From a906d692dab6a3d74a30e3d92b8419bfa0745a33 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 21 Mar 2023 23:37:16 +0800 Subject: [PATCH] platform: x86: int3472: Add MFD cell for tps68470 LED @@ -407,7 +408,7 @@ index e3e1696e7f0e..423dc555093f 100644 -- 2.46.0 -From 8f69fe36b3d6052c7f41182041fc59ea84515066 Mon Sep 17 00:00:00 2001 +From 7279c37203fd8439ffc90a4f1c99eb27d8ff464d Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 21 Mar 2023 23:37:17 +0800 Subject: [PATCH] include: mfd: tps68470: Add masks for LEDA and LEDB @@ -448,7 +449,7 @@ index 7807fa329db0..2d2abb25b944 100644 -- 2.46.0 -From 457ccb4dad651a58bc24e4c49fcc95a81e3762bb Mon Sep 17 00:00:00 2001 +From 0d85a585d28cfb76cbc38e1ea8074cdacd326870 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 21 Mar 2023 23:37:18 +0800 Subject: [PATCH] leds: tps68470: Add LED control for tps68470 @@ -699,7 +700,7 @@ index 000000000000..35aeb5db89c8 -- 2.46.0 -From 281dcaef04abcc6a75b34c6f69f8f608b68912cf Mon Sep 17 00:00:00 2001 +From 611abcaeefb87f8987923ed404b8838ce57b21d6 Mon Sep 17 00:00:00 2001 From: mojyack Date: Sat, 3 Feb 2024 12:59:53 +0900 Subject: [PATCH] media: staging: ipu3-imgu: Fix multiple calls of s_stream on @@ -746,7 +747,7 @@ index 3df58eb3e882..81aff2d5d898 100644 -- 2.46.0 -From f1d09776b3c5026bfd4d035bbca5be3f8e41b247 Mon Sep 17 00:00:00 2001 +From bbe048ba6ea217036f92883be3d09f4fc247bdee Mon Sep 17 00:00:00 2001 From: mojyack Date: Tue, 26 Mar 2024 05:55:44 +0900 Subject: [PATCH] media: i2c: dw9719: fix probe error on surface go 2 diff --git a/sys-kernel/surface-sources/files/6.10/0014-amd-gpio.patch b/sys-kernel/surface-sources/files/6.10/0014-amd-gpio.patch index b1a3d0a..8dead83 100644 --- a/sys-kernel/surface-sources/files/6.10/0014-amd-gpio.patch +++ b/sys-kernel/surface-sources/files/6.10/0014-amd-gpio.patch @@ -1,4 +1,4 @@ -From 29121bd1e5b235572d56645abdb8f54a31bf476e Mon Sep 17 00:00:00 2001 +From 0b1d6ca9adc2621316781008a79b1e55672aa5ef Mon Sep 17 00:00:00 2001 From: Sachi King Date: Sat, 29 May 2021 17:47:38 +1000 Subject: [PATCH] ACPI: Add quirk for Surface Laptop 4 AMD missing irq 7 @@ -65,7 +65,7 @@ index 4bf82dbd2a6b..7a8cb090c656 100644 -- 2.46.0 -From f8d58835a76ce8ea016c0fcd75ddb93a95ca14c6 Mon Sep 17 00:00:00 2001 +From 008236d27babab8799a0fdd7c4c43a85df14c07f Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Thu, 3 Jun 2021 14:04:26 +0200 Subject: [PATCH] ACPI: Add AMD 13" Surface Laptop 4 model to irq 7 override diff --git a/sys-kernel/surface-sources/files/6.10/0015-rtc.patch b/sys-kernel/surface-sources/files/6.10/0015-rtc.patch index 78e2d0b..43b9f9a 100644 --- a/sys-kernel/surface-sources/files/6.10/0015-rtc.patch +++ b/sys-kernel/surface-sources/files/6.10/0015-rtc.patch @@ -1,4 +1,4 @@ -From 5c662b210790b2b297457de3e84274cc062b215e Mon Sep 17 00:00:00 2001 +From b12b4bf1a7d71d78f938b815ed59784efc46d932 Mon Sep 17 00:00:00 2001 From: "Bart Groeneveld | GPX Solutions B.V" Date: Mon, 5 Dec 2022 16:08:46 +0100 Subject: [PATCH] acpi: allow usage of acpi_tad on HW-reduced platforms