Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349917

[PATCH v5 3/3] gpio: designware: add gpio-signaled acpi event support

From qiujiang <qiujiang@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v5 3/3] gpio: designware: add gpio-signaled acpi event support
Date 2016-03-04 08:40 +0100
Message-ID <r8Sv8-3eE-7@gated-at.bofh.it> (permalink)
References <r8Sv7-3eE-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch adds the support for the gpio-signaled acpi event.
This is used for power button on hisilicon D02 board, which
is an arm64 platform.

To support this function, _AEI and _Exx objects must be
defined in the corresponding GPIO device as follows:

    Name (_AEI, ResourceTemplate () {
            GpioInt(Edge, ActiveLow, ExclusiveAndWake, PullUp,
			, " \\_SB.GPI0") {8}
    })
    Method (_E08, 0x0, NotSerialized) {
        Notify (\_SB.PWRB, 0x80)
    }

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: qiujiang <qiujiang@huawei.com>
---
 drivers/gpio/gpio-dwapb.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 2ae506f..043e1c2 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -28,6 +28,8 @@
 #include <linux/platform_data/gpio-dwapb.h>
 #include <linux/slab.h>
 
+#include "gpiolib.h"
+
 #define GPIO_SWPORTA_DR		0x00
 #define GPIO_SWPORTA_DDR	0x04
 #define GPIO_SWPORTB_DR		0x0c
@@ -437,6 +439,10 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
 	else
 		port->is_registered = true;
 
+	/* Add GPIO-signaled ACPI event support */
+	if (pp->irq)
+		acpi_gpiochip_request_interrupts(&port->gc);
+
 	return err;
 }
 
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/3] "gpio: designware: add gpio-signaled acpi event support for power button" qiujiang <qiujiang@huawei.com> - 2016-03-04 08:40 +0100
  [PATCH v5 1/3] gpio: designware: convert device node to fwnode qiujiang <qiujiang@huawei.com> - 2016-03-04 08:40 +0100
    Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Alan Tull <delicious.quinoa@gmail.com> - 2016-03-10 20:20 +0100
      Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-03-10 21:30 +0100
        Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-03-11 02:00 +0100
        Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-03-15 14:00 +0100
      Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-03-11 01:50 +0100
  [PATCH v5 3/3] gpio: designware: add gpio-signaled acpi event support qiujiang <qiujiang@huawei.com> - 2016-03-04 08:40 +0100
    Re: [PATCH v5 3/3] gpio: designware: add gpio-signaled acpi event support Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-03-10 21:40 +0100
  [PATCH v5 2/3] gpio: designware: add acpi binding qiujiang <qiujiang@huawei.com> - 2016-03-04 08:50 +0100
    Re: [PATCH v5 2/3] gpio: designware: add acpi binding Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-03-10 21:40 +0100
  Re: [PATCH v5 0/3] "gpio: designware: add gpio-signaled acpi event  support for power button" Linus Walleij <linus.walleij@linaro.org> - 2016-03-09 03:30 +0100
    Re: [PATCH v5 0/3] "gpio: designware: add gpio-signaled acpi event  support for power button" Alan Tull <delicious.quinoa@gmail.com> - 2016-03-10 21:20 +0100

csiph-web