mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	grant.likely@secretlab.ca,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio / ACPI: Handle ACPI events in accordance with the spec
Date: Wed, 10 Apr 2013 12:39:21 +0200	[thread overview]
Message-ID: <7616728.CEZnGS3Ki9@vostro.rjw.lan> (raw)
In-Reply-To: <20130410091747.GO21818@intel.com>

On Wednesday, April 10, 2013 12:17:47 PM Mika Westerberg wrote:
> On Wed, Apr 10, 2013 at 11:17:57AM +0300, Mathias Nyman wrote:
> > On 04/10/2013 10:53 AM, Mika Westerberg wrote:
> > >On Tue, Apr 09, 2013 at 03:57:25PM +0200, Rafael J. Wysocki wrote:
> > >>+void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
> > >>+{
> > >>+	acpi_handle handle;
> > >>+	acpi_status status;
> > >>+	struct list_head *evt_pins;
> > >>+	struct acpi_gpio_evt_pin *evt_pin, *ep;
> > >>+
> > >>+	if (!chip->dev || !chip->to_irq)
> > >>+		return;
> > >>+
> > >>+	handle = ACPI_HANDLE(chip->dev);
> > >>+	if (!handle)
> > >>+		return;
> > >>+
> > >>+	status = acpi_get_data(handle, acpi_gpio_evt_dh, (void **)&evt_pins);
> > >>+	if (ACPI_FAILURE(status))
> > >>+		return;
> > >>+
> > >>+	list_for_each_entry_safe_reverse(evt_pin, ep, evt_pins, node) {
> > >>+		devm_free_irq(chip->dev, evt_pin->irq, evt_pin);
> > >
> > >How about using normal request/free_irq() functions for both _EVT and
> > >non-_EVT events? Since we now need to call acpi_gpiochip_free_interrupts()
> > >anyway, I don't see the point using devm_* functions here.
> > >
> > 
> > Then we need to create a list of non-_EVT events, or add them to the
> > evt_pins list.
> 
> Good point. Maybe we can add them to the evt_pins list and handle the same
> way as _EVT (except that we need to call _Exx and _Lxx methods instead of
> _EVT)?

The difference is that the evt_pins data is only needed for _EVT execution,
because _EVT takes the pin argument.  _Lxx/_Exx don't take arguments and
there's no need to add extra data structures for them, as devm_ does what's
needed.

Of course, plain request/free_irq may be used for the _EVT events only
at the expense of a little more complexity in acpi_gpiochip_request_interrupts().

Thanks,
Rafael


  reply	other threads:[~2013-04-10 10:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 13:57 Rafael J. Wysocki
2013-04-10  7:53 ` Mika Westerberg
2013-04-10  8:17   ` Mathias Nyman
2013-04-10  9:17     ` Mika Westerberg
2013-04-10 10:39       ` Rafael J. Wysocki [this message]
2013-04-10 10:54         ` Mika Westerberg
2013-04-10 11:21           ` Rafael J. Wysocki
2013-04-10 21:06 ` Linus Walleij
2013-04-10 22:36   ` Rafael J. Wysocki

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=7616728.CEZnGS3Ki9@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.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

all inboxes | Powered by JetHome®