aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel_int0002_vgpio.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-09-24 16:37:19 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-09-27 11:45:29 +0300
commitc3b8e884defae3ad50956ee77bdba3638fe4852f (patch)
tree1e55509fa06041c9a1e2d802aa80cbd4c41ef866 /drivers/platform/x86/intel_int0002_vgpio.c
parentplatform/x86: intel_int0002_vgpio: Enable the driver on Bay Trail platforms (diff)
downloadlinux-dev-c3b8e884defae3ad50956ee77bdba3638fe4852f.tar.xz
linux-dev-c3b8e884defae3ad50956ee77bdba3638fe4852f.zip
platform/x86: intel_int0002_vgpio: Implement irq_set_wake
We were relying on the interrupt being shared with the ACPI SCI and the ACPI core calling irq_set_wake. But that does not always happen on Bay Trail devices, so we should do it ourselves. This fixes wake from USB not working on various Bay Trail devices. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/intel_int0002_vgpio.c')
-rw-r--r--drivers/platform/x86/intel_int0002_vgpio.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
index 987a3b03f225..33c3489f5bc1 100644
--- a/drivers/platform/x86/intel_int0002_vgpio.c
+++ b/drivers/platform/x86/intel_int0002_vgpio.c
@@ -106,6 +106,21 @@ static void int0002_irq_mask(struct irq_data *data)
outl(gpe_en_reg, GPE0A_EN_PORT);
}
+static int int0002_irq_set_wake(struct irq_data *data, unsigned int on)
+{
+ struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
+ struct platform_device *pdev = to_platform_device(chip->parent);
+ int irq = platform_get_irq(pdev, 0);
+
+ /* Propagate to parent irq */
+ if (on)
+ enable_irq_wake(irq);
+ else
+ disable_irq_wake(irq);
+
+ return 0;
+}
+
static irqreturn_t int0002_irq(int irq, void *data)
{
struct gpio_chip *chip = data;
@@ -128,6 +143,7 @@ static struct irq_chip int0002_irqchip = {
.irq_ack = int0002_irq_ack,
.irq_mask = int0002_irq_mask,
.irq_unmask = int0002_irq_unmask,
+ .irq_set_wake = int0002_irq_set_wake,
};
static int int0002_probe(struct platform_device *pdev)