linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 RESEND 1/3] Input: egalax_ts: get gpio from devicetree
       [not found]   ` <20121010163036.GC19335@core.coreip.homeip.net>
@ 2012-10-11  8:55     ` Shawn Guo
  2012-10-11  9:23       ` Hui Wang
  2012-10-11 10:19       ` Russell King - ARM Linux
  0 siblings, 2 replies; 3+ messages in thread
From: Shawn Guo @ 2012-10-11  8:55 UTC (permalink / raw)
  To: linux-arm-kernel

Add LAKML ...

On Wed, Oct 10, 2012 at 09:30:36AM -0700, Dmitry Torokhov wrote:
> Hi Hui,
> 
> On Wed, Oct 10, 2012 at 05:12:01PM +0800, Hui Wang wrote:
> > The irq_to_gpio() is old, most platforms use GENERIC_GPIO framework
> > and don't support this API anymore.
> > 
> > The i.MX6q sabrelite platform equips an egalax touchscreen controller,
> > and this platform already transfered to GENERIC_GPIO framework, to
> > support this driver, we use a more generic way to get gpio.
> 
> Unfortunately this does break the driver for platforms that do still
> support irq_to_gpio and have not transitioned to device tree (yet?).
> It looks like the API suffered from premature deletion...
> 
> I really do not want to add a new platform data structure with only gpio
> in it, is there a better way to detect if irq_to_gpio() (even if only a
> stub) is available?
> 
If CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is not enabled for an architecture,
the irq_to_gpio() in include/linux/gpio.h will tell unavailability by
returning -EINVAL.  But ARM architecture still selects ARCH_HAVE_CUSTOM_GPIO_H
because there are still some platforms having mach/gpio.h.

We may also need a stub irq_to_gpio simply returning -EINVAL into
arch/arm/include/asm/gpio.h when platform does not provide irq_to_gpio,
so that driver can detect if irq_to_gpio() is available.  And that
stub can be removed later when we deselect ARCH_HAVE_CUSTOM_GPIO_H
for ARM architecture.

Shawn

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

* [PATCH v4 RESEND 1/3] Input: egalax_ts: get gpio from devicetree
  2012-10-11  8:55     ` [PATCH v4 RESEND 1/3] Input: egalax_ts: get gpio from devicetree Shawn Guo
@ 2012-10-11  9:23       ` Hui Wang
  2012-10-11 10:19       ` Russell King - ARM Linux
  1 sibling, 0 replies; 3+ messages in thread
From: Hui Wang @ 2012-10-11  9:23 UTC (permalink / raw)
  To: linux-arm-kernel

Shawn Guo wrote:
> Add LAKML ...
>
> On Wed, Oct 10, 2012 at 09:30:36AM -0700, Dmitry Torokhov wrote:
>   
>> Hi Hui,
>>
>> On Wed, Oct 10, 2012 at 05:12:01PM +0800, Hui Wang wrote:
>>     
>>> The irq_to_gpio() is old, most platforms use GENERIC_GPIO framework
>>> and don't support this API anymore.
>>>
>>> The i.MX6q sabrelite platform equips an egalax touchscreen controller,
>>> and this platform already transfered to GENERIC_GPIO framework, to
>>> support this driver, we use a more generic way to get gpio.
>>>       
>> Unfortunately this does break the driver for platforms that do still
>> support irq_to_gpio and have not transitioned to device tree (yet?).
>> It looks like the API suffered from premature deletion...
>>
>> I really do not want to add a new platform data structure with only gpio
>> in it, is there a better way to detect if irq_to_gpio() (even if only a
>> stub) is available?
>>
>>     
> If CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is not enabled for an architecture,
> the irq_to_gpio() in include/linux/gpio.h will tell unavailability by
> returning -EINVAL.  But ARM
>   
So far, the only way i can figure out is to add following in the 
arch/arm/include/asm/gpio.h

static inline int arm_irq_to_gpio(unsigned int irq)
{
return -EINVAL;
}

#ifndef irq_to_gpio
#define irq_to_gpio arm_irq_to_gpio
#endif

And remove all irq_to_gpio() function definitions in the arch/arm/, if 
mach want a specific irq_to_gpio, they can use macro to define their own.

Regards,
Hui.

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

* [PATCH v4 RESEND 1/3] Input: egalax_ts: get gpio from devicetree
  2012-10-11  8:55     ` [PATCH v4 RESEND 1/3] Input: egalax_ts: get gpio from devicetree Shawn Guo
  2012-10-11  9:23       ` Hui Wang
@ 2012-10-11 10:19       ` Russell King - ARM Linux
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-10-11 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 11, 2012 at 04:55:40PM +0800, Shawn Guo wrote:
> Add LAKML ...
> 
> On Wed, Oct 10, 2012 at 09:30:36AM -0700, Dmitry Torokhov wrote:
> > Hi Hui,
> > 
> > On Wed, Oct 10, 2012 at 05:12:01PM +0800, Hui Wang wrote:
> > > The irq_to_gpio() is old, most platforms use GENERIC_GPIO framework
> > > and don't support this API anymore.
> > > 
> > > The i.MX6q sabrelite platform equips an egalax touchscreen controller,
> > > and this platform already transfered to GENERIC_GPIO framework, to
> > > support this driver, we use a more generic way to get gpio.
> > 
> > Unfortunately this does break the driver for platforms that do still
> > support irq_to_gpio and have not transitioned to device tree (yet?).
> > It looks like the API suffered from premature deletion...
> > 
> > I really do not want to add a new platform data structure with only gpio
> > in it, is there a better way to detect if irq_to_gpio() (even if only a
> > stub) is available?
> > 
> If CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is not enabled for an architecture,
> the irq_to_gpio() in include/linux/gpio.h will tell unavailability by
> returning -EINVAL.  But ARM architecture still selects ARCH_HAVE_CUSTOM_GPIO_H
> because there are still some platforms having mach/gpio.h.
> 
> We may also need a stub irq_to_gpio simply returning -EINVAL into
> arch/arm/include/asm/gpio.h when platform does not provide irq_to_gpio,
> so that driver can detect if irq_to_gpio() is available.  And that
> stub can be removed later when we deselect ARCH_HAVE_CUSTOM_GPIO_H
> for ARM architecture.

Or fix the drivers using irq_to_gpio() not to use it.  I thought we had
resolved to do that already, with Grant's agreement that irq_to_gpio()
needed to die.

(Mainly because neither gpiolib nor the IRQ layer provides any assistance
for irq_to_gpio(), so it's not possible to make it work for all GPIOs in
the system, especially when GPIOs are allocated dynamically.)

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

end of thread, other threads:[~2012-10-11 10:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1349860323-12786-1-git-send-email-jason77.wang@gmail.com>
     [not found] ` <1349860323-12786-2-git-send-email-jason77.wang@gmail.com>
     [not found]   ` <20121010163036.GC19335@core.coreip.homeip.net>
2012-10-11  8:55     ` [PATCH v4 RESEND 1/3] Input: egalax_ts: get gpio from devicetree Shawn Guo
2012-10-11  9:23       ` Hui Wang
2012-10-11 10:19       ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).