Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758773AbcCDHjj (ORCPT ); Fri, 4 Mar 2016 02:39:39 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:8709 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758043AbcCDHjF (ORCPT ); Fri, 4 Mar 2016 02:39:05 -0500 From: qiujiang To: , CC: , , , , , , , , qiujiang Subject: [PATCH v5 3/3] gpio: designware: add gpio-signaled acpi event support Date: Fri, 4 Mar 2016 15:44:34 +0800 Message-ID: <1457077474-124064-4-git-send-email-qiujiang@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457077474-124064-1-git-send-email-qiujiang@huawei.com> References: <1457077474-124064-1-git-send-email-qiujiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.56D93B92.0142,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 892c83dd7453755d6d914d19a677d07e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1330 Lines: 48 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 Reviewed-by: Andy Shevchenko Signed-off-by: qiujiang --- 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 #include +#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