From 90f0d914260faf094ab488945e2654279be999a1 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Mon, 20 Feb 2023 00:54:19 +0100 Subject: [PATCH] Update v6.1 patches Changes: - Add support for tablet-mode switch on the Surface Pro 9. - Add workaround for shutdown issue on the Surface Pro 9. Links: - kernel: https://github.com/linux-surface/kernel/commit/cdc452b5b59544741d74966c1342d467157f9409 --- patches/6.1/0006-surface-sam.patch | 394 +++++++++++++++++- patches/6.1/0007-surface-sam-over-hid.patch | 4 +- patches/6.1/0008-surface-button.patch | 4 +- patches/6.1/0009-surface-typecover.patch | 6 +- patches/6.1/0010-surface-shutdown.patch | 89 ++++ ...{0010-cameras.patch => 0011-cameras.patch} | 14 +- ...011-amd-gpio.patch => 0012-amd-gpio.patch} | 4 +- .../6.1/{0012-rtc.patch => 0013-rtc.patch} | 2 +- 8 files changed, 499 insertions(+), 18 deletions(-) create mode 100644 patches/6.1/0010-surface-shutdown.patch rename patches/6.1/{0010-cameras.patch => 0011-cameras.patch} (98%) rename patches/6.1/{0011-amd-gpio.patch => 0012-amd-gpio.patch} (96%) rename patches/6.1/{0012-rtc.patch => 0013-rtc.patch} (98%) diff --git a/patches/6.1/0006-surface-sam.patch b/patches/6.1/0006-surface-sam.patch index 77251455d..b3a612351 100644 --- a/patches/6.1/0006-surface-sam.patch +++ b/patches/6.1/0006-surface-sam.patch @@ -1517,7 +1517,7 @@ index 4da20b7a0ee5..1545e5567b15 100644 -- 2.39.2 -From a3630302405e109c42ae70d286cf2c6d58228647 Mon Sep 17 00:00:00 2001 +From 0b997ce9e5ff0895e800bbac246df42640d4e9f2 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 18 Jan 2023 11:38:23 +0200 Subject: [PATCH] platform/surface: Switch to use acpi_evaluate_dsm_typed() @@ -1573,3 +1573,395 @@ index f004a2495201..7b6d887dccdb 100644 -- 2.39.2 +From ab5997218000df64c83f9125559f322c0e33cfc6 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sun, 19 Feb 2023 23:33:43 +0100 +Subject: [PATCH] platform/surface: aggregator_tabletsw: Add support for + Type-Cover posture source + +The POS-subsystem can provide different sources for querying device +posture states and receiving posture-change events. We use this +subsystem to implement tablet-mode events on newer Surface devices. + +Currently, however, the driver only implements support for the Surface +Laptop Studio, with source ID 0. This has been hard-coded. Therefore, +make the driver more flexible to support more source types and also +implement support for the Type-Cover source type found on the Surface +Pro 9. + +Signed-off-by: Maximilian Luz +Patchset: surface-sam +--- + .../surface/surface_aggregator_tabletsw.c | 180 ++++++++++++++---- + 1 file changed, 141 insertions(+), 39 deletions(-) + +diff --git a/drivers/platform/surface/surface_aggregator_tabletsw.c b/drivers/platform/surface/surface_aggregator_tabletsw.c +index 9fed800c7cc0..8f52b62d1c19 100644 +--- a/drivers/platform/surface/surface_aggregator_tabletsw.c ++++ b/drivers/platform/surface/surface_aggregator_tabletsw.c +@@ -20,16 +20,23 @@ + + struct ssam_tablet_sw; + ++struct ssam_tablet_sw_state { ++ u32 source; ++ u32 state; ++}; ++ + struct ssam_tablet_sw_ops { +- int (*get_state)(struct ssam_tablet_sw *sw, u32 *state); +- const char *(*state_name)(struct ssam_tablet_sw *sw, u32 state); +- bool (*state_is_tablet_mode)(struct ssam_tablet_sw *sw, u32 state); ++ int (*get_state)(struct ssam_tablet_sw *sw, struct ssam_tablet_sw_state *state); ++ const char *(*state_name)(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state); ++ bool (*state_is_tablet_mode)(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state); + }; + + struct ssam_tablet_sw { + struct ssam_device *sdev; + +- u32 state; ++ struct ssam_tablet_sw_state state; + struct work_struct update_work; + struct input_dev *mode_switch; + +@@ -45,9 +52,11 @@ struct ssam_tablet_sw_desc { + + struct { + u32 (*notify)(struct ssam_event_notifier *nf, const struct ssam_event *event); +- int (*get_state)(struct ssam_tablet_sw *sw, u32 *state); +- const char *(*state_name)(struct ssam_tablet_sw *sw, u32 state); +- bool (*state_is_tablet_mode)(struct ssam_tablet_sw *sw, u32 state); ++ int (*get_state)(struct ssam_tablet_sw *sw, struct ssam_tablet_sw_state *state); ++ const char *(*state_name)(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state); ++ bool (*state_is_tablet_mode)(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state); + } ops; + + struct { +@@ -61,7 +70,7 @@ struct ssam_tablet_sw_desc { + static ssize_t state_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct ssam_tablet_sw *sw = dev_get_drvdata(dev); +- const char *state = sw->ops.state_name(sw, sw->state); ++ const char *state = sw->ops.state_name(sw, &sw->state); + + return sysfs_emit(buf, "%s\n", state); + } +@@ -79,19 +88,19 @@ static const struct attribute_group ssam_tablet_sw_group = { + static void ssam_tablet_sw_update_workfn(struct work_struct *work) + { + struct ssam_tablet_sw *sw = container_of(work, struct ssam_tablet_sw, update_work); ++ struct ssam_tablet_sw_state state; + int tablet, status; +- u32 state; + + status = sw->ops.get_state(sw, &state); + if (status) + return; + +- if (sw->state == state) ++ if (sw->state.source == state.source && sw->state.state == state.state) + return; + sw->state = state; + + /* Send SW_TABLET_MODE event. */ +- tablet = sw->ops.state_is_tablet_mode(sw, state); ++ tablet = sw->ops.state_is_tablet_mode(sw, &state); + input_report_switch(sw->mode_switch, SW_TABLET_MODE, tablet); + input_sync(sw->mode_switch); + } +@@ -146,7 +155,7 @@ static int ssam_tablet_sw_probe(struct ssam_device *sdev) + sw->mode_switch->id.bustype = BUS_HOST; + sw->mode_switch->dev.parent = &sdev->dev; + +- tablet = sw->ops.state_is_tablet_mode(sw, sw->state); ++ tablet = sw->ops.state_is_tablet_mode(sw, &sw->state); + input_set_capability(sw->mode_switch, EV_SW, SW_TABLET_MODE); + input_report_switch(sw->mode_switch, SW_TABLET_MODE, tablet); + +@@ -203,9 +212,10 @@ enum ssam_kip_cover_state { + SSAM_KIP_COVER_STATE_FOLDED_BACK = 0x05, + }; + +-static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw, u32 state) ++static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state) + { +- switch (state) { ++ switch (state->state) { + case SSAM_KIP_COVER_STATE_DISCONNECTED: + return "disconnected"; + +@@ -222,14 +232,15 @@ static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw, u32 stat + return "folded-back"; + + default: +- dev_warn(&sw->sdev->dev, "unknown KIP cover state: %u\n", state); ++ dev_warn(&sw->sdev->dev, "unknown KIP cover state: %u\n", state->state); + return ""; + } + } + +-static bool ssam_kip_cover_state_is_tablet_mode(struct ssam_tablet_sw *sw, u32 state) ++static bool ssam_kip_cover_state_is_tablet_mode(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state) + { +- switch (state) { ++ switch (state->state) { + case SSAM_KIP_COVER_STATE_DISCONNECTED: + case SSAM_KIP_COVER_STATE_FOLDED_CANVAS: + case SSAM_KIP_COVER_STATE_FOLDED_BACK: +@@ -240,7 +251,7 @@ static bool ssam_kip_cover_state_is_tablet_mode(struct ssam_tablet_sw *sw, u32 s + return false; + + default: +- dev_warn(&sw->sdev->dev, "unknown KIP cover state: %d\n", sw->state); ++ dev_warn(&sw->sdev->dev, "unknown KIP cover state: %d\n", state->state); + return true; + } + } +@@ -252,7 +263,7 @@ SSAM_DEFINE_SYNC_REQUEST_R(__ssam_kip_get_cover_state, u8, { + .instance_id = 0x00, + }); + +-static int ssam_kip_get_cover_state(struct ssam_tablet_sw *sw, u32 *state) ++static int ssam_kip_get_cover_state(struct ssam_tablet_sw *sw, struct ssam_tablet_sw_state *state) + { + int status; + u8 raw; +@@ -263,7 +274,8 @@ static int ssam_kip_get_cover_state(struct ssam_tablet_sw *sw, u32 *state) + return status; + } + +- *state = raw; ++ state->source = 0; /* Unused for KIP switch. */ ++ state->state = raw; + return 0; + } + +@@ -312,11 +324,24 @@ MODULE_PARM_DESC(tablet_mode_in_slate_state, "Enable tablet mode in slate device + #define SSAM_EVENT_POS_CID_POSTURE_CHANGED 0x03 + #define SSAM_POS_MAX_SOURCES 4 + +-enum ssam_pos_state { +- SSAM_POS_POSTURE_LID_CLOSED = 0x00, +- SSAM_POS_POSTURE_LAPTOP = 0x01, +- SSAM_POS_POSTURE_SLATE = 0x02, +- SSAM_POS_POSTURE_TABLET = 0x03, ++enum ssam_pos_source_id { ++ SSAM_POS_SOURCE_COVER = 0x00, ++ SSAM_POS_SOURCE_SLS = 0x03, ++}; ++ ++enum ssam_pos_state_cover { ++ SSAM_POS_COVER_DISCONNECTED = 0x01, ++ SSAM_POS_COVER_CLOSED = 0x02, ++ SSAM_POS_COVER_LAPTOP = 0x03, ++ SSAM_POS_COVER_FOLDED_CANVAS = 0x04, ++ SSAM_POS_COVER_FOLDED_BACK = 0x05, ++}; ++ ++enum ssam_pos_state_sls { ++ SSAM_POS_SLS_LID_CLOSED = 0x00, ++ SSAM_POS_SLS_LAPTOP = 0x01, ++ SSAM_POS_SLS_SLATE = 0x02, ++ SSAM_POS_SLS_TABLET = 0x03, + }; + + struct ssam_sources_list { +@@ -324,42 +349,116 @@ struct ssam_sources_list { + __le32 id[SSAM_POS_MAX_SOURCES]; + } __packed; + +-static const char *ssam_pos_state_name(struct ssam_tablet_sw *sw, u32 state) ++static const char *ssam_pos_state_name_cover(struct ssam_tablet_sw *sw, u32 state) ++{ ++ switch (state) { ++ case SSAM_POS_COVER_DISCONNECTED: ++ return "disconnected"; ++ ++ case SSAM_POS_COVER_CLOSED: ++ return "closed"; ++ ++ case SSAM_POS_COVER_LAPTOP: ++ return "laptop"; ++ ++ case SSAM_POS_COVER_FOLDED_CANVAS: ++ return "folded-canvas"; ++ ++ case SSAM_POS_COVER_FOLDED_BACK: ++ return "folded-back"; ++ ++ default: ++ dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state); ++ return ""; ++ } ++} ++ ++static const char *ssam_pos_state_name_sls(struct ssam_tablet_sw *sw, u32 state) + { + switch (state) { +- case SSAM_POS_POSTURE_LID_CLOSED: ++ case SSAM_POS_SLS_LID_CLOSED: + return "closed"; + +- case SSAM_POS_POSTURE_LAPTOP: ++ case SSAM_POS_SLS_LAPTOP: + return "laptop"; + +- case SSAM_POS_POSTURE_SLATE: ++ case SSAM_POS_SLS_SLATE: + return "slate"; + +- case SSAM_POS_POSTURE_TABLET: ++ case SSAM_POS_SLS_TABLET: + return "tablet"; + + default: +- dev_warn(&sw->sdev->dev, "unknown device posture: %u\n", state); ++ dev_warn(&sw->sdev->dev, "unknown device posture for SLS: %u\n", state); + return ""; + } + } + +-static bool ssam_pos_state_is_tablet_mode(struct ssam_tablet_sw *sw, u32 state) ++static const char *ssam_pos_state_name(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state) ++{ ++ switch (state->source) { ++ case SSAM_POS_SOURCE_COVER: ++ return ssam_pos_state_name_cover(sw, state->state); ++ ++ case SSAM_POS_SOURCE_SLS: ++ return ssam_pos_state_name_sls(sw, state->state); ++ ++ default: ++ dev_warn(&sw->sdev->dev, "unknown device posture source: %u\n", state->source); ++ return ""; ++ } ++} ++ ++static bool ssam_pos_state_is_tablet_mode_cover(struct ssam_tablet_sw *sw, u32 state) + { + switch (state) { +- case SSAM_POS_POSTURE_LAPTOP: +- case SSAM_POS_POSTURE_LID_CLOSED: ++ case SSAM_POS_COVER_DISCONNECTED: ++ case SSAM_POS_COVER_FOLDED_CANVAS: ++ case SSAM_POS_COVER_FOLDED_BACK: ++ return true; ++ ++ case SSAM_POS_COVER_CLOSED: ++ case SSAM_POS_COVER_LAPTOP: + return false; + +- case SSAM_POS_POSTURE_SLATE: ++ default: ++ dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state); ++ return true; ++ } ++} ++ ++static bool ssam_pos_state_is_tablet_mode_sls(struct ssam_tablet_sw *sw, u32 state) ++{ ++ switch (state) { ++ case SSAM_POS_SLS_LAPTOP: ++ case SSAM_POS_SLS_LID_CLOSED: ++ return false; ++ ++ case SSAM_POS_SLS_SLATE: + return tablet_mode_in_slate_state; + +- case SSAM_POS_POSTURE_TABLET: ++ case SSAM_POS_SLS_TABLET: + return true; + + default: +- dev_warn(&sw->sdev->dev, "unknown device posture: %u\n", state); ++ dev_warn(&sw->sdev->dev, "unknown device posture for SLS: %u\n", state); ++ return true; ++ } ++} ++ ++static bool ssam_pos_state_is_tablet_mode(struct ssam_tablet_sw *sw, ++ const struct ssam_tablet_sw_state *state) ++{ ++ switch (state->source) { ++ case SSAM_POS_SOURCE_COVER: ++ return ssam_pos_state_is_tablet_mode_cover(sw, state->state); ++ ++ case SSAM_POS_SOURCE_SLS: ++ return ssam_pos_state_is_tablet_mode_sls(sw, state->state); ++ ++ default: ++ dev_warn(&sw->sdev->dev, "unknown device posture source: %u\n", state->source); + return true; + } + } +@@ -450,9 +549,10 @@ static int ssam_pos_get_posture_for_source(struct ssam_tablet_sw *sw, u32 source + return 0; + } + +-static int ssam_pos_get_posture(struct ssam_tablet_sw *sw, u32 *state) ++static int ssam_pos_get_posture(struct ssam_tablet_sw *sw, struct ssam_tablet_sw_state *state) + { + u32 source_id; ++ u32 source_state; + int status; + + status = ssam_pos_get_source(sw, &source_id); +@@ -461,13 +561,15 @@ static int ssam_pos_get_posture(struct ssam_tablet_sw *sw, u32 *state) + return status; + } + +- status = ssam_pos_get_posture_for_source(sw, source_id, state); ++ status = ssam_pos_get_posture_for_source(sw, source_id, &source_state); + if (status) { + dev_err(&sw->sdev->dev, "failed to get posture value for source %u: %d\n", + source_id, status); + return status; + } + ++ state->source = source_id; ++ state->state = source_state; + return 0; + } + +-- +2.39.2 + +From 06ee1ee836bde65f336a85b189ebfadcd438fa9b Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sun, 19 Feb 2023 23:41:18 +0100 +Subject: [PATCH] platform/surface: aggregator_registry: Add support for + tablet-mode switch on Surface Pro 9 + +Add support for the POS-subsystem tablet-mode switch used on the Surface +Pro 9. + +Signed-off-by: Maximilian Luz +Patchset: surface-sam +--- + drivers/platform/surface/surface_aggregator_registry.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c +index 296f72d52e6a..0fe5be539652 100644 +--- a/drivers/platform/surface/surface_aggregator_registry.c ++++ b/drivers/platform/surface/surface_aggregator_registry.c +@@ -305,7 +305,7 @@ static const struct software_node *ssam_node_group_sp9[] = { + &ssam_node_bat_ac, + &ssam_node_bat_main, + &ssam_node_tmp_pprof, +- /* TODO: Tablet mode switch (via POS subsystem) */ ++ &ssam_node_pos_tablet_switch, + &ssam_node_hid_kip_keyboard, + &ssam_node_hid_kip_penstash, + &ssam_node_hid_kip_touchpad, +-- +2.39.2 + diff --git a/patches/6.1/0007-surface-sam-over-hid.patch b/patches/6.1/0007-surface-sam-over-hid.patch index ae8f12b72..578beeb58 100644 --- a/patches/6.1/0007-surface-sam-over-hid.patch +++ b/patches/6.1/0007-surface-sam-over-hid.patch @@ -1,4 +1,4 @@ -From 2df98c3c34943ee81329070463019d6850495bfa Mon Sep 17 00:00:00 2001 +From af41e50756f8c78a7f4a519fdae7301f0aa147e4 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 @@ -110,7 +110,7 @@ index 4dd777cc0c89..b2338618163a 100644 -- 2.39.2 -From cd967ccdea9ccafd51683a7aab809c1ee4d892b7 Mon Sep 17 00:00:00 2001 +From a4b02a24d5c3f2e12891205b564dad60153e6ef6 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 diff --git a/patches/6.1/0008-surface-button.patch b/patches/6.1/0008-surface-button.patch index eeb0c8127..a722e7cae 100644 --- a/patches/6.1/0008-surface-button.patch +++ b/patches/6.1/0008-surface-button.patch @@ -1,4 +1,4 @@ -From b799ee43afd8edae60f58a9dddde287aa31c5d0e Mon Sep 17 00:00:00 2001 +From a8951faeeaeabf105d172dd4c8bf4edc1461b739 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 09489380afda..0f02411a60f1 100644 -- 2.39.2 -From 5da580e346b013a72b98126b9d1a6d0fa5c90747 Mon Sep 17 00:00:00 2001 +From 00c0e795fd522f7be7763afdb86ed583c1626f00 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/patches/6.1/0009-surface-typecover.patch b/patches/6.1/0009-surface-typecover.patch index e9809a51d..902513faa 100644 --- a/patches/6.1/0009-surface-typecover.patch +++ b/patches/6.1/0009-surface-typecover.patch @@ -1,4 +1,4 @@ -From c419d751a284a6489ad4a8478e69b1e370819231 Mon Sep 17 00:00:00 2001 +From 265814f11efa7485a3331b11c572b40d864bbb91 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 934b3d997702..2c6604c6e8e1 100644 -- 2.39.2 -From e1455f50b19da079f428bae9ae24eec25c9996f8 Mon Sep 17 00:00:00 2001 +From 450a7fcb1e91da1f315f420c94221310f8decbc9 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 372cbdd223e0..fe849df6a948 100644 -- 2.39.2 -From d26b30c213dd92d7aa7e2a8026b1ac50da165534 Mon Sep 17 00:00:00 2001 +From 3391e2a3d68cca522d12ec4415ef916ee102c305 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/patches/6.1/0010-surface-shutdown.patch b/patches/6.1/0010-surface-shutdown.patch new file mode 100644 index 000000000..ec6deae4c --- /dev/null +++ b/patches/6.1/0010-surface-shutdown.patch @@ -0,0 +1,89 @@ +From 7dd556a6570b366084aa07918ac864d10f6f9982 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 + +Work around buggy EFI firmware: On some Microsoft Surface devices +(Surface Pro 9 and Surface Laptop 5) the EFI ResetSystem call with +EFI_RESET_SHUTDOWN doesn't function properly. Instead of shutting the +system down, it returns and the system stays on. + +It turns out that this only happens after PCI shutdown callbacks ran for +specific devices. Excluding those devices from the shutdown process +makes the ResetSystem call work as expected. + +TODO: Maybe we can find a better way or the root cause of this? + +Not-Signed-off-by: Maximilian Luz +Patchset: surface-shutdown +--- + drivers/pci/pci-driver.c | 3 +++ + drivers/pci/quirks.c | 28 ++++++++++++++++++++++++++++ + include/linux/pci.h | 1 + + 3 files changed, 32 insertions(+) + +diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c +index 107d77f3c846..4c64424a794f 100644 +--- a/drivers/pci/pci-driver.c ++++ b/drivers/pci/pci-driver.c +@@ -507,6 +507,9 @@ static void pci_device_shutdown(struct device *dev) + struct pci_dev *pci_dev = to_pci_dev(dev); + struct pci_driver *drv = pci_dev->driver; + ++ if (pci_dev->no_shutdown) ++ return; ++ + pm_runtime_resume(dev); + + if (drv && drv->shutdown) +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c +index 285acc4aaccc..c562fdeaf7f0 100644 +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -5992,3 +5992,31 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a2d, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a2f, dpc_log_size); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a31, dpc_log_size); + #endif ++ ++static const struct dmi_system_id no_shutdown_dmi_table[] = { ++ /* ++ * Systems on which some devices should not be touched during shutdown. ++ */ ++ { ++ .ident = "Microsoft Surface Pro 9", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"), ++ }, ++ }, ++ {} ++}; ++ ++static void quirk_no_shutdown(struct pci_dev *dev) ++{ ++ if (!dmi_check_system(no_shutdown_dmi_table)) ++ return; ++ ++ dev->no_shutdown = 1; ++ pci_info(dev, "disabling shutdown ops for [%04x:%04x]\n", ++ dev->vendor, dev->device); ++} ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x46a8, quirk_no_shutdown); // GPU ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x462f, quirk_no_shutdown); // Thunderbolt 4 PCI Express Root Port ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x461f, quirk_no_shutdown); // Thunderbolt 4 PCI Express Root Port ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x461e, quirk_no_shutdown); // Thunderbolt 4 USB Controller +diff --git a/include/linux/pci.h b/include/linux/pci.h +index 2bda4a4e47e8..1186210ae007 100644 +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -462,6 +462,7 @@ struct pci_dev { + unsigned int no_vf_scan:1; /* Don't scan for VFs after IOV enablement */ + unsigned int no_command_memory:1; /* No PCI_COMMAND_MEMORY */ + unsigned int rom_bar_overlap:1; /* ROM BAR disable broken */ ++ unsigned int no_shutdown:1; /* Do not touch device on shutdown */ + pci_dev_flags_t dev_flags; + atomic_t enable_cnt; /* pci_enable_device has been called */ + +-- +2.39.2 + diff --git a/patches/6.1/0010-cameras.patch b/patches/6.1/0011-cameras.patch similarity index 98% rename from patches/6.1/0010-cameras.patch rename to patches/6.1/0011-cameras.patch index ed43d9fde..299e32111 100644 --- a/patches/6.1/0010-cameras.patch +++ b/patches/6.1/0011-cameras.patch @@ -1,4 +1,4 @@ -From 0c92dcb3841b45e2c196d871eeb6b0c710e2b1f2 Mon Sep 17 00:00:00 2001 +From 39ae682754482c75656286f676f45bb9ccad5055 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 @@ -74,7 +74,7 @@ index dbfa58e799e2..ccbd3f8b523e 100644 -- 2.39.2 -From 3a3dff253c5249be3a7e43597a5c5f8eb71841bb Mon Sep 17 00:00:00 2001 +From 9ad1924eb598a0191d3f41162bc46e178417a0a2 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 @@ -191,7 +191,7 @@ index 408c321b929a..6e58effbe12b 100644 -- 2.39.2 -From 903f91f77044d82356d9232245c24ab54620a8a4 Mon Sep 17 00:00:00 2001 +From 6809f280140d82589dad70fb64af37b3a8d97e33 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 @@ -228,7 +228,7 @@ index 5b8d1a9620a5..6a0ff035cf20 100644 -- 2.39.2 -From 7dc61df2a818a76fdc5e2441f4f61701fad0d653 Mon Sep 17 00:00:00 2001 +From 8a405177e4e2ca75b8e4cdb2811aa7a9ccddf9e9 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 28 Oct 2021 21:55:16 +0100 Subject: [PATCH] media: i2c: Add driver for DW9719 VCM @@ -732,7 +732,7 @@ index 000000000000..180b04d2a6b3 -- 2.39.2 -From 273a87ebd6ff294c04b5e6f07061e0f1d1d6f212 Mon Sep 17 00:00:00 2001 +From 304759d0d0939c994f2df4620a5d2998a936ed18 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 4 May 2022 23:21:45 +0100 Subject: [PATCH] media: ipu3-cio2: Move functionality from .complete() to @@ -847,7 +847,7 @@ index 390bd5ea3472..76339fb842bf 100644 -- 2.39.2 -From b595c626339a53adbf53a739e7e8962190c07954 Mon Sep 17 00:00:00 2001 +From 95470a4d9bb9740354f50bca8a5850ab53cda149 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 2 Jun 2022 22:15:56 +0100 Subject: [PATCH] media: ipu3-cio2: Re-add .complete() to ipu3-cio2 @@ -890,7 +890,7 @@ index 76339fb842bf..eb7aa269ec2b 100644 -- 2.39.2 -From 4df36c6c4ed7b84ab533e617ad6d6b7d957ece3b Mon Sep 17 00:00:00 2001 +From ec17c02f9009b9efd510321eaddb5f4a9120c5d8 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 15 Jul 2022 23:48:00 +0200 Subject: [PATCH] drivers/media/i2c: Fix DW9719 dependencies diff --git a/patches/6.1/0011-amd-gpio.patch b/patches/6.1/0012-amd-gpio.patch similarity index 96% rename from patches/6.1/0011-amd-gpio.patch rename to patches/6.1/0012-amd-gpio.patch index 2206e61d1..2a9492175 100644 --- a/patches/6.1/0011-amd-gpio.patch +++ b/patches/6.1/0012-amd-gpio.patch @@ -1,4 +1,4 @@ -From e3dad6db81b0977bac4d3485b12dae68f3f478a3 Mon Sep 17 00:00:00 2001 +From 6602ca3753b5d2ef1c44a0d89d92f1d282fcd70e 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 907cc98b1938..0116d27b29ea 100644 -- 2.39.2 -From 64ebb21a97597f2c0f054a7ebfc44fe604d41f74 Mon Sep 17 00:00:00 2001 +From 785f2eacf1ae97e711d575dc6120182f890bbd26 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/patches/6.1/0012-rtc.patch b/patches/6.1/0013-rtc.patch similarity index 98% rename from patches/6.1/0012-rtc.patch rename to patches/6.1/0013-rtc.patch index bcd8d8763..0b498140b 100644 --- a/patches/6.1/0012-rtc.patch +++ b/patches/6.1/0013-rtc.patch @@ -1,4 +1,4 @@ -From 969294ed3b48077e8dd24f2bedb2e115830a6d5a Mon Sep 17 00:00:00 2001 +From b4611209fad209b2949dbfc213db74f8edc146df 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