linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Christophe Ricard
	<christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org,
	lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christophe Ricard
	<christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
Subject: Re: [PATCH v7 2/3] ACPI / gpio: Add irq_type when a gpio is used as an interrupt
Date: Fri, 18 Dec 2015 11:13:11 +0200	[thread overview]
Message-ID: <20151218091311.GD1762@lahna.fi.intel.com> (raw)
In-Reply-To: <1450163493-4938-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>

On Tue, Dec 15, 2015 at 08:11:32AM +0100, Christophe Ricard wrote:
> When a gpio is used as an interrupt in acpi, the irq_type was not
> available for device driver.
> 
> Make available polarity and triggering information in acpi_find_gpio by
> renaming acpi_gpio_info field active_low  to polarity and adding triggering
> field (edge/level).
> For sanity, in gpiolib.c replace info.active_low by
> "info.polarity == GPIO_ACTIVE_LOW".
> 
> Set the irq_type if necessary in acpi_dev_gpio_irq_get.
> 
> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
> ---
>  drivers/gpio/gpiolib-acpi.c | 30 ++++++++++++++++++++++++------
>  drivers/gpio/gpiolib.c      |  4 ++--
>  drivers/gpio/gpiolib.h      |  3 ++-
>  3 files changed, 28 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 16a7b68..9f83fc6 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -418,9 +418,11 @@ static int acpi_find_gpio(struct acpi_resource *ares, void *data)
>  		 * GpioIo is used then the only way to set the flag is
>  		 * to use _DSD "gpios" property.
>  		 */
> -		if (lookup->info.gpioint)
> -			lookup->info.active_low =
> -				agpio->polarity == ACPI_ACTIVE_LOW;
> +		if (lookup->info.gpioint) {
> +			lookup->info.polarity = agpio->polarity;

Since you are passing ACPI_ACTIVE_LOW/HIGH/BOTH here and then later on
compare that to GPIO_ACTIVE_LOW you should either put comment here
explaining that we expect the two to be equal, or alternatively convert
ACPI flags here to the corresponding Linux ones.

> +			lookup->info.triggering = agpio->triggering;
> +		}
> +
>  	}
>  
>  	return 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-12-18  9:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15  7:11 [PATCH v7 0/3] ACPI: Add irq_type to gpio interrupt Christophe Ricard
2015-12-15  7:11 ` [PATCH v7 1/3] acpi: Rename acpi_gsi_get_irq_type to acpi_dev_get_irq_type and export symbol Christophe Ricard
2015-12-18  8:40   ` Mika Westerberg
     [not found] ` <1450163493-4938-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-12-15  7:11   ` [PATCH v7 2/3] ACPI / gpio: Add irq_type when a gpio is used as an interrupt Christophe Ricard
     [not found]     ` <1450163493-4938-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-12-18  9:13       ` Mika Westerberg [this message]
2015-12-15  7:11 ` [PATCH v7 3/3] ACPI / spi: attach gpio irq from acpi description to spi device Christophe Ricard
     [not found]   ` <1450163493-4938-4-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2015-12-18  8:01     ` Mark Brown
2015-12-18  9:17   ` 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=20151218091311.GD1762@lahna.fi.intel.com \
    --to=mika.westerberg-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=christophe-h.ricard-qxv4g6HH51o@public.gmane.org \
    --cc=christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
    /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).