Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-09-03 Thread Linus Walleij
On Fri, Aug 30, 2013 at 10:08 PM, Stephen Warren wrote: > On 08/29/2013 01:00 PM, Linus Walleij wrote: >> No but I think there should be one ... maybe I'm an oddball >> but it seems natural to request a GPIO before tying >> IRQs to fire off it. > > What if there is no GPIO? > > There are plenty

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-09-03 Thread Linus Walleij
On Fri, Aug 30, 2013 at 10:08 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/29/2013 01:00 PM, Linus Walleij wrote: No but I think there should be one ... maybe I'm an oddball but it seems natural to request a GPIO before tying IRQs to fire off it. What if there is no GPIO? There

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-09-02 Thread Lars Poeschel
Am Freitag, 30. August 2013, 14:08:41 schrieb Stephen Warren: > On 08/29/2013 01:00 PM, Linus Walleij wrote: > > On Fri, Aug 23, 2013 at 9:52 PM, Stephen Warren wrote: > >> On 08/23/2013 12:45 PM, Linus Walleij wrote: > >>> This is a perfectly OK thing to do as long as it is done like > >>>

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-09-02 Thread Lars Poeschel
Am Freitag, 30. August 2013, 14:08:41 schrieb Stephen Warren: On 08/29/2013 01:00 PM, Linus Walleij wrote: On Fri, Aug 23, 2013 at 9:52 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: This is a perfectly OK thing to do as long as it is done like

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-30 Thread Stephen Warren
On 08/29/2013 01:00 PM, Linus Walleij wrote: > On Fri, Aug 23, 2013 at 9:52 PM, Stephen Warren wrote: >> On 08/23/2013 12:45 PM, Linus Walleij wrote: > >>> This is a perfectly OK thing to do as long as it is done like >>> this: >>> >>> request_gpio(gpio); >>> gpio_direction_input(gpio); >>>

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-30 Thread Stephen Warren
On 08/29/2013 01:00 PM, Linus Walleij wrote: On Fri, Aug 23, 2013 at 9:52 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: This is a perfectly OK thing to do as long as it is done like this: request_gpio(gpio); gpio_direction_input(gpio);

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-29 Thread Linus Walleij
On Fri, Aug 23, 2013 at 9:52 PM, Stephen Warren wrote: > On 08/23/2013 12:45 PM, Linus Walleij wrote: >> This is a perfectly OK thing to do as long as it is done like >> this: >> >> request_gpio(gpio); >> gpio_direction_input(gpio); >> request_irq(gpio_to_irq(gpio)); > > But I'm not aware that

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-29 Thread Linus Walleij
On Fri, Aug 23, 2013 at 9:49 PM, Stephen Warren wrote: > On 08/23/2013 12:38 PM, Linus Walleij wrote: >> It can't be stopped but I consider it a bug if they do, as the proper >> way to handle such GPIO lines is the sequence: >> >> request_gpio(gpio); >> request_irq(gpio_to_irq(gpio)); > > Back

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-29 Thread Linus Walleij
On Fri, Aug 23, 2013 at 9:49 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/23/2013 12:38 PM, Linus Walleij wrote: It can't be stopped but I consider it a bug if they do, as the proper way to handle such GPIO lines is the sequence: request_gpio(gpio); request_irq(gpio_to_irq(gpio));

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-29 Thread Linus Walleij
On Fri, Aug 23, 2013 at 9:52 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: This is a perfectly OK thing to do as long as it is done like this: request_gpio(gpio); gpio_direction_input(gpio); request_irq(gpio_to_irq(gpio)); But I'm not aware

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-27 Thread Stephen Warren
On 08/26/2013 04:45 AM, Lars Poeschel wrote: > On Friday 23 August 2013 at 21:52:20, Stephen Warren wrote: >> On 08/23/2013 12:45 PM, Linus Walleij wrote: >>> On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren > wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: > On Thu, Aug 22, 2013 at

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-27 Thread Andreas Larsson
On 2013-08-26 16:04, Lars Poeschel wrote: On Monday 26 August 2013 at 13:29:07, Andreas Larsson wrote: On 2013-08-26 12:56, Lars Poeschel wrote: This call to of_irq_find_parent breaks gpiolib-of for SPARC due to the fact that the function is undefined when !defined(CONFIG_OF_IRQ) &&

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-27 Thread Andreas Larsson
On 2013-08-26 16:04, Lars Poeschel wrote: On Monday 26 August 2013 at 13:29:07, Andreas Larsson wrote: On 2013-08-26 12:56, Lars Poeschel wrote: This call to of_irq_find_parent breaks gpiolib-of for SPARC due to the fact that the function is undefined when !defined(CONFIG_OF_IRQ)

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-27 Thread Stephen Warren
On 08/26/2013 04:45 AM, Lars Poeschel wrote: On Friday 23 August 2013 at 21:52:20, Stephen Warren wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22,

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
On Monday 26 August 2013 at 13:29:07, Andreas Larsson wrote: > On 2013-08-26 12:56, Lars Poeschel wrote: > > Hi Andreas! > > > > On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: > >> On 2013-08-21 15:38, Lars Poeschel wrote: > >>> +static void of_gpio_scan_irq_lines(const struct

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Andreas Larsson
On 2013-08-26 12:56, Lars Poeschel wrote: Hi Andreas! On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node *const node, +struct device_node *const gcn,

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
Hi Andreas! On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: > On 2013-08-21 15:38, Lars Poeschel wrote: > > +static void of_gpio_scan_irq_lines(const struct device_node *const > > node, +struct device_node *const gcn, > > +

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
On Friday 23 August 2013 at 21:52:20, Stephen Warren wrote: > On 08/23/2013 12:45 PM, Linus Walleij wrote: > > On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren wrote: > >> On 08/21/2013 05:36 PM, Linus Walleij wrote: > >>> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren > >>> wrote: [Me] > >>>

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
On Friday 23 August 2013 at 21:48:43, Stephen Warren wrote: > On 08/23/2013 03:40 AM, Lars Poeschel wrote: > > On Thursday 22 August 2013 at 23:10:53, Stephen Warren wrote: > >> On 08/21/2013 05:36 PM, Linus Walleij wrote: > >>> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren > >>> wrote: [Me] >

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
On Friday 23 August 2013 at 21:48:43, Stephen Warren wrote: On 08/23/2013 03:40 AM, Lars Poeschel wrote: On Thursday 22 August 2013 at 23:10:53, Stephen Warren wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote:

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
On Friday 23 August 2013 at 21:52:20, Stephen Warren wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
Hi Andreas! On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node *const node, +struct device_node *const gcn, +

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Andreas Larsson
On 2013-08-26 12:56, Lars Poeschel wrote: Hi Andreas! On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node *const node, +struct device_node *const gcn,

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-26 Thread Lars Poeschel
On Monday 26 August 2013 at 13:29:07, Andreas Larsson wrote: On 2013-08-26 12:56, Lars Poeschel wrote: Hi Andreas! On Thursday 22 August 2013 at 15:16:18, Andreas Larsson wrote: On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 01:55 PM, Tomasz Figa wrote: > On Friday 23 of August 2013 13:52:20 Stephen Warren wrote: >> On 08/23/2013 12:45 PM, Linus Walleij wrote: >>> On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren > wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: > On Thu, Aug 22, 2013 at

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Tomasz Figa
On Friday 23 of August 2013 13:52:20 Stephen Warren wrote: > On 08/23/2013 12:45 PM, Linus Walleij wrote: > > On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren wrote: > >> On 08/21/2013 05:36 PM, Linus Walleij wrote: > >>> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren > >>> wrote: [Me] > >>>

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 12:45 PM, Linus Walleij wrote: > On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren > wrote: >> On 08/21/2013 05:36 PM, Linus Walleij wrote: >>> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren >>> wrote: >>> [Me] >> check if these in turn reference the interrupt-controller, and

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 12:38 PM, Linus Walleij wrote: > On Thu, Aug 22, 2013 at 10:53 PM, Stephen Warren > wrote: >> On 08/21/2013 05:27 PM, Linus Walleij wrote: >>> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren >>> wrote: > On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: >>> >>

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 03:40 AM, Lars Poeschel wrote: > On Thursday 22 August 2013 at 23:10:53, Stephen Warren wrote: >> On 08/21/2013 05:36 PM, Linus Walleij wrote: >>> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren >>> wrote: [Me] >>> >> check if these in turn reference the interrupt-controller,

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Linus Walleij
On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren wrote: > On 08/21/2013 05:36 PM, Linus Walleij wrote: >> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren >> wrote: >> [Me] > check if these in turn reference the interrupt-controller, and > if they do, loop over the interrupts used by

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Linus Walleij
On Thu, Aug 22, 2013 at 10:53 PM, Stephen Warren wrote: > On 08/21/2013 05:27 PM, Linus Walleij wrote: >> On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren >> wrote: On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: >> > To solve this dilemma, perform an interrupt consistency

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Lars Poeschel
On Thursday 22 August 2013 at 22:53:09, Stephen Warren wrote: > On 08/21/2013 05:27 PM, Linus Walleij wrote: > > On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren wrote: > >>> On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: > To solve this dilemma, perform an interrupt

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Lars Poeschel
On Thursday 22 August 2013 at 23:10:53, Stephen Warren wrote: > On 08/21/2013 05:36 PM, Linus Walleij wrote: > > On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren > > wrote: [Me] > > > check if these in turn reference the interrupt-controller, and > if they do, loop over the interrupts

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Lars Poeschel
On Thursday 22 August 2013 at 23:10:53, Stephen Warren wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: [Me] check if these in turn reference the interrupt-controller, and if they do, loop over the

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Lars Poeschel
On Thursday 22 August 2013 at 22:53:09, Stephen Warren wrote: On 08/21/2013 05:27 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: To solve this dilemma, perform an interrupt

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Linus Walleij
On Thu, Aug 22, 2013 at 10:53 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:27 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: To solve this dilemma, perform

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Linus Walleij
On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: [Me] check if these in turn reference the interrupt-controller, and if they do, loop over

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 03:40 AM, Lars Poeschel wrote: On Thursday 22 August 2013 at 23:10:53, Stephen Warren wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: [Me] check if these in turn reference the interrupt-controller,

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 12:38 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 10:53 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:27 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: On Wednesday 21 of August 2013 15:38:54 Lars

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 12:45 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: [Me] check if these in turn reference the

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Tomasz Figa
On Friday 23 of August 2013 13:52:20 Stephen Warren wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-23 Thread Stephen Warren
On 08/23/2013 01:55 PM, Tomasz Figa wrote: On Friday 23 of August 2013 13:52:20 Stephen Warren wrote: On 08/23/2013 12:45 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 11:10 PM, Stephen Warren swar...@wwwdotorg.org wrote: On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Tomasz Figa
On Thursday 22 of August 2013 15:08:12 Stephen Warren wrote: > On 08/22/2013 03:01 AM, Lars Poeschel wrote: > > On Thursday 22 August 2013 at 01:10:27, Stephen Warren wrote: > >> On 08/21/2013 03:49 PM, Tomasz Figa wrote: > diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c >

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Stephen Warren
On 08/21/2013 05:36 PM, Linus Walleij wrote: > On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren wrote: > [Me] check if these in turn reference the interrupt-controller, and if they do, loop over the interrupts used by that child and perform gpio_request() and gpio_direction_input()

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Stephen Warren
On 08/22/2013 03:01 AM, Lars Poeschel wrote: > On Thursday 22 August 2013 at 01:10:27, Stephen Warren wrote: >> On 08/21/2013 03:49 PM, Tomasz Figa wrote: diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c + */ + if (irq_domain &&

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Stephen Warren
On 08/21/2013 05:27 PM, Linus Walleij wrote: > On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren wrote: >>> On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: > To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if the chip is both

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Andreas Larsson
On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node *const node, + struct device_node *const gcn, + struct irq_domain *const irq_domain, + const

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Lars Poeschel
On Thursday 22 August 2013 at 01:10:27, Stephen Warren wrote: > On 08/21/2013 03:49 PM, Tomasz Figa wrote: > >> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c > >> > >> +static void of_gpio_scan_irq_lines(const struct device_node *const > >> > >> + for (i = 0; i <

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Lars Poeschel
On Thursday 22 August 2013 at 01:10:27, Stephen Warren wrote: On 08/21/2013 03:49 PM, Tomasz Figa wrote: diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c +static void of_gpio_scan_irq_lines(const struct device_node *const + for (i = 0; i intlen; i +=

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Andreas Larsson
On 2013-08-21 15:38, Lars Poeschel wrote: +static void of_gpio_scan_irq_lines(const struct device_node *const node, + struct device_node *const gcn, + struct irq_domain *const irq_domain, + const

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Stephen Warren
On 08/21/2013 05:27 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if the chip is both

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Stephen Warren
On 08/22/2013 03:01 AM, Lars Poeschel wrote: On Thursday 22 August 2013 at 01:10:27, Stephen Warren wrote: On 08/21/2013 03:49 PM, Tomasz Figa wrote: diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c + */ + if (irq_domain

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Stephen Warren
On 08/21/2013 05:36 PM, Linus Walleij wrote: On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: [Me] check if these in turn reference the interrupt-controller, and if they do, loop over the interrupts used by that child and perform gpio_request() and

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-22 Thread Tomasz Figa
On Thursday 22 of August 2013 15:08:12 Stephen Warren wrote: On 08/22/2013 03:01 AM, Lars Poeschel wrote: On Thursday 22 August 2013 at 01:10:27, Stephen Warren wrote: On 08/21/2013 03:49 PM, Tomasz Figa wrote: diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c +

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Linus Walleij
On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren wrote: [Me] >>> check if these in turn reference the interrupt-controller, and >>> if they do, loop over the interrupts used by that child and >>> perform gpio_request() and gpio_direction_input() on these, >>> making them unreachable from the GPIO

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Linus Walleij
On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren wrote: >> On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: >>> To solve this dilemma, perform an interrupt consistency check >>> when adding a GPIO chip: if the chip is both gpio-controller and >>> interrupt-controller, walk all

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Stephen Warren
On 08/21/2013 03:49 PM, Tomasz Figa wrote: > Hi Lars, Linus, > > On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: >> From: Linus Walleij >> >> Currently the kernel is ambigously treating GPIOs and interrupts >> from a GPIO controller: GPIOs and interrupts are treated as >>

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Tomasz Figa
Hi Lars, Linus, On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: > From: Linus Walleij > > Currently the kernel is ambigously treating GPIOs and interrupts > from a GPIO controller: GPIOs and interrupts are treated as > orthogonal. This unfortunately makes it unclear how to actually

[PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Lars Poeschel
From: Linus Walleij Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated as orthogonal. This unfortunately makes it unclear how to actually retrieve and request a GPIO line or interrupt from a GPIO controller in the device tree

[PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Lars Poeschel
From: Linus Walleij linus.wall...@linaro.org Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated as orthogonal. This unfortunately makes it unclear how to actually retrieve and request a GPIO line or interrupt from a GPIO

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Tomasz Figa
Hi Lars, Linus, On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: From: Linus Walleij linus.wall...@linaro.org Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated as orthogonal. This unfortunately makes it

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Stephen Warren
On 08/21/2013 03:49 PM, Tomasz Figa wrote: Hi Lars, Linus, On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: From: Linus Walleij linus.wall...@linaro.org Currently the kernel is ambigously treating GPIOs and interrupts from a GPIO controller: GPIOs and interrupts are treated as

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Linus Walleij
On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: On Wednesday 21 of August 2013 15:38:54 Lars Poeschel wrote: To solve this dilemma, perform an interrupt consistency check when adding a GPIO chip: if the chip is both gpio-controller and interrupt-controller, walk

Re: [PATCH v2] gpio: interrupt consistency check for OF GPIO IRQs

2013-08-21 Thread Linus Walleij
On Thu, Aug 22, 2013 at 1:10 AM, Stephen Warren swar...@wwwdotorg.org wrote: [Me] check if these in turn reference the interrupt-controller, and if they do, loop over the interrupts used by that child and perform gpio_request() and gpio_direction_input() on these, making them unreachable from