From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/16] ARM: mxc: Switch over to gpiolib ->to_irq() and __gpio_to_irq().
Date: Wed, 15 Dec 2010 15:22:32 +0100 [thread overview]
Message-ID: <20101215142232.GC29833@pengutronix.de> (raw)
In-Reply-To: <20101215020345.GD15575@mail.wantstofly.org>
Hi Lennert,
[added Eric B?nard to Cc]
On Wed, Dec 15, 2010 at 03:03:45AM +0100, Lennert Buytenhek wrote:
> Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Generally Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
We have some static initializers in the tree though which do not work
with this patch:
arch/arm/mach-mx3/mach-cpuimx35.c:71: .irq = gpio_to_irq(TSC2007_IRQGPIO),
arch/arm/mach-mx5/board-cpuimx51sd.c:139: .irq = gpio_to_irq(TSC2007_IRQGPIO),
arch/arm/mach-mx5/board-cpuimx51sd.c:250: .irq = gpio_to_irq(CAN_IRQGPIO)
Sascha
> ---
> arch/arm/plat-mxc/gpio.c | 9 +++++++++
> arch/arm/plat-mxc/include/mach/gpio.h | 2 +-
> 2 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
> index 9c3e362..8e97976 100644
> --- a/arch/arm/plat-mxc/gpio.c
> +++ b/arch/arm/plat-mxc/gpio.c
> @@ -272,6 +272,14 @@ static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
> spin_unlock_irqrestore(&port->lock, flags);
> }
>
> +static int mxc_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
> +{
> + struct mxc_gpio_port *port =
> + container_of(chip, struct mxc_gpio_port, chip);
> +
> + return port->virtual_irq_start + offset;
> +}
> +
> static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset)
> {
> struct mxc_gpio_port *port =
> @@ -320,6 +328,7 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
> port[i].chip.direction_output = mxc_gpio_direction_output;
> port[i].chip.get = mxc_gpio_get;
> port[i].chip.set = mxc_gpio_set;
> + port[i].chip.to_irq = mxc_gpio_to_irq;
> port[i].chip.base = i * 32;
> port[i].chip.ngpio = 32;
>
> diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
> index af33b74..9062fe3 100644
> --- a/arch/arm/plat-mxc/include/mach/gpio.h
> +++ b/arch/arm/plat-mxc/include/mach/gpio.h
> @@ -27,8 +27,8 @@
> #define gpio_get_value __gpio_get_value
> #define gpio_set_value __gpio_set_value
> #define gpio_cansleep __gpio_cansleep
> +#define gpio_to_irq __gpio_to_irq
>
> -#define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio))
> #define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START)
>
> struct mxc_gpio_port {
> --
> 1.7.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2010-12-15 14:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1292377339.git.buytenh@wantstofly.org>
2010-12-15 2:02 ` [PATCH 01/16] ARM: Remove dependency of plat-orion time code on mach directory includes Lennert Buytenhek
2010-12-15 2:44 ` Nicolas Pitre
2010-12-15 9:16 ` Lennert Buytenhek
2010-12-15 15:37 ` Nicolas Pitre
2010-12-15 16:25 ` Russell King - ARM Linux
2010-12-15 16:59 ` Nicolas Pitre
2010-12-15 2:02 ` [PATCH 02/16] ARM: Remove dependency of plat-orion GPIO " Lennert Buytenhek
2010-12-15 8:08 ` Saeed Bishara
2010-12-15 9:10 ` Lennert Buytenhek
2010-12-15 15:34 ` Nicolas Pitre
2010-12-15 2:03 ` [PATCH 03/16] ARM: Remove some spurious mach dir includes Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 04/16] ARM: Dove: Remove PXA compatibility IRQ defines Lennert Buytenhek
2010-12-15 8:10 ` Saeed Bishara
2010-12-15 13:13 ` Sergei Shtylyov
2010-12-15 2:03 ` [PATCH 05/16] ARM: Always reassign PCI bus numbers Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 06/16] ARM: iop13xx: Make PCIBIOS_MIN_* constants Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 07/16] ARM: Make PCIBIOS_* into global variables Lennert Buytenhek
2010-12-16 6:51 ` Mike Rapoport
2010-12-15 2:03 ` [PATCH 08/16] ARM: at91: Switch over to gpiolib ->to_irq() and __gpio_to_irq() Lennert Buytenhek
2010-12-17 9:55 ` Nicolas Ferre
2010-12-17 13:00 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-15 2:03 ` [PATCH 09/16] ARM: ep93xx: " Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 10/16] ARM: gemini: " Lennert Buytenhek
2010-12-17 12:03 ` Hans Ulli Kroll
2010-12-15 2:03 ` [PATCH 11/16] ARM: mxc: " Lennert Buytenhek
2010-12-15 14:22 ` Sascha Hauer [this message]
2010-12-16 9:00 ` Shawn Guo
2010-12-16 9:58 ` Uwe Kleine-König
2010-12-15 2:03 ` [PATCH 12/16] ARM: pxa: Provide gpiolib ->to_irq() implementation Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 13/16] ARM: mmp: Switch over to gpiolib's version of __gpio_to_irq() Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 14/16] ARM: pxa: " Lennert Buytenhek
2010-12-15 2:03 ` [PATCH 15/16] ARM: sa1100: Switch over to gpiolib ->to_irq() and __gpio_to_irq() Lennert Buytenhek
2010-12-15 2:04 ` [PATCH 16/16] ARM: w90x900: " Lennert Buytenhek
2010-12-15 2:08 ` Wan ZongShun
2010-12-15 2:09 ` Wan ZongShun
2010-12-15 2:18 ` Wan ZongShun
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=20101215142232.GC29833@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.