From: Linus Walleij <linus.walleij@linaro.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Mathias Nyman <mathias.nyman@linux.intel.com>,
Grant Likely <grant.likely@secretlab.ca>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH 1/2] gpio / ACPI: register to ACPI events automatically
Date: Fri, 20 Sep 2013 21:08:57 +0200 [thread overview]
Message-ID: <CACRpkdZ4WNmt5ZO_+Wtpm0+GD4EMAK5VscV-cTN+43heF17FJg@mail.gmail.com> (raw)
In-Reply-To: <1379085280-2211-1-git-send-email-mika.westerberg@linux.intel.com>
On Fri, Sep 13, 2013 at 5:14 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> Instead of asking each driver to register to the ACPI events we can just
> call acpi_gpiochip_register_interrupts() for each chip that has ACPI
> handle. It checks chip->to_irq and if it is set to NULL (a GPIO driver that
> doesn't do interrupts) the function does nothing.
>
> Also make the event interface to be private to gpiolib-acpi and remove call
> to the API from the one existing user (pinctrl-baytrail.c).
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
The concept looks sane...
> +void acpi_gpiochip_add(struct gpio_chip *chip)
> +{
> + acpi_gpiochip_request_interrupts(chip);
> +}
> +EXPORT_SYMBOL_GPL(acpi_gpiochip_add);
> +
> +void acpi_gpiochip_remove(struct gpio_chip *chip)
> +{
> + acpi_gpiochip_free_interrupts(chip);
> +}
> +EXPORT_SYMBOL_GPL(acpi_gpiochip_remove);
If you're only going to call this from within gpiolib, why are
you EXPORTing the APIs?
I think we should maybe create drivers/gpio/gpiolib.h
for such subsystem-local headers.
> @@ -1221,6 +1222,7 @@ int gpiochip_add(struct gpio_chip *chip)
> #endif
>
> of_gpiochip_add(chip);
> + acpi_gpiochip_add(chip);
>
> if (status)
> goto fail;
> @@ -1262,6 +1264,7 @@ int gpiochip_remove(struct gpio_chip *chip)
>
> gpiochip_remove_pin_ranges(chip);
> of_gpiochip_remove(chip);
> + acpi_gpiochip_remove(chip);
What happens on a platform that is not using CONFIG_GPIO_ACPI
when they try to compile this?
You forgot to add static inline stubs for the non-ACPI case.
Yours,
Linus Walleij
next prev parent reply other threads:[~2013-09-20 19:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 15:14 [PATCH 1/2] gpio / ACPI: register to ACPI events automatically Mika Westerberg
2013-09-13 15:14 ` [PATCH 2/2] gpio / ACPI: add support for GPIO operation regions Mika Westerberg
2013-09-13 15:55 ` Andy Shevchenko
2013-09-13 17:36 ` Mika Westerberg
2013-09-14 0:10 ` Zheng, Lv
2013-09-15 6:51 ` Mika Westerberg
2013-09-16 0:46 ` Zheng, Lv
2013-09-16 1:21 ` Zheng, Lv
2013-09-16 8:10 ` Mika Westerberg
2013-09-16 23:35 ` Zheng, Lv
2013-09-17 8:37 ` Mika Westerberg
2013-09-24 0:47 ` Zheng, Lv
2013-09-24 4:59 ` Mika Westerberg
2013-09-20 19:21 ` Linus Walleij
2013-09-23 10:48 ` Mika Westerberg
2013-09-20 19:08 ` Linus Walleij [this message]
2013-09-23 10:52 ` [PATCH 1/2] gpio / ACPI: register to ACPI events automatically Mika Westerberg
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=CACRpkdZ4WNmt5ZO_+Wtpm0+GD4EMAK5VscV-cTN+43heF17FJg@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael.j.wysocki@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).