linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
@ 2011-12-18 18:24 Russell King - ARM Linux
  2011-12-18 23:17 ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-12-18 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

From: Russell King <rmk+kernel@arm.linux.org.uk>

The existing gpio_to_irq() implementation on sa1100 only translates
validly for internal GPIOs.  Since this sub-arch enables GPIOLIB
support, this results in buggy translations for non-internal GPIOs.

Get rid of the private gpio_to_irq() implementation, replacing it
with the .to_irq method in the sa1100 gpio chip instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
Grant, please apply to your gpio tree.  Thanks.

 arch/arm/mach-sa1100/include/mach/gpio.h |    3 ---
 drivers/gpio/gpio-sa1100.c               |    6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
index 7036318..a38fc4f 100644
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/gpio.h
@@ -51,7 +51,4 @@ static inline void gpio_set_value(unsigned gpio, int value)
 
 #define gpio_cansleep	__gpio_cansleep
 
-#define gpio_to_irq(gpio)	((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
-					(IRQ_GPIO11 - 11 + gpio))
-
 #endif
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c
index b6c1f6d..7eecf69 100644
--- a/drivers/gpio/gpio-sa1100.c
+++ b/drivers/gpio/gpio-sa1100.c
@@ -47,12 +47,18 @@ static int sa1100_direction_output(struct gpio_chip *chip, unsigned offset, int
 	return 0;
 }
 
+static int sa1100_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	return offset < 11 ? (IRQ_GPIO0 + offset) : (IRQ_GPIO11 - 11 + offset);
+}
+
 static struct gpio_chip sa1100_gpio_chip = {
 	.label			= "gpio",
 	.direction_input	= sa1100_direction_input,
 	.direction_output	= sa1100_direction_output,
 	.set			= sa1100_gpio_set,
 	.get			= sa1100_gpio_get,
+	.to_irq			= sa1100_to_irq,
 	.base			= 0,
 	.ngpio			= GPIO_MAX + 1,
 };

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
  2011-12-18 18:24 [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion Russell King - ARM Linux
@ 2011-12-18 23:17 ` Linus Walleij
  2012-01-07 12:02   ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2011-12-18 23:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 18, 2011 at 7:24 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

> From: Russell King <rmk+kernel@arm.linux.org.uk>
>
> The existing gpio_to_irq() implementation on sa1100 only translates
> validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB
> support, this results in buggy translations for non-internal GPIOs.
>
> Get rid of the private gpio_to_irq() implementation, replacing it
> with the .to_irq method in the sa1100 gpio chip instead.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Thanks Russell!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
  2011-12-18 23:17 ` Linus Walleij
@ 2012-01-07 12:02   ` Russell King - ARM Linux
  2012-01-13 23:17     ` Russell King - ARM Linux
  2012-01-13 23:18     ` Russell King - ARM Linux
  0 siblings, 2 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-01-07 12:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 19, 2011 at 12:17:01AM +0100, Linus Walleij wrote:
> On Sun, Dec 18, 2011 at 7:24 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> 
> > From: Russell King <rmk+kernel@arm.linux.org.uk>
> >
> > The existing gpio_to_irq() implementation on sa1100 only translates
> > validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB
> > support, this results in buggy translations for non-internal GPIOs.
> >
> > Get rid of the private gpio_to_irq() implementation, replacing it
> > with the .to_irq method in the sa1100 gpio chip instead.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Thanks Russell!
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Grant,

Have you queued this up or is it going to be missed for this merge window?

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
  2012-01-07 12:02   ` Russell King - ARM Linux
@ 2012-01-13 23:17     ` Russell King - ARM Linux
  2012-01-13 23:18     ` Russell King - ARM Linux
  1 sibling, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-01-13 23:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 07, 2012 at 12:02:30PM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 19, 2011 at 12:17:01AM +0100, Linus Walleij wrote:
> > On Sun, Dec 18, 2011 at 7:24 PM, Russell King - ARM Linux
> > <linux@arm.linux.org.uk> wrote:
> > 
> > > From: Russell King <rmk+kernel@arm.linux.org.uk>
> > >
> > > The existing gpio_to_irq() implementation on sa1100 only translates
> > > validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB
> > > support, this results in buggy translations for non-internal GPIOs.
> > >
> > > Get rid of the private gpio_to_irq() implementation, replacing it
> > > with the .to_irq method in the sa1100 gpio chip instead.
> > >
> > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > 
> > Thanks Russell!
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Grant,
> 
> Have you queued this up or is it going to be missed for this merge window?
> 
> Thanks.

Ping.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
  2012-01-07 12:02   ` Russell King - ARM Linux
  2012-01-13 23:17     ` Russell King - ARM Linux
@ 2012-01-13 23:18     ` Russell King - ARM Linux
  2012-01-14  5:37       ` Grant Likely
  1 sibling, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-01-13 23:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 07, 2012 at 12:02:30PM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 19, 2011 at 12:17:01AM +0100, Linus Walleij wrote:
> > On Sun, Dec 18, 2011 at 7:24 PM, Russell King - ARM Linux
> > <linux@arm.linux.org.uk> wrote:
> > 
> > > From: Russell King <rmk+kernel@arm.linux.org.uk>
> > >
> > > The existing gpio_to_irq() implementation on sa1100 only translates
> > > validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB
> > > support, this results in buggy translations for non-internal GPIOs.
> > >
> > > Get rid of the private gpio_to_irq() implementation, replacing it
> > > with the .to_irq method in the sa1100 gpio chip instead.
> > >
> > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > 
> > Thanks Russell!
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Grant,
> 
> Have you queued this up or is it going to be missed for this merge window?
> 
> Thanks.

Let's try that again, this time with Grant in the To: line rather than
Linus.

Ping.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
  2012-01-13 23:18     ` Russell King - ARM Linux
@ 2012-01-14  5:37       ` Grant Likely
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2012-01-14  5:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 13, 2012 at 11:18:20PM +0000, Russell King - ARM Linux wrote:
> On Sat, Jan 07, 2012 at 12:02:30PM +0000, Russell King - ARM Linux wrote:
> > On Mon, Dec 19, 2011 at 12:17:01AM +0100, Linus Walleij wrote:
> > > On Sun, Dec 18, 2011 at 7:24 PM, Russell King - ARM Linux
> > > <linux@arm.linux.org.uk> wrote:
> > > 
> > > > From: Russell King <rmk+kernel@arm.linux.org.uk>
> > > >
> > > > The existing gpio_to_irq() implementation on sa1100 only translates
> > > > validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB
> > > > support, this results in buggy translations for non-internal GPIOs.
> > > >
> > > > Get rid of the private gpio_to_irq() implementation, replacing it
> > > > with the .to_irq method in the sa1100 gpio chip instead.
> > > >
> > > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > > 
> > > Thanks Russell!
> > > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > 
> > Grant,
> > 
> > Have you queued this up or is it going to be missed for this merge window?
> > 
> > Thanks.
> 
> Let's try that again, this time with Grant in the To: line rather than
> Linus.

Applied.  Sorry for the delay.  I dropped a lot of patches over
Christmas because I couldn't keep up on my email

g.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-14  5:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-18 18:24 [PATCH] GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion Russell King - ARM Linux
2011-12-18 23:17 ` Linus Walleij
2012-01-07 12:02   ` Russell King - ARM Linux
2012-01-13 23:17     ` Russell King - ARM Linux
2012-01-13 23:18     ` Russell King - ARM Linux
2012-01-14  5:37       ` Grant Likely

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).