* irq_to_gpio support
@ 2012-04-19 11:30 Richard Zhao
2012-04-19 13:33 ` Arnd Bergmann
2012-05-12 0:11 ` Grant Likely
0 siblings, 2 replies; 4+ messages in thread
From: Richard Zhao @ 2012-04-19 11:30 UTC (permalink / raw)
To: linux-arm-kernel
Hi Grant & Linus
I saw gpio lib didn't provide irq_to_gpio support. Are we dropping it?
git grep irq_to_gpio still return a lot of things.
I'm looking at drivers/input/touchscreen/egalax_ts.c driver.
It failed to compile without irq_to_gpio. It's a i2c client device and
use irq line configured as gpio to wakeup touchscreen controller.
If we don't have irq_to_gpio, I'm afraid it has to use plat data or
of property to pass gpio number.
Thanks
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* irq_to_gpio support
2012-04-19 11:30 irq_to_gpio support Richard Zhao
@ 2012-04-19 13:33 ` Arnd Bergmann
2012-04-19 14:28 ` Richard Zhao
2012-05-12 0:11 ` Grant Likely
1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2012-04-19 13:33 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 19 April 2012, Richard Zhao wrote:
> Hi Grant & Linus
>
> I saw gpio lib didn't provide irq_to_gpio support. Are we dropping it?
> git grep irq_to_gpio still return a lot of things.
There are not that many actually if you count only the users, not the
files that define them, and you ignore the files in drivers/gpio
that define their own.
drivers/ata/pata_rb532_cf.c: gpio = irq_to_gpio(irq);
drivers/input/touchscreen/eeti_ts.c: return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;
drivers/input/touchscreen/egalax_ts.c: int gpio = irq_to_gpio(client->irq);
drivers/mfd/ezx-pcap.c: } while (gpio_get_value(irq_to_gpio(pcap->spi->irq)));
drivers/pcmcia/db1xxx_ss.c: return !gpio_get_value(irq_to_gpio(sock->insert_irq));
drivers/power/tosa_battery.c: pr_info("tosa_bat_gpio irq: %d\n", gpio_get_value(irq_to_gpio(irq)));
drivers/staging/iio/accel/lis3l02dq_core.c: if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
drivers/staging/iio/accel/lis3l02dq_core.c: if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
drivers/staging/iio/accel/lis3l02dq_core.c: if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
drivers/staging/iio/accel/lis3l02dq_ring.c: if (gpio_get_value(irq_to_gpio(st->us->irq)))
The pata_rb532_cf and db1xxx_ss drivers are only used on MIPS,
most of the other ones are for arm/pxa and are currently broken.
> I'm looking at drivers/input/touchscreen/egalax_ts.c driver.
> It failed to compile without irq_to_gpio. It's a i2c client device and
> use irq line configured as gpio to wakeup touchscreen controller.
> If we don't have irq_to_gpio, I'm afraid it has to use plat data or
> of property to pass gpio number.
Yes, I think that is correct. The drivers should really have been
fixed at the time when the irq_to_gpio function was removed from
the respective platforms using those drivers, and in some cases
this has already happened.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* irq_to_gpio support
2012-04-19 13:33 ` Arnd Bergmann
@ 2012-04-19 14:28 ` Richard Zhao
0 siblings, 0 replies; 4+ messages in thread
From: Richard Zhao @ 2012-04-19 14:28 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Apr 19, 2012 at 01:33:01PM +0000, Arnd Bergmann wrote:
> On Thursday 19 April 2012, Richard Zhao wrote:
> > Hi Grant & Linus
> >
> > I saw gpio lib didn't provide irq_to_gpio support. Are we dropping it?
> > git grep irq_to_gpio still return a lot of things.
>
> There are not that many actually if you count only the users, not the
> files that define them, and you ignore the files in drivers/gpio
> that define their own.
>
> drivers/ata/pata_rb532_cf.c: gpio = irq_to_gpio(irq);
> drivers/input/touchscreen/eeti_ts.c: return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;
> drivers/input/touchscreen/egalax_ts.c: int gpio = irq_to_gpio(client->irq);
> drivers/mfd/ezx-pcap.c: } while (gpio_get_value(irq_to_gpio(pcap->spi->irq)));
> drivers/pcmcia/db1xxx_ss.c: return !gpio_get_value(irq_to_gpio(sock->insert_irq));
> drivers/power/tosa_battery.c: pr_info("tosa_bat_gpio irq: %d\n", gpio_get_value(irq_to_gpio(irq)));
> drivers/staging/iio/accel/lis3l02dq_core.c: if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
> drivers/staging/iio/accel/lis3l02dq_core.c: if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
> drivers/staging/iio/accel/lis3l02dq_core.c: if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
> drivers/staging/iio/accel/lis3l02dq_ring.c: if (gpio_get_value(irq_to_gpio(st->us->irq)))
>
> The pata_rb532_cf and db1xxx_ss drivers are only used on MIPS,
> most of the other ones are for arm/pxa and are currently broken.
>
> > I'm looking at drivers/input/touchscreen/egalax_ts.c driver.
> > It failed to compile without irq_to_gpio. It's a i2c client device and
> > use irq line configured as gpio to wakeup touchscreen controller.
> > If we don't have irq_to_gpio, I'm afraid it has to use plat data or
> > of property to pass gpio number.
>
> Yes, I think that is correct. The drivers should really have been
> fixed at the time when the irq_to_gpio function was removed from
> the respective platforms using those drivers, and in some cases
> this has already happened.
Thanks. I just found a patch to add egalax DT support. I'll evaluate it
and send it out.
Thanks
Richard
>
> Arnd
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* irq_to_gpio support
2012-04-19 11:30 irq_to_gpio support Richard Zhao
2012-04-19 13:33 ` Arnd Bergmann
@ 2012-05-12 0:11 ` Grant Likely
1 sibling, 0 replies; 4+ messages in thread
From: Grant Likely @ 2012-05-12 0:11 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 19 Apr 2012 19:30:20 +0800, Richard Zhao <richard.zhao@freescale.com> wrote:
> Hi Grant & Linus
>
> I saw gpio lib didn't provide irq_to_gpio support. Are we dropping it?
> git grep irq_to_gpio still return a lot of things.
>
> I'm looking at drivers/input/touchscreen/egalax_ts.c driver.
> It failed to compile without irq_to_gpio. It's a i2c client device and
> use irq line configured as gpio to wakeup touchscreen controller.
> If we don't have irq_to_gpio, I'm afraid it has to use plat data or
> of property to pass gpio number.
Yeah, since there can be an 1:n relationship between irqs and gpios I
can't see that api ever being implemented correctly.
g.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-12 0:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 11:30 irq_to_gpio support Richard Zhao
2012-04-19 13:33 ` Arnd Bergmann
2012-04-19 14:28 ` Richard Zhao
2012-05-12 0:11 ` Grant Likely
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).