All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
@ 2016-10-24 16:18 Deepak Das
  2016-10-25 12:05 ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Deepak Das @ 2016-10-24 16:18 UTC (permalink / raw)
  To: Linus Walleij, shawnguo
  Cc: linux-gpio, vzapolsk, fabio.estevam, kernel, p.zabel


generic gpio request/free should be added after gpiocip registration
to validate mapping of gpiochip with pinctrl subsystem.

gpiochip->pin_ranges list contains the information used by pinctrl
subsystem to configure corresponding pins for gpio usage.
This list will be empty if gpiochip fails to map with
pinctrl subsystem for any reason.
For Ex.:-
generic gpio request/free should not be used if IOMUX pin controller
device node is disabled in device tree.

This commit checks above list and skips adding generic gpio request/free
if list is found empty.

Signed-off-by: Deepak Das <deepak_das@mentor.com>
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
 drivers/gpio/gpio-mxc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index c1a1e00..9f79a9f 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -458,11 +458,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        if (err)
                goto out_bgio;

-       if (of_property_read_bool(np, "gpio-ranges")) {
-               port->gc.request = gpiochip_generic_request;
-               port->gc.free = gpiochip_generic_free;
-       }
-
        port->gc.to_irq = mxc_gpio_to_irq;
        port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
                                             pdev->id * 32;
@@ -471,6 +466,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        if (err)
                goto out_bgio;

