Re: [PATCH 1/2] gpio: tegra: create irq mapping in gpio_to_irq

2012-11-07 Thread Laxman Dewangan

On Wednesday 07 November 2012 10:38 PM, Stephen Warren wrote:

On 11/07/2012 08:01 AM, Laxman Dewangan wrote:

The gpio interrupts get mapped linearly and hence the mapping
of irq need to be created by irq_create_mapping().

The function gpio_to_irq() returns the irq by irq_find_mapping()
and so returns 0 as there is no mapping created. Fix the function
to create mapping when gpio_to_irq() get called.

I'm not convinced this should be needed. tegra_gpio_probe() contains:



Oh, yes, I did not observe this code in my review. So this change is not 
resolving any issue.



I think we should move the mapping to gpio_to_irq() rather than doing 
this in probe.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] gpio: tegra: create irq mapping in gpio_to_irq

2012-11-07 Thread Stephen Warren
On 11/07/2012 08:01 AM, Laxman Dewangan wrote:
> The gpio interrupts get mapped linearly and hence the mapping
> of irq need to be created by irq_create_mapping().
> 
> The function gpio_to_irq() returns the irq by irq_find_mapping()
> and so returns 0 as there is no mapping created. Fix the function
> to create mapping when gpio_to_irq() get called.

I'm not convinced this should be needed. tegra_gpio_probe() contains:

> for (gpio = 0; gpio < tegra_gpio_chip.ngpio; gpio++) {
> int irq = irq_create_mapping(irq_domain, gpio);

which should create the mapping for every IRQ.

(although I do think the gpiochip_add() should be moved to the very end
of probe(), I doubt that impacts this issue much)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] gpio: tegra: create irq mapping in gpio_to_irq

2012-11-07 Thread Laxman Dewangan
The gpio interrupts get mapped linearly and hence the mapping
of irq need to be created by irq_create_mapping().

The function gpio_to_irq() returns the irq by irq_find_mapping()
and so returns 0 as there is no mapping created. Fix the function
to create mapping when gpio_to_irq() get called.

Signed-off-by: Laxman Dewangan 
---
 drivers/gpio/gpio-tegra.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index c7c175a..6c08613 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -156,7 +156,7 @@ static int tegra_gpio_direction_output(struct gpio_chip 
*chip, unsigned offset,
 
 static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
-   return irq_find_mapping(irq_domain, offset);
+   return irq_create_mapping(irq_domain, offset);
 }
 
 static struct gpio_chip tegra_gpio_chip = {
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] gpio: tegra: create irq mapping in gpio_to_irq

2012-11-07 Thread Laxman Dewangan
The gpio interrupts get mapped linearly and hence the mapping
of irq need to be created by irq_create_mapping().

The function gpio_to_irq() returns the irq by irq_find_mapping()
and so returns 0 as there is no mapping created. Fix the function
to create mapping when gpio_to_irq() get called.

Signed-off-by: Laxman Dewangan ldewan...@nvidia.com
---
 drivers/gpio/gpio-tegra.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index c7c175a..6c08613 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -156,7 +156,7 @@ static int tegra_gpio_direction_output(struct gpio_chip 
*chip, unsigned offset,
 
 static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
-   return irq_find_mapping(irq_domain, offset);
+   return irq_create_mapping(irq_domain, offset);
 }
 
 static struct gpio_chip tegra_gpio_chip = {
-- 
1.7.1.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] gpio: tegra: create irq mapping in gpio_to_irq

2012-11-07 Thread Stephen Warren
On 11/07/2012 08:01 AM, Laxman Dewangan wrote:
 The gpio interrupts get mapped linearly and hence the mapping
 of irq need to be created by irq_create_mapping().
 
 The function gpio_to_irq() returns the irq by irq_find_mapping()
 and so returns 0 as there is no mapping created. Fix the function
 to create mapping when gpio_to_irq() get called.

I'm not convinced this should be needed. tegra_gpio_probe() contains:

 for (gpio = 0; gpio  tegra_gpio_chip.ngpio; gpio++) {
 int irq = irq_create_mapping(irq_domain, gpio);

which should create the mapping for every IRQ.

(although I do think the gpiochip_add() should be moved to the very end
of probe(), I doubt that impacts this issue much)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] gpio: tegra: create irq mapping in gpio_to_irq

2012-11-07 Thread Laxman Dewangan

On Wednesday 07 November 2012 10:38 PM, Stephen Warren wrote:

On 11/07/2012 08:01 AM, Laxman Dewangan wrote:

The gpio interrupts get mapped linearly and hence the mapping
of irq need to be created by irq_create_mapping().

The function gpio_to_irq() returns the irq by irq_find_mapping()
and so returns 0 as there is no mapping created. Fix the function
to create mapping when gpio_to_irq() get called.

I'm not convinced this should be needed. tegra_gpio_probe() contains:



Oh, yes, I did not observe this code in my review. So this change is not 
resolving any issue.



I think we should move the mapping to gpio_to_irq() rather than doing 
this in probe.


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/