RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-09-02 Thread Thomas Gleixner
On Fri, 2 Sep 2011, Stephen Warren wrote: > Thomas Gleixner wrote at Friday, September 02, 2011 2:37 AM: > > On Thu, 4 Aug 2011, Stephen Warren wrote: > > > > > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > > > it can't be used as anything else; it should be requested

RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-09-02 Thread Stephen Warren
Stephen Warren wrote at Friday, September 02, 2011 9:25 AM: > Thomas Gleixner wrote at Friday, September 02, 2011 2:37 AM: > > On Thu, 4 Aug 2011, Stephen Warren wrote: > > > > > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > > > it can't be used as anything else; it sho

RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-09-02 Thread Stephen Warren
Thomas Gleixner wrote at Friday, September 02, 2011 2:37 AM: > On Thu, 4 Aug 2011, Stephen Warren wrote: > > > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > > it can't be used as anything else; it should be requested. Enhance the > > core interrupt code to call gpio_re

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-09-02 Thread Thomas Gleixner
On Thu, 4 Aug 2011, Stephen Warren wrote: > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > it can't be used as anything else; it should be requested. Enhance the > core interrupt code to call gpio_request() and gpio_direction_input() for > any IRQ that is also a GPIO. T

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-05 Thread Mark Brown
On Fri, Aug 05, 2011 at 08:29:38AM -0700, Stephen Warren wrote: > Mark Brown wrote at Thursday, August 04, 2011 11:35 PM: > > But it's not a bug to use a GPIO as an IRQ source, otherwise we wouldn't > > have gpio_to_irq() in the first place. > 2) Two pieces of unrelated code somehow accidentally

RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-05 Thread Stephen Warren
Mark Brown wrote at Thursday, August 04, 2011 11:35 PM: > On Thu, Aug 04, 2011 at 08:53:34PM -0700, Stephen Warren wrote: > > > Well, things break. This is essentially the problem I was describing in > > the PATCH 0 email, just with a slightly different motivation. > > There's a bunch of existing

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-05 Thread Mark Brown
On Fri, Aug 05, 2011 at 09:06:20AM +0100, Ben Dooks wrote: > I would say that setting the interrupt should deal with all the necessary > configuration to get that interrupt working. In the case of pretty much all > of the SoCs I have been involved with have always set the GPIO's function > to allo

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-05 Thread Ben Dooks
On Fri, Aug 05, 2011 at 06:35:11AM +0100, Mark Brown wrote: > On Thu, Aug 04, 2011 at 08:53:34PM -0700, Stephen Warren wrote: > > > Well, things break. This is essentially the problem I was describing in > > the PATCH 0 email, just with a slightly different motivation. > > There's a bunch of exi

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-05 Thread Ben Dooks
On Thu, Aug 04, 2011 at 05:00:18PM -0600, Stephen Warren wrote: > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > it can't be used as anything else; it should be requested. Enhance the > core interrupt code to call gpio_request() and gpio_direction_input() for > any IRQ t

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-04 Thread Mark Brown
On Thu, Aug 04, 2011 at 08:53:34PM -0700, Stephen Warren wrote: > Well, things break. This is essentially the problem I was describing in > the PATCH 0 email, just with a slightly different motivation. There's a bunch of existing code using that idiom. > I suppose that an alternative here would

RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-04 Thread Stephen Warren
Rob Herring wrote at Thursday, August 04, 2011 7:55 PM: > On 08/04/2011 06:00 PM, Stephen Warren wrote: > > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > > it can't be used as anything else; it should be requested. Enhance the > > core interrupt code to call gpio_reques

RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-04 Thread Stephen Warren
Mark Brown wrote at Thursday, August 04, 2011 6:02 PM: > On Thu, Aug 04, 2011 at 05:00:18PM -0600, Stephen Warren wrote: > > > + } else { > > + gpio = irq_to_gpio(irq); > > + if (gpio_is_valid(gpio)) { > > + ret = gpio_request(gpio, new->name); > > +

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-04 Thread Rob Herring
On 08/04/2011 06:00 PM, Stephen Warren wrote: > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ, > it can't be used as anything else; it should be requested. Enhance the > core interrupt code to call gpio_request() and gpio_direction_input() for > any IRQ that is also a GPIO

Re: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

2011-08-04 Thread Mark Brown
On Thu, Aug 04, 2011 at 05:00:18PM -0600, Stephen Warren wrote: > + } else { > + gpio = irq_to_gpio(irq); > + if (gpio_is_valid(gpio)) { > + ret = gpio_request(gpio, new->name); > + if (ret < 0) > + got