DaVinci: GPIO: fixes
Subsystems (5)
cover DaVinci: GPIO: fixes
From: "Lad, Prabhakar" <[email protected]>
This patch series fixes gpio driver regestration
and offset check for unbanked gpio.
Lad, Prabhakar (2):
gpio: davinci: Fix a check for unbanked gpio
ARM: davinci: Fix number of resources passed to
davinci_gpio_register() call
arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- drivers/gpio/gpio-davinci.c | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/2 gpio: davinci: Fix a check for unbanked gpio
From: "Lad, Prabhakar" <[email protected]>
This patch fixes a check for offset in gpio_to_irq_unbanked() and also assigns gpio_irq, gpio_unbanked of chips[0] to appropriate values which is used in gpio_to_irq_unbanked() function.
--- drivers/gpio/gpio-davinci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpio-davinci.c +3 -1
@@ -327,7 +327,7 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset)* NOTE: we assume for now that only irqs in the first gpio_chip * can provide direct-mapped IRQs to AINTC (up to 32 GPIOs). */ -if (offset < d->irq_base) +if (offset < d->gpio_unbanked)return d->gpio_irq + offset;else return -ENODEV ;
@@ -419,6 +419,8 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)/* pass "bank 0" GPIO IRQs to AINTC */ chips[0 ].chip.to_irq = gpio_to_irq_unbanked; + chips[0 ].gpio_irq = bank_irq; + chips[0 ].gpio_unbanked = pdata->gpio_unbanked; binten =BIT (0 );/* AINTC handles mask/unmask; GPIO handles triggering */
Signature · 1 line
1.7.9.5
Re: [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio
Quoted 9 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch fixes a check for offset in
gpio_to_irq_unbanked()and also assignsgpio_irq,gpio_unbankedof chips[0] to appropriate values which is used ingpio_to_irq_unbanked()function.Reported-by Grygorii Strashko <[email protected]>Signed-off-by Lad, Prabhakar <[email protected]>
You should note explicitly that this patch fixes broken unbanked IRQ support. You mostly just described what you are doing.
I will fixup while committing.
Thanks,
Sekhar
Quoted 27 lines
--- drivers/gpio/gpio-davinci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpio/gpio-davinci.c +3
-1@@ -327,7 +327,7 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset)* NOTE: we assume for now that only irqs in the first gpio_chip * can provide direct-mapped IRQs to AINTC (up to 32 GPIOs). */ -if (offset < d->irq_base) +if (offset < d->gpio_unbanked)return d->gpio_irq + offset;else return -ENODEV ;@@ -419,6 +419,8 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)/* pass "bank 0" GPIO IRQs to AINTC */ chips[0 ].chip.to_irq = gpio_to_irq_unbanked; + chips[0 ].gpio_irq = bank_irq; + chips[0 ].gpio_unbanked = pdata->gpio_unbanked; binten =BIT (0 );/* AINTC handles mask/unmask; GPIO handles triggering */
Linus Walleij
Acked-byRe: [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio
Quoted 8 lines · Sekhar Nori
Quoted 7 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch fixes a check for offset in
gpio_to_irq_unbanked()and also assignsgpio_irq,gpio_unbankedof chips[0] to appropriate values which is used ingpio_to_irq_unbanked()function.
Quoted 7 lines
Quoted 2 lines
Reported-by Grygorii Strashko <[email protected]>Signed-off-by Lad, Prabhakar <[email protected]>You should note explicitly that this patch fixes broken unbanked IRQ support. You mostly just described what you are doing.
I will fixup while committing.
So you're carrying this patch Sekhar?
Thanks:
Yours,
Linus Walleij
Re: [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio
Quoted 12 lines · Linus Walleij
Quoted 11 lines · Sekhar Nori
Quoted 9 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch fixes a check for offset in
gpio_to_irq_unbanked()and also assignsgpio_irq,gpio_unbankedof chips[0] to appropriate values which is used ingpio_to_irq_unbanked()function.Reported-by Grygorii Strashko <[email protected]>Signed-off-by Lad, Prabhakar <[email protected]>
Quoted 6 lines
Quoted 4 lines
You should note explicitly that this patch fixes broken unbanked IRQ support. You mostly just described what you are doing.
I will fixup while committing.
So you're carrying this patch Sekhar?
Yes, and I would have sent this for upstream already if not for I going under the weather a bit past couple of days.
Thanks,
Sekhar
PATCH 2/2 ARM: davinci: Fix number of resources passed to davinci_gpio_register() call
In reply to Prabhakar LadFrom: "Lad, Prabhakar" <[email protected]>
The davinci_gpio_register() function expects the number of resources as the second parameter, but size of resources was passed to it due to which it was causing unexpected behaviour. This patch fixes the same by passing the ARRAY_SIZE of resources.
--- arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/dm355.c +1 -1
@@ -906,7 +906,7 @@ static struct davinci_gpio_platform_data dm355_gpio_platform_data = {int __init dm355_gpio_register (void ) {return davinci_gpio_register (dm355_gpio_resources, -sizeof (dm355_gpio_resources), +ARRAY_SIZE (dm355_gpio_resources), &dm355_gpio_platform_data); }/*----------------------------------------------------------------------*/
arch/arm/mach-davinci/dm365.c +1 -1
@@ -720,7 +720,7 @@ static struct davinci_gpio_platform_data dm365_gpio_platform_data = {int __init dm365_gpio_register (void ) {return davinci_gpio_register (dm365_gpio_resources, -sizeof (dm365_gpio_resources), +ARRAY_SIZE (dm365_gpio_resources), &dm365_gpio_platform_data); }
arch/arm/mach-davinci/dm644x.c +1 -1
@@ -792,7 +792,7 @@ static struct davinci_gpio_platform_data dm644_gpio_platform_data = {int __init dm644x_gpio_register (void ) {return davinci_gpio_register (dm644_gpio_resources, -sizeof (dm644_gpio_resources), +ARRAY_SIZE (dm644_gpio_resources), &dm644_gpio_platform_data); }/*----------------------------------------------------------------------*/
arch/arm/mach-davinci/dm646x.c +1 -1
@@ -769,7 +769,7 @@ static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {int __init dm646x_gpio_register (void ) {return davinci_gpio_register (dm646x_gpio_resources, -sizeof (dm646x_gpio_resources), +ARRAY_SIZE (dm646x_gpio_resources), &dm646x_gpio_platform_data); }/*----------------------------------------------------------------------*/
Signature · 1 line
1.7.9.5
Hi Sekhar, Prabhakar Lad
On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <[email protected]>
Quoted 8 lines
This patch series fixes gpio driver regestration
and offset check for unbanked gpio.Lad, Prabhakar (2):
gpio: davinci: Fix a check for unbanked gpio
ARM: davinci: Fix number of resources passed to
davinci_gpio_register()call
I've verified both patches - looks ok.
Patch 1 - restores unbanked GPIO IRQs functionality
Patch 2 - allows to register GPIO Platform devices and boot without issues.
Could we move forward with these patches?
Quoted 8 lines
arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- drivers/gpio/gpio-davinci.c | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Grygorii,
Quoted 4 lines · Grygorii Strashko
Hi Sekhar, Prabhakar Lad
On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <
Quoted 4 lines
Quoted 4 lines
This patch series fixes gpio driver regestration
and offset check for unbanked gpio.
Quoted 8 lines
Quoted 4 lines
Lad, Prabhakar (2):
gpio: davinci: Fix a check for unbanked gpio
ARM: davinci: Fix number of resources passed to
davinci_gpio_register()callI've verified both patches - looks ok.
Patch 1 - restores unbanked GPIO IRQs functionality Patch 2 - allows to register GPIO Platform devices and boot without
issues.
Quoted 3 lines
Could we move forward with these patches?
Can you ACk the patches ?
Regards,
--Prabhakar
Quoted 12 lines · Grygorii Strashko
Hi Sekhar, Prabhakar Lad
On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <[email protected]>
Quoted 8 lines
This patch series fixes gpio driver regestration
and offset check for unbanked gpio.Lad, Prabhakar (2):
gpio: davinci: Fix a check for unbanked gpio
ARM: davinci: Fix number of resources passed to
davinci_gpio_register()call
Quoted 5 lines
I've verified both patches - looks ok.
Patch 1 - restores unbanked GPIO IRQs functionality
Patch 2 - allows to register GPIO Platform devices and boot without issues.Could we move forward with these patches?
Prabhakar, both patches look good to me. Thanks for the fixes.
Also Grygorii, have you actually verified that the unbanked IRQ support works? Only DM365 uses it.
What do I add for you? Tested-by: or Acked-by:
Thanks,
Sekhar
Hi Sekhar,
Quoted 17 lines · Sekhar Nori
Quoted 16 lines · Grygorii Strashko
Hi Sekhar, Prabhakar Lad
On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <[email protected]>
Quoted 8 lines
This patch series fixes gpio driver regestration
and offset check for unbanked gpio.Lad, Prabhakar (2):
gpio: davinci: Fix a check for unbanked gpio
ARM: davinci: Fix number of resources passed to
davinci_gpio_register()callI've verified both patches - looks ok.
Patch 1 - restores unbanked GPIO IRQs functionality
Patch 2 - allows to register GPIO Platform devices and boot without issues.
Quoted 6 lines
Quoted 1 line
Could we move forward with these patches?
Prabhakar, both patches look good to me. Thanks for the fixes.
Also Grygorii, have you actually verified that the unbanked IRQ support works? Only DM365 uses it.
Yes, I've verified it, but on Keystone which has similar GPIO IP which supports only unbanked IRQs.
Quoted 2 lines
What do I add for you? Tested-by: or Acked-by:
^Up to you :), but if I understand things right "Acked-by:" included all above
Regards,
- grygorii