public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio/tegra: Remove use of irq_to_gpio
@ 2011-08-05 22:15 Stephen Warren
  2011-08-05 22:15 ` [PATCH 2/2] arm/tegra: Delete irq_to_gpio Stephen Warren
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2011-08-05 22:15 UTC (permalink / raw)
  To: linux-arm-kernel

irq_to_gpio is being removed. Replace the only use of that API by
the ARM Tegra sub-architecture.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
This patch depends on changes in Grant's gpio/next tree: at least the
move from arch/arm/mach-tegra/gpio.c to drivers/gpio/gpio-tegra.c.

 drivers/gpio/gpio-tegra.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 747eb40..7b9663b 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -331,6 +331,7 @@ static struct lock_class_key gpio_lock_class;
 static int __init tegra_gpio_init(void)
 {
 	struct tegra_gpio_bank *bank;
+	int gpio;
 	int i;
 	int j;
 
@@ -352,14 +353,17 @@ static int __init tegra_gpio_init(void)
 
 	gpiochip_add(&tegra_gpio_chip);
 
-	for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
-		bank = &tegra_gpio_banks[GPIO_BANK(irq_to_gpio(i))];
+	for (gpio = 0; gpio < TEGRA_NR_GPIOS; gpio++) {
+		int irq = gpio_to_irq(gpio);
+		/* No validity check; all Tegra GPIOs are valid IRQs */
 
-		irq_set_lockdep_class(i, &gpio_lock_class);
-		irq_set_chip_data(i, bank);
-		irq_set_chip_and_handler(i, &tegra_gpio_irq_chip,
+		bank = &tegra_gpio_banks[GPIO_BANK(gpio)];
+
+		irq_set_lockdep_class(irq, &gpio_lock_class);
+		irq_set_chip_data(irq, bank);
+		irq_set_chip_and_handler(irq, &tegra_gpio_irq_chip,
 					 handle_simple_irq);
-		set_irq_flags(i, IRQF_VALID);
+		set_irq_flags(irq, IRQF_VALID);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) {
-- 
1.7.0.4

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-05 22:15 [PATCH 1/2] gpio/tegra: Remove use of irq_to_gpio Stephen Warren
@ 2011-08-05 22:15 ` Stephen Warren
  2011-08-06 17:45   ` Grant Likely
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2011-08-05 22:15 UTC (permalink / raw)
  To: linux-arm-kernel

irq_to_gpio is deprecated and in the process of being removed. Make that
happen now for ARM Tegra.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
I assume this will go into one of arm-soc.git's branches, but it depends
on the previous patch in this series to compile. Arnd, I see you already
have Grant's gpio/next tree in your repo as depends/gpio, so I assume
you'll just pick up and merge the latest version of Grant's tree before
applying this patch?

Both patches compiled with a number of Tegra boards enable and tested on
Harmony. All without Device Tree support.

 arch/arm/mach-tegra/include/mach/gpio.h |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index 196f114..b357808 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -32,7 +32,6 @@
 #define gpio_cansleep		__gpio_cansleep
 
 #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
-#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE)
 
 static inline int gpio_to_irq(unsigned int gpio)
 {
@@ -41,13 +40,6 @@ static inline int gpio_to_irq(unsigned int gpio)
 	return -EINVAL;
 }
 
-static inline int irq_to_gpio(unsigned int irq)
-{
-	if ((irq >= INT_GPIO_BASE) && (irq < INT_GPIO_BASE + INT_GPIO_NR))
-		return irq - INT_GPIO_BASE;
-	return -EINVAL;
-}
-
 struct tegra_gpio_table {
 	int	gpio;	/* GPIO number */
 	bool	enable;	/* Enable for GPIO@init? */
-- 
1.7.0.4

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-05 22:15 ` [PATCH 2/2] arm/tegra: Delete irq_to_gpio Stephen Warren
@ 2011-08-06 17:45   ` Grant Likely
  2011-08-08 14:26     ` Stephen Warren
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2011-08-06 17:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 05, 2011 at 04:15:34PM -0600, Stephen Warren wrote:
> irq_to_gpio is deprecated and in the process of being removed. Make that
> happen now for ARM Tegra.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied both.  Thanks.

g.

