|
@@ -1,4 +1,4 @@
|
|
-From d3f60896ae2a2fb6c6b610e230916d2a81b24e2f Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From d60ac44982cb1b4c8555a30e411ffec54056e0dc Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Mon, 9 Nov 2020 14:23:00 +0100
|
|
Date: Mon, 9 Nov 2020 14:23:00 +0100
|
|
Subject: [PATCH] PCI: Run platform power transition on initial D0 entry
|
|
Subject: [PATCH] PCI: Run platform power transition on initial D0 entry
|
|
@@ -58,9 +58,9 @@ index 89dece8a4132..fd34c8743cbc 100644
|
|
bridge = pci_upstream_bridge(dev);
|
|
bridge = pci_upstream_bridge(dev);
|
|
if (bridge)
|
|
if (bridge)
|
|
--
|
|
--
|
|
-2.30.0
|
|
|
|
|
|
+2.30.1
|
|
|
|
|
|
-From 32bc35a7ad400888222f5cf083d080e646f5e9ef Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 79034c754cd06ff12003b5ba38ef24706feb2b7c Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Sat, 31 Oct 2020 20:46:33 +0100
|
|
Date: Sat, 31 Oct 2020 20:46:33 +0100
|
|
Subject: [PATCH] PCI: Add sysfs attribute for PCI device power state
|
|
Subject: [PATCH] PCI: Add sysfs attribute for PCI device power state
|
|
@@ -131,9 +131,9 @@ index e401f040f157..418927872ae6 100644
|
|
&dev_attr_vendor.attr,
|
|
&dev_attr_vendor.attr,
|
|
&dev_attr_device.attr,
|
|
&dev_attr_device.attr,
|
|
--
|
|
--
|
|
-2.30.0
|
|
|
|
|
|
+2.30.1
|
|
|
|
|
|
-From 6ebd60f882ad789a2dc4b8c7d681b16bb3e227f1 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 14b245813cd398b61cf0507f7fdd6b54acdb5530 Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Mon, 14 Dec 2020 20:50:59 +0100
|
|
Date: Mon, 14 Dec 2020 20:50:59 +0100
|
|
Subject: [PATCH] platform/x86: Add Surface Hotplug driver
|
|
Subject: [PATCH] platform/x86: Add Surface Hotplug driver
|
|
@@ -146,40 +146,47 @@ appropriate signal to the PCIe hot-plug driver core.
|
|
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Patchset: surface-hotplug
|
|
Patchset: surface-hotplug
|
|
---
|
|
---
|
|
- drivers/platform/x86/Kconfig | 12 ++
|
|
|
|
|
|
+ drivers/platform/x86/Kconfig | 19 ++
|
|
drivers/platform/x86/Makefile | 1 +
|
|
drivers/platform/x86/Makefile | 1 +
|
|
- drivers/platform/x86/surface_hotplug.c | 267 +++++++++++++++++++++++++
|
|
|
|
- 3 files changed, 280 insertions(+)
|
|
|
|
|
|
+ drivers/platform/x86/surface_hotplug.c | 282 +++++++++++++++++++++++++
|
|
|
|
+ 3 files changed, 302 insertions(+)
|
|
create mode 100644 drivers/platform/x86/surface_hotplug.c
|
|
create mode 100644 drivers/platform/x86/surface_hotplug.c
|
|
|
|
|
|
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
|
|
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
|
|
-index f06a0bf92890..3353aa9a9617 100644
|
|
|
|
|
|
+index b5a103d0ccd2..f0c17b65bb5b 100644
|
|
--- a/drivers/platform/x86/Kconfig
|
|
--- a/drivers/platform/x86/Kconfig
|
|
+++ b/drivers/platform/x86/Kconfig
|
|
+++ b/drivers/platform/x86/Kconfig
|
|
-@@ -756,6 +756,18 @@ config ACPI_WMI
|
|
|
|
|
|
+@@ -756,6 +756,25 @@ config ACPI_WMI
|
|
It is safe to enable this driver even if your DSDT doesn't define
|
|
It is safe to enable this driver even if your DSDT doesn't define
|
|
any ACPI-WMI devices.
|
|
any ACPI-WMI devices.
|
|
|
|
|
|
+config SURFACE_HOTPLUG
|
|
+config SURFACE_HOTPLUG
|
|
-+ tristate "Surface Hot-Plug System Driver"
|
|
|
|
-+ depends on ACPI
|
|
|
|
-+ default m
|
|
|
|
|
|
++ tristate "Surface Hot-Plug Driver"
|
|
|
|
++ depends on GPIOLIB
|
|
+ help
|
|
+ help
|
|
-+ Driver for the Surface discrete GPU (dGPU) hot-plug system.
|
|
|
|
|
|
++ Driver for out-of-band hot-plug event signaling on Microsoft Surface
|
|
|
|
++ devices with hot-pluggable PCIe cards.
|
|
+
|
|
+
|
|
-+ This driver provides support for out-of-band hot-plug event signaling
|
|
|
|
-+ on Surface Book 2 and 3 devices. This out-of-band signaling is
|
|
|
|
-+ required to notify the kernel of any hot-plug events when the dGPU is
|
|
|
|
-+ powered off, i.e. in D3cold.
|
|
|
|
|
|
++ This driver is used on Surface Book (2 and 3) devices with a
|
|
|
|
++ hot-pluggable discrete GPU (dGPU). When not in use, the dGPU on those
|
|
|
|
++ devices can enter D3cold, which prevents in-band (standard) PCIe
|
|
|
|
++ hot-plug signaling. Thus, without this driver, detaching the base
|
|
|
|
++ containing the dGPU will not correctly update the state of the
|
|
|
|
++ corresponding PCIe device if it is in D3cold. This driver adds support
|
|
|
|
++ for out-of-band hot-plug notifications, ensuring that the device state
|
|
|
|
++ is properly updated even when the device in question is in D3cold.
|
|
|
|
++
|
|
|
|
++ Select M or Y here, if you want to (fully) support hot-plugging of
|
|
|
|
++ dGPU devices on the Surface Book 2 and/or 3 during D3cold.
|
|
+
|
|
+
|
|
config WMI_BMOF
|
|
config WMI_BMOF
|
|
tristate "WMI embedded Binary MOF driver"
|
|
tristate "WMI embedded Binary MOF driver"
|
|
depends on ACPI_WMI
|
|
depends on ACPI_WMI
|
|
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
|
|
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
|
|
-index a1e70973257c..7a6b5ce38cc0 100644
|
|
|
|
|
|
+index 328830619b21..1bdad1722521 100644
|
|
--- a/drivers/platform/x86/Makefile
|
|
--- a/drivers/platform/x86/Makefile
|
|
+++ b/drivers/platform/x86/Makefile
|
|
+++ b/drivers/platform/x86/Makefile
|
|
-@@ -87,6 +87,7 @@ obj-$(CONFIG_SURFACE_PRO3_BUTTON) += surfacepro3_button.o
|
|
|
|
|
|
+@@ -93,6 +93,7 @@ obj-$(CONFIG_SURFACE_PRO3_BUTTON) += surfacepro3_button.o
|
|
obj-$(CONFIG_SURFACE_3_BUTTON) += surface3_button.o
|
|
obj-$(CONFIG_SURFACE_3_BUTTON) += surface3_button.o
|
|
obj-$(CONFIG_SURFACE_3_POWER_OPREGION) += surface3_power.o
|
|
obj-$(CONFIG_SURFACE_3_POWER_OPREGION) += surface3_power.o
|
|
obj-$(CONFIG_SURFACE_GPE) += surface_gpe.o
|
|
obj-$(CONFIG_SURFACE_GPE) += surface_gpe.o
|
|
@@ -189,13 +196,13 @@ index a1e70973257c..7a6b5ce38cc0 100644
|
|
obj-$(CONFIG_INTEL_BXTWC_PMIC_TMU) += intel_bxtwc_tmu.o
|
|
obj-$(CONFIG_INTEL_BXTWC_PMIC_TMU) += intel_bxtwc_tmu.o
|
|
diff --git a/drivers/platform/x86/surface_hotplug.c b/drivers/platform/x86/surface_hotplug.c
|
|
diff --git a/drivers/platform/x86/surface_hotplug.c b/drivers/platform/x86/surface_hotplug.c
|
|
new file mode 100644
|
|
new file mode 100644
|
|
-index 000000000000..572fba30cd77
|
|
|
|
|
|
+index 000000000000..cfcc15cfbacb
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/drivers/platform/x86/surface_hotplug.c
|
|
+++ b/drivers/platform/x86/surface_hotplug.c
|
|
-@@ -0,0 +1,267 @@
|
|
|
|
|
|
+@@ -0,0 +1,282 @@
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+// SPDX-License-Identifier: GPL-2.0+
|
|
+/*
|
|
+/*
|
|
-+ * Surface Book (gen. 2 and later) hot-plug driver.
|
|
|
|
|
|
++ * Surface Book (2 and later) hot-plug driver.
|
|
+ *
|
|
+ *
|
|
+ * Surface Book devices (can) have a hot-pluggable discrete GPU (dGPU). This
|
|
+ * Surface Book devices (can) have a hot-pluggable discrete GPU (dGPU). This
|
|
+ * driver is responsible for out-of-band hot-plug event signaling on these
|
|
+ * driver is responsible for out-of-band hot-plug event signaling on these
|
|
@@ -205,7 +212,7 @@ index 000000000000..572fba30cd77
|
|
+ * Event signaling is handled via ACPI, which will generate the appropriate
|
|
+ * Event signaling is handled via ACPI, which will generate the appropriate
|
|
+ * device-check notifications to be picked up by the PCIe hot-plug driver.
|
|
+ * device-check notifications to be picked up by the PCIe hot-plug driver.
|
|
+ *
|
|
+ *
|
|
-+ * Copyright (C) 2019-2020 Maximilian Luz <luzmaximilian@gmail.com>
|
|
|
|
|
|
++ * Copyright (C) 2019-2021 Maximilian Luz <luzmaximilian@gmail.com>
|
|
+ */
|
|
+ */
|
|
+
|
|
+
|
|
+#include <linux/acpi.h>
|
|
+#include <linux/acpi.h>
|
|
@@ -235,8 +242,7 @@ index 000000000000..572fba30cd77
|
|
+
|
|
+
|
|
+/* 5515a847-ed55-4b27-8352-cd320e10360a */
|
|
+/* 5515a847-ed55-4b27-8352-cd320e10360a */
|
|
+static const guid_t shps_dsm_guid =
|
|
+static const guid_t shps_dsm_guid =
|
|
-+ GUID_INIT(0x5515a847, 0xed55, 0x4b27, 0x83, 0x52, 0xcd,
|
|
|
|
-+ 0x32, 0x0e, 0x10, 0x36, 0x0a);
|
|
|
|
|
|
++ GUID_INIT(0x5515a847, 0xed55, 0x4b27, 0x83, 0x52, 0xcd, 0x32, 0x0e, 0x10, 0x36, 0x0a);
|
|
+
|
|
+
|
|
+#define SHPS_DSM_REVISION 1
|
|
+#define SHPS_DSM_REVISION 1
|
|
+
|
|
+
|
|
@@ -249,11 +255,10 @@ index 000000000000..572fba30cd77
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+enum shps_irq_type {
|
|
+enum shps_irq_type {
|
|
-+ /* NOTE: Must be in order of DSM function */
|
|
|
|
|
|
++ /* NOTE: Must be in order of enum shps_dsm_fn above. */
|
|
+ SHPS_IRQ_TYPE_BASE_PRESENCE = 0,
|
|
+ SHPS_IRQ_TYPE_BASE_PRESENCE = 0,
|
|
+ SHPS_IRQ_TYPE_DEVICE_POWER = 1,
|
|
+ SHPS_IRQ_TYPE_DEVICE_POWER = 1,
|
|
+ SHPS_IRQ_TYPE_DEVICE_PRESENCE = 2,
|
|
+ SHPS_IRQ_TYPE_DEVICE_PRESENCE = 2,
|
|
-+
|
|
|
|
+ SHPS_NUM_IRQS,
|
|
+ SHPS_NUM_IRQS,
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
@@ -264,15 +269,19 @@ index 000000000000..572fba30cd77
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+struct shps_device {
|
|
+struct shps_device {
|
|
-+ struct mutex lock[SHPS_NUM_IRQS];
|
|
|
|
|
|
++ struct mutex lock[SHPS_NUM_IRQS]; /* Protects update in shps_dsm_notify_irq() */
|
|
+ struct gpio_desc *gpio[SHPS_NUM_IRQS];
|
|
+ struct gpio_desc *gpio[SHPS_NUM_IRQS];
|
|
+ unsigned int irq[SHPS_NUM_IRQS];
|
|
+ unsigned int irq[SHPS_NUM_IRQS];
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+#define SHPS_IRQ_NOT_PRESENT ((unsigned int)-1)
|
|
+#define SHPS_IRQ_NOT_PRESENT ((unsigned int)-1)
|
|
+
|
|
+
|
|
-+static void shps_dsm_notify_irq(struct platform_device *pdev,
|
|
|
|
-+ enum shps_irq_type type)
|
|
|
|
|
|
++static enum shps_dsm_fn shps_dsm_fn_for_irq(enum shps_irq_type type)
|
|
|
|
++{
|
|
|
|
++ return SHPS_DSM_FN_IRQ_BASE_PRESENCE + type;
|
|
|
|
++}
|
|
|
|
++
|
|
|
|
++static void shps_dsm_notify_irq(struct platform_device *pdev, enum shps_irq_type type)
|
|
+{
|
|
+{
|
|
+ struct shps_device *sdev = platform_get_drvdata(pdev);
|
|
+ struct shps_device *sdev = platform_get_drvdata(pdev);
|
|
+ acpi_handle handle = ACPI_HANDLE(&pdev->dev);
|
|
+ acpi_handle handle = ACPI_HANDLE(&pdev->dev);
|
|
@@ -285,42 +294,37 @@ index 000000000000..572fba30cd77
|
|
+ value = gpiod_get_value_cansleep(sdev->gpio[type]);
|
|
+ value = gpiod_get_value_cansleep(sdev->gpio[type]);
|
|
+ if (value < 0) {
|
|
+ if (value < 0) {
|
|
+ mutex_unlock(&sdev->lock[type]);
|
|
+ mutex_unlock(&sdev->lock[type]);
|
|
-+ dev_err(&pdev->dev, "failed to get gpio: %d (irq=%d)\n",
|
|
|
|
-+ type, value);
|
|
|
|
|
|
++ dev_err(&pdev->dev, "failed to get gpio: %d (irq=%d)\n", type, value);
|
|
+ return;
|
|
+ return;
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
-+ dev_dbg(&pdev->dev, "IRQ notification via DSM (irq=%d, value=%d)\n",
|
|
|
|
-+ type, value);
|
|
|
|
|
|
++ dev_dbg(&pdev->dev, "IRQ notification via DSM (irq=%d, value=%d)\n", type, value);
|
|
+
|
|
+
|
|
+ param.type = ACPI_TYPE_INTEGER;
|
|
+ param.type = ACPI_TYPE_INTEGER;
|
|
+ param.integer.value = value;
|
|
+ param.integer.value = value;
|
|
+
|
|
+
|
|
+ result = acpi_evaluate_dsm(handle, &shps_dsm_guid, SHPS_DSM_REVISION,
|
|
+ result = acpi_evaluate_dsm(handle, &shps_dsm_guid, SHPS_DSM_REVISION,
|
|
-+ SHPS_DSM_FN_IRQ_BASE_PRESENCE + type, ¶m);
|
|
|
|
|
|
++ shps_dsm_fn_for_irq(type), ¶m);
|
|
+
|
|
+
|
|
+ if (!result) {
|
|
+ if (!result) {
|
|
-+ mutex_unlock(&sdev->lock[type]);
|
|
|
|
-+ dev_err(&pdev->dev,
|
|
|
|
-+ "IRQ notification via DSM failed (irq=%d, gpio=%d)\n",
|
|
|
|
|
|
++ dev_err(&pdev->dev, "IRQ notification via DSM failed (irq=%d, gpio=%d)\n",
|
|
+ type, value);
|
|
+ type, value);
|
|
-+ return;
|
|
|
|
-+ }
|
|
|
|
+
|
|
+
|
|
-+ if (result->type != ACPI_TYPE_BUFFER) {
|
|
|
|
|
|
++ } else if (result->type != ACPI_TYPE_BUFFER) {
|
|
+ dev_err(&pdev->dev,
|
|
+ dev_err(&pdev->dev,
|
|
+ "IRQ notification via DSM failed: unexpected result type (irq=%d, gpio=%d)\n",
|
|
+ "IRQ notification via DSM failed: unexpected result type (irq=%d, gpio=%d)\n",
|
|
+ type, value);
|
|
+ type, value);
|
|
-+ }
|
|
|
|
+
|
|
+
|
|
-+ if (result->buffer.length != 1 || result->buffer.pointer[0] != 0) {
|
|
|
|
|
|
++ } else if (result->buffer.length != 1 || result->buffer.pointer[0] != 0) {
|
|
+ dev_err(&pdev->dev,
|
|
+ dev_err(&pdev->dev,
|
|
+ "IRQ notification via DSM failed: unexpected result value (irq=%d, gpio=%d)\n",
|
|
+ "IRQ notification via DSM failed: unexpected result value (irq=%d, gpio=%d)\n",
|
|
+ type, value);
|
|
+ type, value);
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
+ mutex_unlock(&sdev->lock[type]);
|
|
+ mutex_unlock(&sdev->lock[type]);
|
|
-+ ACPI_FREE(result);
|
|
|
|
|
|
++
|
|
|
|
++ if (result)
|
|
|
|
++ ACPI_FREE(result);
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+static irqreturn_t shps_handle_irq(int irq, void *data)
|
|
+static irqreturn_t shps_handle_irq(int irq, void *data)
|
|
@@ -350,17 +354,16 @@ index 000000000000..572fba30cd77
|
|
+ struct gpio_desc *gpiod;
|
|
+ struct gpio_desc *gpiod;
|
|
+ acpi_handle handle = ACPI_HANDLE(&pdev->dev);
|
|
+ acpi_handle handle = ACPI_HANDLE(&pdev->dev);
|
|
+ const char *irq_name;
|
|
+ const char *irq_name;
|
|
-+ const int dsm = SHPS_DSM_FN_IRQ_BASE_PRESENCE + type;
|
|
|
|
|
|
++ const int dsm = shps_dsm_fn_for_irq(type);
|
|
+ int status, irq;
|
|
+ int status, irq;
|
|
+
|
|
+
|
|
-+ /* Initialize as "not present". */
|
|
|
|
-+ sdev->gpio[type] = NULL;
|
|
|
|
-+ sdev->irq[type] = SHPS_IRQ_NOT_PRESENT;
|
|
|
|
-+
|
|
|
|
-+ /* Only set up interrupts that we actually need. */
|
|
|
|
|
|
++ /*
|
|
|
|
++ * Only set up interrupts that we actually need: The Surface Book 3
|
|
|
|
++ * does not have a DSM for base presence, so don't set up an interrupt
|
|
|
|
++ * for that.
|
|
|
|
++ */
|
|
+ if (!acpi_check_dsm(handle, &shps_dsm_guid, SHPS_DSM_REVISION, BIT(dsm))) {
|
|
+ if (!acpi_check_dsm(handle, &shps_dsm_guid, SHPS_DSM_REVISION, BIT(dsm))) {
|
|
-+ dev_dbg(&pdev->dev, "IRQ notification via DSM not present (irq=%d)\n",
|
|
|
|
-+ type);
|
|
|
|
|
|
++ dev_dbg(&pdev->dev, "IRQ notification via DSM not present (irq=%d)\n", type);
|
|
+ return 0;
|
|
+ return 0;
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
@@ -389,11 +392,33 @@ index 000000000000..572fba30cd77
|
|
+ return 0;
|
|
+ return 0;
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
|
|
++static int surface_hotplug_remove(struct platform_device *pdev)
|
|
|
|
++{
|
|
|
|
++ struct shps_device *sdev = platform_get_drvdata(pdev);
|
|
|
|
++ int i;
|
|
|
|
++
|
|
|
|
++ /* Ensure that IRQs have been fully handled and won't trigger any more. */
|
|
|
|
++ for (i = 0; i < SHPS_NUM_IRQS; i++) {
|
|
|
|
++ if (sdev->irq[i] != SHPS_IRQ_NOT_PRESENT)
|
|
|
|
++ disable_irq(sdev->irq[i]);
|
|
|
|
++
|
|
|
|
++ mutex_destroy(&sdev->lock[i]);
|
|
|
|
++ }
|
|
|
|
++
|
|
|
|
++ return 0;
|
|
|
|
++}
|
|
|
|
++
|
|
+static int surface_hotplug_probe(struct platform_device *pdev)
|
|
+static int surface_hotplug_probe(struct platform_device *pdev)
|
|
+{
|
|
+{
|
|
+ struct shps_device *sdev;
|
|
+ struct shps_device *sdev;
|
|
+ int status, i;
|
|
+ int status, i;
|
|
+
|
|
+
|
|
|
|
++ /*
|
|
|
|
++ * The MSHW0153 device is also present on the Surface Laptop 3,
|
|
|
|
++ * however that doesn't have a hot-pluggable PCIe device. It also
|
|
|
|
++ * doesn't have any GPIO interrupts/pins under the MSHW0153, so filter
|
|
|
|
++ * it out here.
|
|
|
|
++ */
|
|
+ if (gpiod_count(&pdev->dev, NULL) < 0)
|
|
+ if (gpiod_count(&pdev->dev, NULL) < 0)
|
|
+ return -ENODEV;
|
|
+ return -ENODEV;
|
|
+
|
|
+
|
|
@@ -407,15 +432,21 @@ index 000000000000..572fba30cd77
|
|
+
|
|
+
|
|
+ platform_set_drvdata(pdev, sdev);
|
|
+ platform_set_drvdata(pdev, sdev);
|
|
+
|
|
+
|
|
|
|
++ /*
|
|
|
|
++ * Initialize IRQs so that we can safely call surface_hotplug_remove()
|
|
|
|
++ * on errors.
|
|
|
|
++ */
|
|
|
|
++ for (i = 0; i < SHPS_NUM_IRQS; i++)
|
|
|
|
++ sdev->irq[i] = SHPS_IRQ_NOT_PRESENT;
|
|
|
|
++
|
|
+ /* Set up IRQs. */
|
|
+ /* Set up IRQs. */
|
|
+ for (i = 0; i < SHPS_NUM_IRQS; i++) {
|
|
+ for (i = 0; i < SHPS_NUM_IRQS; i++) {
|
|
+ mutex_init(&sdev->lock[i]);
|
|
+ mutex_init(&sdev->lock[i]);
|
|
+
|
|
+
|
|
+ status = shps_setup_irq(pdev, i);
|
|
+ status = shps_setup_irq(pdev, i);
|
|
+ if (status) {
|
|
+ if (status) {
|
|
-+ dev_err(&pdev->dev, "failed to set up IRQ %d: %d\n",
|
|
|
|
-+ i, status);
|
|
|
|
-+ return status;
|
|
|
|
|
|
++ dev_err(&pdev->dev, "failed to set up IRQ %d: %d\n", i, status);
|
|
|
|
++ goto err;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
@@ -425,19 +456,10 @@ index 000000000000..572fba30cd77
|
|
+ shps_dsm_notify_irq(pdev, i);
|
|
+ shps_dsm_notify_irq(pdev, i);
|
|
+
|
|
+
|
|
+ return 0;
|
|
+ return 0;
|
|
-+}
|
|
|
|
+
|
|
+
|
|
-+static int surface_hotplug_remove(struct platform_device *pdev)
|
|
|
|
-+{
|
|
|
|
-+ struct shps_device *sdev = platform_get_drvdata(pdev);
|
|
|
|
-+ int i;
|
|
|
|
-+
|
|
|
|
-+ /* Ensure that IRQs have been fully handled and won't trigger any more. */
|
|
|
|
-+ for (i = 0; i < SHPS_NUM_IRQS; i++)
|
|
|
|
-+ if (sdev->irq[i] != SHPS_IRQ_NOT_PRESENT)
|
|
|
|
-+ disable_irq(sdev->irq[i]);
|
|
|
|
-+
|
|
|
|
-+ return 0;
|
|
|
|
|
|
++err:
|
|
|
|
++ surface_hotplug_remove(pdev);
|
|
|
|
++ return status;
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+static const struct acpi_device_id surface_hotplug_acpi_match[] = {
|
|
+static const struct acpi_device_id surface_hotplug_acpi_match[] = {
|
|
@@ -461,5 +483,5 @@ index 000000000000..572fba30cd77
|
|
+MODULE_DESCRIPTION("Surface Hot-Plug Signaling Driver for Surface Book Devices");
|
|
+MODULE_DESCRIPTION("Surface Hot-Plug Signaling Driver for Surface Book Devices");
|
|
+MODULE_LICENSE("GPL");
|
|
+MODULE_LICENSE("GPL");
|
|
--
|
|
--
|
|
-2.30.0
|
|
|
|
|
|
+2.30.1
|
|
|
|
|