+       if (!list_empty(&port->gc.pin_ranges)) {
+               port->gc.request = gpiochip_generic_request;
+               port->gc.free = gpiochip_generic_free;
+       }
+
        irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
        if (irq_base < 0) {
                err = irq_base;
-- 
1.9.1

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

* Re: [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
  2016-10-24 16:18 [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration Deepak Das
@ 2016-10-25 12:05 ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2016-10-25 12:05 UTC (permalink / raw)
  To: Deepak Das
  Cc: Shawn Guo, linux-gpio, vzapolsk, Fabio Estevam, Sascha Hauer,
	Philipp Zabel

On Mon, Oct 24, 2016 at 6:18 PM, Deepak Das <deepak_das@mentor.com> wrote:

> generic gpio request/free should be added after gpiocip registration
> to validate mapping of gpiochip with pinctrl subsystem.
>
> gpiochip->pin_ranges list contains the information used by pinctrl
> subsystem to configure corresponding pins for gpio usage.
> This list will be empty if gpiochip fails to map with
> pinctrl subsystem for any reason.
> For Ex.:-
> generic gpio request/free should not be used if IOMUX pin controller
> device node is disabled in device tree.
>
> This commit checks above list and skips adding generic gpio request/free
> if list is found empty.
>
> Signed-off-by: Deepak Das <deepak_das@mentor.com>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>

Could you:

- Rebase on my fixes or devel branch in the GPIO tree. This doesn't
  seem to apply cleany on any of my branches, have you tested
  v4.9-rc2?

- Indicate if this is a regression that need to go into fixes/stable or
  not?

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
  2016-10-25 12:11 ` Linus Walleij
@ 2016-10-25 12:20   ` Deepak Das
  0 siblings, 0 replies; 7+ messages in thread
From: Deepak Das @ 2016-10-25 12:20 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Shawn Guo, linux-gpio, Vladimir Zapolskiy, Fabio Estevam,
	Sascha Hauer, Philipp Zabel, linux-kernel



On Tuesday 25 October 2016 05:41 PM, Linus Walleij wrote:
> On Tue, Oct 25, 2016 at 6:57 AM, Deepak Das <deepak_das@mentor.com> wrote:
> 
>> generic gpio request/free should be added after gpiocip registration
>> to validate mapping of gpiochip with pinctrl subsystem.
>>
>> gpiochip->pin_ranges list contains the information used by pinctrl
>> subsystem to configure corresponding pins for gpio usage.
>> This list will be empty if gpiochip fails to map with
>> pinctrl subsystem for any reason.
>> For Ex.:-
>> generic gpio request/free should not be used if IOMUX pin controller
>> device node is disabled in device tree.
>>
>> This commit checks above list and skips adding generic gpio request/free
>> if list is found empty.
>>
>> Signed-off-by: Deepak Das <deepak_das@mentor.com>
>> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
> 
> Third time I find this in my inbox and it still doesn't apply.
> 
> Yours,
> Linus Walleij

Hi Linus,

Sorry for the trouble. Three patches were sent by mistake. I am rebasing this patch on top of your gpio fixes branch.
This might not be required for stable branch since the original patch 
4c806c9 "gpio: mxc: add generic gpio request/free callbacks to pinctrl" was included in v4.9 so this cane be added in
v4.9 fixes.

with warm regards,
Deepak Das
> 

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

* Re: [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
  2016-10-25  4:57 ` Deepak Das
  (?)
@ 2016-10-25 12:11 ` Linus Walleij
  2016-10-25 12:20   ` Deepak Das
  -1 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2016-10-25 12:11 UTC (permalink / raw)
  To: Deepak Das
  Cc: Shawn Guo, linux-gpio, Vladimir Zapolskiy, Fabio Estevam,
	Sascha Hauer, Philipp Zabel, linux-kernel

On Tue, Oct 25, 2016 at 6:57 AM, Deepak Das <deepak_das@mentor.com> wrote:

> generic gpio request/free should be added after gpiocip registration
> to validate mapping of gpiochip with pinctrl subsystem.
>
> gpiochip->pin_ranges list contains the information used by pinctrl
> subsystem to configure corresponding pins for gpio usage.
> This list will be empty if gpiochip fails to map with
> pinctrl subsystem for any reason.
> For Ex.:-
> generic gpio request/free should not be used if IOMUX pin controller
> device node is disabled in device tree.
>
> This commit checks above list and skips adding generic gpio request/free
> if list is found empty.
>
> Signed-off-by: Deepak Das <deepak_das@mentor.com>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>

Third time I find this in my inbox and it still doesn't apply.

Yours,
Linus Walleij

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

* [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
@ 2016-10-25  4:57 ` Deepak Das
  0 siblings, 0 replies; 7+ messages in thread
From: Deepak Das @ 2016-10-25  4:57 UTC (permalink / raw)
  To: Linus Walleij, shawnguo
  Cc: linux-gpio, Vladimir_Zapolskiy, fabio.estevam, kernel, p.zabel,
	linux-kernel

generic gpio request/free should be added after gpiocip registration
to validate mapping of gpiochip with pinctrl subsystem.

gpiochip->pin_ranges list contains the information used by pinctrl
subsystem to configure corresponding pins for gpio usage.
This list will be empty if gpiochip fails to map with
pinctrl subsystem for any reason.
For Ex.:-
generic gpio request/free should not be used if IOMUX pin controller
device node is disabled in device tree.

This commit checks above list and skips adding generic gpio request/free
if list is found empty.

Signed-off-by: Deepak Das <deepak_das@mentor.com>
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
 drivers/gpio/gpio-mxc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index c1a1e00..9f79a9f 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -458,11 +458,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        if (err)
                goto out_bgio;

-       if (of_property_read_bool(np, "gpio-ranges")) {
-               port->gc.request = gpiochip_generic_request;
-               port->gc.free = gpiochip_generic_free;
-       }
-
        port->gc.to_irq = mxc_gpio_to_irq;
        port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
                                             pdev->id * 32;
@@ -471,6 +466,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        if (err)
                goto out_bgio;

+       if (!list_empty(&port->gc.pin_ranges)) {
+               port->gc.request = gpiochip_generic_request;
+               port->gc.free = gpiochip_generic_free;
+       }
+
        irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
        if (irq_base < 0) {
                err = irq_base;
-- 
1.9.1


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

* [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
@ 2016-10-25  4:57 ` Deepak Das
  0 siblings, 0 replies; 7+ messages in thread
From: Deepak Das @ 2016-10-25  4:57 UTC (permalink / raw)
  To: Linus Walleij, shawnguo
  Cc: linux-gpio, Vladimir_Zapolskiy, fabio.estevam, kernel, p.zabel,
	linux-kernel

generic gpio request/free should be added after gpiocip registration
to validate mapping of gpiochip with pinctrl subsystem.

gpiochip->pin_ranges list contains the information used by pinctrl
subsystem to configure corresponding pins for gpio usage.
This list will be empty if gpiochip fails to map with
pinctrl subsystem for any reason.
For Ex.:-
generic gpio request/free should not be used if IOMUX pin controller
device node is disabled in device tree.

This commit checks above list and skips adding generic gpio request/free
if list is found empty.

Signed-off-by: Deepak Das <deepak_das@mentor.com>
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
 drivers/gpio/gpio-mxc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index c1a1e00..9f79a9f 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -458,11 +458,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        if (err)
                goto out_bgio;

-       if (of_property_read_bool(np, "gpio-ranges")) {
-               port->gc.request = gpiochip_generic_request;
-               port->gc.free = gpiochip_generic_free;
-       }
-
        port->gc.to_irq = mxc_gpio_to_irq;
        port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
                                             pdev->id * 32;
@@ -471,6 +466,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        if (err)
                goto out_bgio;

+       if (!list_empty(&port->gc.pin_ranges)) {
+               port->gc.request = gpiochip_generic_request;
+               port->gc.free = gpiochip_generic_free;
+       }
+
        irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
        if (irq_base < 0) {
                err = irq_base;
-- 
1.9.1

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

* [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration
@ 2016-10-24 10:31 Deepak Das
  0 siblings, 0 replies; 7+ messages in thread
From: Deepak Das @ 2016-10-24 10:31 UTC (permalink / raw)
  To: Linus Walleij, shawnguo
  Cc: linux-gpio, vzapolsk, kernel, fabio.estevam, p.zabel

generic gpio request/free should be added after gpiocip registration
to validate mapping of gpiochip with pinctrl subsystem.

gpiochip->pin_ranges list contains the information used by pinctrl
subsystem to configure corresponding pins for gpio usage.
This list will be empty if gpiochip fails to map with
pinctrl subsystem for any reason.
For Ex.:-
generic gpio request/free should not be used if IOMUX pin controller
device node is disabled in device tree.

This commit checks above list and skips adding generic gpio request/free
if list is found empty.

Signed-off-by: Deepak Das <deepak_das@mentor.com>
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
  drivers/gpio/gpio-mxc.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index c1a1e00..9f79a9f 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -458,11 +458,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
         if (err)
                 goto out_bgio;

-       if (of_property_read_bool(np, "gpio-ranges")) {
-               port->gc.request = gpiochip_generic_request;
-               port->gc.free = gpiochip_generic_free;
-       }
-
         port->gc.to_irq = mxc_gpio_to_irq;
         port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
                                              pdev->id * 32;
@@ -471,6 +466,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
         if (err)
                 goto out_bgio;

+       if (!list_empty(&port->gc.pin_ranges)) {
+               port->gc.request = gpiochip_generic_request;
+               port->gc.free = gpiochip_generic_free;
+       }
+
         irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
         if (irq_base < 0) {
                 err = irq_base;
-- 
1.9.1

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

end of thread, other threads:[~2016-10-25 12:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 16:18 [PATCH] gpio: mxc: Shift generic request/free after gpiochip registration Deepak Das
2016-10-25 12:05 ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2016-10-25  4:57 Deepak Das
2016-10-25  4:57 ` Deepak Das
2016-10-25 12:11 ` Linus Walleij
2016-10-25 12:20   ` Deepak Das
2016-10-24 10:31 Deepak Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.