From patchwork Mon Feb 29 13:13:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: qiujiang X-Patchwork-Id: 589943 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9ACBD1402BF for ; Tue, 1 Mar 2016 00:03:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753559AbcB2NDV (ORCPT ); Mon, 29 Feb 2016 08:03:21 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:8234 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752162AbcB2NDR (ORCPT ); Mon, 29 Feb 2016 08:03:17 -0500 Received: from 172.24.1.50 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.50]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DFL44363; Mon, 29 Feb 2016 21:03:07 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.235.1; Mon, 29 Feb 2016 21:02:48 +0800 From: qiujiang To: , CC: , , , , , , , Subject: [PATCH v4 2/2] gpio: designware: add gpio-signaled acpi event support Date: Mon, 29 Feb 2016 21:13:16 +0800 Message-ID: <1456751596-98963-3-git-send-email-qiujiang@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456751596-98963-1-git-send-email-qiujiang@huawei.com> References: <1456751596-98963-1-git-send-email-qiujiang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.56D4418C.032D, 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: 40f9ba4ac17c67e1f7a8bd962354a2a1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 Signed-off-by: qiujiang Reviewed-by: Andy Shevchenko --- 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 7a37c65..4955112 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -27,6 +27,8 @@ #include #include +#include "gpiolib.h" + #define GPIO_SWPORTA_DR 0x00 #define GPIO_SWPORTA_DDR 0x04 #define GPIO_SWPORTB_DR 0x0c @@ -436,6 +438,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; }