From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760618AbcBYMOO (ORCPT ); Thu, 25 Feb 2016 07:14:14 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:65208 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760552AbcBYMOM (ORCPT ); Thu, 25 Feb 2016 07:14:12 -0500 Reply-To: Subject: Re: [PATCH v3 2/2] gpio: designware: add gpio-signaled acpi events support for power button References: <1456317210-42742-1-git-send-email-qiujiang@huawei.com> <1456317210-42742-3-git-send-email-qiujiang@huawei.com> To: Andy Shevchenko CC: Linus Walleij , Alexandre Courbot , Mika Westerberg , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-acpi@vger.kernel.org" , , , From: Jiang Qiu Message-ID: <56CEEFF8.6080304@huawei.com> Date: Thu, 25 Feb 2016 20:13:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.160.152] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.56CEF003.0120,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: 7d0d4cfe0b359421d48cca29256597ae Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2016/2/24 21:49, Andy Shevchenko 写道: > On Wed, Feb 24, 2016 at 2:33 PM, qiujiang wrote: >> This patch modifies the designware gpio controller driver to >> support the gpio-signaled acpi events. This is used for power >> button on hisilicon D02 board(an arm64 platform). > >> @@ -434,6 +436,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)); > > Redundant parens. OK, fixed it in next version, thank you. > >> @@ -447,7 +453,7 @@ static void dwapb_gpio_unregister(struct dwapb_gpio *gpio) >> } >> >> static struct dwapb_platform_data * >> -dwapb_gpio_get_pdata_of(struct device *dev) >> +dwapb_gpio_get_pdata(struct device *dev) >> { >> struct fwnode_handle *fwnode; >> struct dwapb_platform_data *pdata; >> @@ -455,9 +461,6 @@ dwapb_gpio_get_pdata_of(struct device *dev) >> int nports; >> int i; >> > >> - if (!IS_ENABLED(CONFIG_OF_GPIO) || !(dev->of_node)) >> - return ERR_PTR(-ENODEV); >> - > > I think it belongs to patch 1. If these code remove to patch1, it will contain ACPI support and patch2 implement GPIO-signaled acpi events support only. Maybe this patchset partition looks more clearly, I think. > >> @@ -479,15 +482,13 @@ dwapb_gpio_get_pdata_of(struct device *dev) >> >> if (fwnode_property_read_u32(fwnode, "reg", &pp->idx) || >> pp->idx >= DWAPB_MAX_PORTS) { >> - dev_err(dev, "missing/invalid port index for %s\n", >> - to_of_node(fwnode)->full_name); >> + dev_err(dev, "missing/invalid port index\n"); > > Ditto. > >> - dev_info(dev, "failed to get number of gpios for %s\n", >> - to_of_node(fwnode)->full_name); >> + dev_info(dev, "failed to get number of gpios\n"); > > Ditto. > >> @@ -495,7 +496,7 @@ dwapb_gpio_get_pdata_of(struct device *dev) >> * Only port A can provide interrupts in all configurations of >> * the IP. >> */ >> - if (pp->idx == 0 && >> + if (dev->of_node && pp->idx == 0 && > > Why is it needed? Different APIs was used to parse interrupt resource for DT and ACPI, a unified way platform_get_irq looks like more resonable, I will fixed it in the next version. > >