> ---
> I assume this will go into one of arm-soc.git's branches, but it depends
> on the previous patch in this series to compile. Arnd, I see you already
> have Grant's gpio/next tree in your repo as depends/gpio, so I assume
> you'll just pick up and merge the latest version of Grant's tree before
> applying this patch?
> 
> Both patches compiled with a number of Tegra boards enable and tested on
> Harmony. All without Device Tree support.
> 
>  arch/arm/mach-tegra/include/mach/gpio.h |    8 --------
>  1 files changed, 0 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
> index 196f114..b357808 100644
> --- a/arch/arm/mach-tegra/include/mach/gpio.h
> +++ b/arch/arm/mach-tegra/include/mach/gpio.h
> @@ -32,7 +32,6 @@
>  #define gpio_cansleep		__gpio_cansleep
>  
>  #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
> -#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE)
>  
>  static inline int gpio_to_irq(unsigned int gpio)
>  {
> @@ -41,13 +40,6 @@ static inline int gpio_to_irq(unsigned int gpio)
>  	return -EINVAL;
>  }
>  
> -static inline int irq_to_gpio(unsigned int irq)
> -{
> -	if ((irq >= INT_GPIO_BASE) && (irq < INT_GPIO_BASE + INT_GPIO_NR))
> -		return irq - INT_GPIO_BASE;
> -	return -EINVAL;
> -}
> -
>  struct tegra_gpio_table {
>  	int	gpio;	/* GPIO number */
>  	bool	enable;	/* Enable for GPIO at init? */
> -- 
> 1.7.0.4
> 

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-06 17:45   ` Grant Likely
@ 2011-08-08 14:26     ` Stephen Warren
  2011-08-08 14:51       ` Olof Johansson
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2011-08-08 14:26 UTC (permalink / raw)
  To: linux-arm-kernel

Grant Likely wrote at Saturday, August 06, 2011 11:45 AM:
> On Fri, Aug 05, 2011 at 04:15:34PM -0600, Stephen Warren wrote:
> > irq_to_gpio is deprecated and in the process of being removed. Make that
> > happen now for ARM Tegra.
> >
> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> Applied both.  Thanks.

Didn't you want an Ack by a Tegra maintainer first?

I assume they were both applied to gpio-next (although a fresh fetch  of that
doesn't show the commits)

> > I assume this will go into one of arm-soc.git's branches, but it depends
> > on the previous patch in this series to compile. Arnd, I see you already
> > have Grant's gpio/next tree in your repo as depends/gpio, so I assume
> > you'll just pick up and merge the latest version of Grant's tree before
> > applying this patch?
> >
> > Both patches compiled with a number of Tegra boards enable and tested on
> > Harmony. All without Device Tree support.
> >
> >  arch/arm/mach-tegra/include/mach/gpio.h |    8 --------
> >  1 files changed, 0 insertions(+), 8 deletions(-)

-- 
nvpublic

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-08 14:26     ` Stephen Warren
@ 2011-08-08 14:51       ` Olof Johansson
  2011-08-08 17:50         ` Grant Likely
  0 siblings, 1 reply; 8+ messages in thread
From: Olof Johansson @ 2011-08-08 14:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 8, 2011 at 7:26 AM, Stephen Warren <swarren@nvidia.com> wrote:
> Grant Likely wrote at Saturday, August 06, 2011 11:45 AM:
>> On Fri, Aug 05, 2011 at 04:15:34PM -0600, Stephen Warren wrote:
>> > irq_to_gpio is deprecated and in the process of being removed. Make that
>> > happen now for ARM Tegra.
>> >
>> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>
>> Applied both. ?Thanks.
>
> Didn't you want an Ack by a Tegra maintainer first?

Acked-by: Olof Johansson <olof@lixom.net>

But either way is OK. No need to rebase to add an acked-by, as far as
I am concerned.


-Olof

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-08 14:51       ` Olof Johansson
@ 2011-08-08 17:50         ` Grant Likely
  2011-08-08 18:05           ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2011-08-08 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Aug 8, 2011 8:26 AM, "Stephen Warren" <swarren@nvidia.com> wrote:
>
> Grant Likely wrote at Saturday, August 06, 2011 11:45 AM:
> > On Fri, Aug 05, 2011 at 04:15:34PM -0600, Stephen Warren wrote:
> > > irq_to_gpio is deprecated and in the process of being removed. Make that
> > > happen now for ARM Tegra.
> > >
> > > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >
> > Applied both. ?Thanks.
>
> Didn't you want an Ack by a Tegra maintainer first?

It looks like a pretty low risk change.? I didn't see much risk in
picking it up and getting it off my plate.? I can always pull things
back out of my tree if someone complains.  I'll add Olof's ack before
it gets into linux-next.

>
> I assume they were both applied to gpio-next (although a fresh fetch ?of that
> doesn't show the commits)

I can't push it out until after 3.1-rc1 is released because it is
targeted at 3.2 now.

g.

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-08 17:50         ` Grant Likely
@ 2011-08-08 18:05           ` Russell King - ARM Linux
  2011-08-08 18:10             ` Grant Likely
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2011-08-08 18:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 08, 2011 at 11:50:47AM -0600, Grant Likely wrote:
> On Aug 8, 2011 8:26 AM, "Stephen Warren" <swarren@nvidia.com> wrote:
> >
> > Grant Likely wrote at Saturday, August 06, 2011 11:45 AM:
> > > On Fri, Aug 05, 2011 at 04:15:34PM -0600, Stephen Warren wrote:
> > > > irq_to_gpio is deprecated and in the process of being removed. Make that
> > > > happen now for ARM Tegra.
> > > >
> > > > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> > >
> > > Applied both. ?Thanks.
> >
> > Didn't you want an Ack by a Tegra maintainer first?
> 
> It looks like a pretty low risk change.? I didn't see much risk in
> picking it up and getting it off my plate.? I can always pull things
> back out of my tree if someone complains.  I'll add Olof's ack before
> it gets into linux-next.
> 
> >
> > I assume they were both applied to gpio-next (although a fresh fetch ?of that
> > doesn't show the commits)
> 
> I can't push it out until after 3.1-rc1 is released because it is
> targeted at 3.2 now.

It'd probably make sense for it to be merged into my tree along with
the rest of my gpio changes, otherwise we're going to head for merge
conflicts.  I'll be publishing those gpio.h changes in the next few
days.

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

* [PATCH 2/2] arm/tegra: Delete irq_to_gpio
  2011-08-08 18:05           ` Russell King - ARM Linux
@ 2011-08-08 18:10             ` Grant Likely
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2011-08-08 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 8, 2011 at 12:05 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Aug 08, 2011 at 11:50:47AM -0600, Grant Likely wrote:
>> On Aug 8, 2011 8:26 AM, "Stephen Warren" <swarren@nvidia.com> wrote:
>> >
>> > Grant Likely wrote at Saturday, August 06, 2011 11:45 AM:
>> > > On Fri, Aug 05, 2011 at 04:15:34PM -0600, Stephen Warren wrote:
>> > > > irq_to_gpio is deprecated and in the process of being removed. Make that
>> > > > happen now for ARM Tegra.
>> > > >
>> > > > Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> > >
>> > > Applied both. ?Thanks.
>> >
>> > Didn't you want an Ack by a Tegra maintainer first?
>>
>> It looks like a pretty low risk change.? I didn't see much risk in
>> picking it up and getting it off my plate.? I can always pull things
>> back out of my tree if someone complains. ?I'll add Olof's ack before
>> it gets into linux-next.
>>
>> >
>> > I assume they were both applied to gpio-next (although a fresh fetch ?of that
>> > doesn't show the commits)
>>
>> I can't push it out until after 3.1-rc1 is released because it is
>> targeted at 3.2 now.
>
> It'd probably make sense for it to be merged into my tree along with
> the rest of my gpio changes, otherwise we're going to head for merge
> conflicts. ?I'll be publishing those gpio.h changes in the next few
> days.

Okay, I'll drop it from my tree and you can add my:

Acked-by: Grant Likely <grant.likely@secretlab.ca>

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

end of thread, other threads:[~2011-08-08 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-05 22:15 [PATCH 1/2] gpio/tegra: Remove use of irq_to_gpio Stephen Warren
2011-08-05 22:15 ` [PATCH 2/2] arm/tegra: Delete irq_to_gpio Stephen Warren
2011-08-06 17:45   ` Grant Likely
2011-08-08 14:26     ` Stephen Warren
2011-08-08 14:51       ` Olof Johansson
2011-08-08 17:50         ` Grant Likely
2011-08-08 18:05           ` Russell King - ARM Linux
2011-08-08 18:10             ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox