linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Qiu <qiujiang@huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linuxarm@huawei.com, haifeng.wei@huawei.com,
	charles.chenxin@huawei.com
Subject: Re: [PATCH v3 2/2] gpio: designware: add gpio-signaled acpi events support for power button
Date: Thu, 25 Feb 2016 20:13:44 +0800	[thread overview]
Message-ID: <56CEEFF8.6080304@huawei.com> (raw)
In-Reply-To: <CAHp75VeFydKKc6GmWbLJ2uSBmxG2ObGX51i-NrNBAdaR57nXCA@mail.gmail.com>



在 2016/2/24 21:49, Andy Shevchenko 写道:
> On Wed, Feb 24, 2016 at 2:33 PM, qiujiang <qiujiang@huawei.com> 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.
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-02-25 12:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 12:33 [PATCH v3 0/2] gpio: designware: add gpio-signaled acpi events support for power button qiujiang
2016-02-24 12:33 ` [PATCH v3 1/2] gpio: designware: switch device node to fwnode qiujiang
2016-02-24 13:46   ` Andy Shevchenko
2016-02-25 11:58     ` Jiang Qiu
2016-02-25 13:43       ` Andy Shevchenko
2016-02-27  7:15         ` Jiang Qiu
2016-02-29 10:46           ` Andy Shevchenko
2016-02-24 12:33 ` [PATCH v3 2/2] gpio: designware: add gpio-signaled acpi events support for power button qiujiang
2016-02-24 13:49   ` Andy Shevchenko
2016-02-25 12:13     ` Jiang Qiu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56CEEFF8.6080304@huawei.com \
    --to=qiujiang@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=charles.chenxin@huawei.com \
    --cc=gnurou@gmail.com \
    --cc=haifeng.wei@huawei.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).