gpio: davinci: driver fixes
Subsystems (2)
Keerthy
maintainercover gpio: davinci: driver fixes
The series has couple of for the gpio driver.
Keerthy (1):
gpio: davinci: Add the missing of-node pointer in the
irq_domain_add_legacy function call
Lokesh Vutla (1):
gpio: davinci: Fix the number of controllers allocated
drivers/gpio/gpio-davinci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
Keerthy
maintainerPATCH 1/2 gpio: davinci: Add the missing of-node pointer in the irq_domain_add_legacy function call
Currently the first parameter of irq_domain_add_legacy is NULL. irq_find_host function returns NULL when we do not populate the of_node and hence irq_of_parse_and_map call fails whenever we want to request a gpio irq. This fixes the request_irq failures for gpio interrupts.
--- drivers/gpio/gpio-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-davinci.c +1 -1
@@ -511,7 +511,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)return irq; } - irq_domain =irq_domain_add_legacy (NULL , ngpio, irq,0 , + irq_domain =irq_domain_add_legacy (dev->of_node, ngpio, irq,0 , &davinci_gpio_irq_ops, chips);if (!irq_domain) {
Signature · 1 line
1.9.1
Re: [PATCH 1/2] gpio: davinci: Add the missing of-node pointer in the irq_domain_add_legacy function call
Quoted 6 lines · Keerthy
Currently the first parameter of
irq_domain_add_legacyis NULL.irq_find_hostfunction returns NULL when we do not populate theof_nodeand henceirq_of_parse_and_mapcall fails whenever we want to request a gpio irq. This fixes therequest_irqfailures for gpio interrupts.Signed-off-by Keerthy <[email protected]>
Quoted 18 lines
--- drivers/gpio/gpio-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/gpio-davinci.c +1
-1@@ -511,7 +511,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)return irq; } - irq_domain =irq_domain_add_legacy (NULL , ngpio, irq,0 , + irq_domain =irq_domain_add_legacy (dev->of_node, ngpio, irq,0 , &davinci_gpio_irq_ops, chips);if (!irq_domain) {
Signature · 2 lines
regards, -grygorii
Re: [PATCH 1/2] gpio: davinci: Add the missing of-node pointer in the irq_domain_add_legacy function call
Quoted 9 lines · Grygorii Strashko
Quoted 6 lines · Keerthy
Currently the first parameter of
irq_domain_add_legacyis NULL.irq_find_hostfunction returns NULL when we do not populate theof_nodeand henceirq_of_parse_and_mapcall fails whenever we want to request a gpio irq. This fixes therequest_irqfailures for gpio interrupts.Signed-off-by Keerthy <[email protected]>Reviewed-by Grygorii Strashko <[email protected]>
A gentle ping on this patch. Thanks Grygorii for the review.
Quoted 22 lines
Quoted 20 lines
--- drivers/gpio/gpio-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/gpio-davinci.c +1
-1@@ -511,7 +511,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)return irq; } - irq_domain =irq_domain_add_legacy (NULL , ngpio, irq,0 , + irq_domain =irq_domain_add_legacy (dev->of_node, ngpio, irq,0 , &davinci_gpio_irq_ops, chips);if (!irq_domain) {
Re: [PATCH 1/2] gpio: davinci: Add the missing of-node pointer in the irq_domain_add_legacy function call
In reply to KeerthyQuoted 6 lines · Keerthy
Currently the first parameter of
irq_domain_add_legacyis NULL.irq_find_hostfunction returns NULL when we do not populate theof_nodeand henceirq_of_parse_and_mapcall fails whenever we want to request a gpio irq. This fixes therequest_irqfailures for gpio interrupts.Signed-off-by Keerthy <[email protected]>
Patch applied for fixes with Grygorii's review tag.
Yours,
Linus Walleij
Keerthy
maintainerPATCH 2/2 gpio: davinci: Fix the number of controllers allocated
In reply to KeerthyFrom: Lokesh Vutla <[email protected]>
Driver only needs to allocate for [ngpio / 32] controllers, as each controller handles 32 gpios. But the current driver allocates for ngpio of which the extra allocated are unused. Fix it be registering only the required number of controllers.
--- drivers/gpio/gpio-davinci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpio/gpio-davinci.c +3 -2
@@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc,static int davinci_gpio_probe (struct platform_device *pdev) {int i, base; -unsigned ngpio; +unsigned ngpio, nbank;struct davinci_gpio_controller *chips;struct davinci_gpio_platform_data *pdata;struct davinci_gpio_regs __iomem *regs;
@@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (WARN_ON (ARCH_NR_GPIOS < ngpio)) ngpio =ARCH_NR_GPIOS ; + nbank =DIV_ROUND_UP (ngpio,32 ); chips =devm_kzalloc (dev, - ngpio *sizeof (struct davinci_gpio_controller ), + nbank *sizeof (struct davinci_gpio_controller ),GFP_KERNEL );if (!chips)return -ENOMEM ;
Signature · 1 line
1.9.1
Re: [PATCH 2/2] gpio: davinci: Fix the number of controllers allocated
Quoted 9 lines · Keerthy
From: Lokesh Vutla <[email protected]>
Driver only needs to allocate for [ngpio / 32] controllers, as each controller handles 32 gpios. But the current driver allocates for ngpio of which the extra allocated are unused. Fix it be registering only the required number of controllers.
Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Keerthy <[email protected]>
Quoted 29 lines
--- drivers/gpio/gpio-davinci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpio/gpio-davinci.c +3
-2@@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc,static int davinci_gpio_probe (struct platform_device *pdev) {int i, base; -unsigned ngpio; +unsigned ngpio, nbank;struct davinci_gpio_controller *chips;struct davinci_gpio_platform_data *pdata;struct davinci_gpio_regs __iomem *regs;@@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (WARN_ON (ARCH_NR_GPIOS < ngpio)) ngpio =ARCH_NR_GPIOS ; + nbank =DIV_ROUND_UP (ngpio,32 ); chips =devm_kzalloc (dev, - ngpio *sizeof (struct davinci_gpio_controller ), + nbank *sizeof (struct davinci_gpio_controller ),GFP_KERNEL );if (!chips)return -ENOMEM ;
Signature · 2 lines
regards, -grygorii
Re: [PATCH 2/2] gpio: davinci: Fix the number of controllers allocated
Quoted 8 lines · Grygorii Strashko
Quoted 7 lines · Keerthy
From: Lokesh Vutla <[email protected]>
Driver only needs to allocate for [ngpio / 32] controllers, as each controller handles 32 gpios. But the current driver allocates for ngpio of which the extra allocated are unused. Fix it be registering only the required number of controllers.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Keerthy <[email protected]>Reviewed-by Grygorii Strashko <[email protected]>
A gentle ping on this patch. Thanks Grygorii for the review.
Quoted 34 lines
Quoted 32 lines
--- drivers/gpio/gpio-davinci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpio/gpio-davinci.c +1
-1@@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc, static int davinci_gpio_probe(struct platform_device *pdev) {int i, base; -unsigned ngpio; +unsigned ngpio, nbank;struct davinci_gpio_controller *chips;struct davinci_gpio_platform_data *pdata;struct davinci_gpio_regs __iomem *regs;drivers/gpio/gpio-davinci.c +2
-1@@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (WARN_ON (ARCH_NR_GPIOS < ngpio)) ngpio =ARCH_NR_GPIOS ; + nbank =DIV_ROUND_UP (ngpio,32 ); chips =devm_kzalloc (dev, - ngpio *sizeof (struct davinci_gpio_controller ), + nbank *sizeof (struct davinci_gpio_controller ),GFP_KERNEL );if (!chips)return -ENOMEM;
Re: [PATCH 2/2] gpio: davinci: Fix the number of controllers allocated
In reply to KeerthyQuoted 9 lines · Keerthy
From: Lokesh Vutla <[email protected]>
Driver only needs to allocate for [ngpio / 32] controllers, as each controller handles 32 gpios. But the current driver allocates for ngpio of which the extra allocated are unused. Fix it be registering only the required number of controllers.
Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Keerthy <[email protected]>
Patch applied for fixes with Grygorii's review tag.
Yours,
Linus Walleij