public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: arnd@arndb•de (Arnd Bergmann)
To: linux-arm-kernel@lists•infradead.org
Subject: irq_to_gpio support
Date: Thu, 19 Apr 2012 13:33:01 +0000	[thread overview]
Message-ID: <201204191333.01914.arnd@arndb.de> (raw)
In-Reply-To: <20120419113019.GB26682@b20223-02.ap.freescale.net>

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

  reply	other threads:[~2012-04-19 13:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 11:30 irq_to_gpio support Richard Zhao
2012-04-19 13:33 ` Arnd Bergmann [this message]
2012-04-19 14:28   ` Richard Zhao
2012-05-12  0:11 ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201204191333.01914.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox