From: stigge@antcom.de (Roland Stigge)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/6 v8] gpio: Add block GPIO
Date: Wed, 05 Dec 2012 23:10:44 +0100 [thread overview]
Message-ID: <50BFC664.8080708@antcom.de> (raw)
In-Reply-To: <50BF9627.4050102@grandegger.com>
Hi Wolfgang,
On 05/12/12 19:44, Wolfgang Grandegger wrote:
>> * There is probably an explicit interrupt configuration necessary (via
>> struct gpio_block, and devicetree, respectively) since there are
>> constellations where gpio_to_irq() isn't working. E.g., in contrast to
>> controllers which are aware of their IRQs and providing to_irq(), there
>> is typically independent wiring from GPIO expander chips' interrupt line
>> to individual IRQ inputs on SoCs/CPUs. Or should all this be solved via
>> devicetree and drivers (which should support IRQ config where possible)?
>
> Yes, I think it's up to the device tree or platform code to properly setup
> the interrupt... like for defining the GPIO block.
OK, sounds reasonable. Luckily, in reality it already works fine in this
regard with many current drivers.
>> * For the same reason, the IRQ flags are currently IRQF_TRIGGER_FALLING,
>> which isn't flexible. Instead, either preset by board setup/firmware, or
>> via interrupts config in devicetree (optional property of a GPIO block?)
>
> Yes, and it did fail on my setup.
OK, will replace the flags with 0 (and need to fix my own board setup ;-) ).
>> * Some GPIOs' IRQs are not suitable for GPI input change detection. E.g.
>> on LPC32xx, I can configure the IRQ which is controlled directly by the
>> GPI's values as FALLING, RISING, HIGH /exclusive/ or LOW. I.e., this way
>> it's not possible to detect both 0->1 and 1->0 changes without
>> reconfiguring the GPIO controller inbetween. Other controllers provide a
>> dedicated interrupt on all values changes.
>
> Hm.
For now, we are expecting IRQs to fire on "changes". Otherwise, the user
needs to handle the issue manually, using busy polling, manual
reconfiguration of the GPIO controller etc.
>> * Would IRQF_SHARED be appropriate to enable opening IRQ enabled GPIO
>> blocks multiple times?
>
> Sounds reasonable for me. Some more comments in the patch mails...
OK, will do in the next update.
Thanks for your feedback,
Roland
WARNING: multiple messages have this Message-ID (diff)
From: Roland Stigge <stigge@antcom.de>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: gregkh@linuxfoundation.org, grant.likely@secretlab.ca,
linus.walleij@linaro.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, w.sang@pengutronix.de,
jbe@pengutronix.de, plagnioj@jcrosoft.com, highguy@gmail.com,
broonie@opensource.wolfsonmicro.com, daniel-gl@gmx.net,
rmallon@gmail.com, tru@work-microwave.de, sr@denx.de
Subject: Re: [PATCH 0/6 v8] gpio: Add block GPIO
Date: Wed, 05 Dec 2012 23:10:44 +0100 [thread overview]
Message-ID: <50BFC664.8080708@antcom.de> (raw)
In-Reply-To: <50BF9627.4050102@grandegger.com>
Hi Wolfgang,
On 05/12/12 19:44, Wolfgang Grandegger wrote:
>> * There is probably an explicit interrupt configuration necessary (via
>> struct gpio_block, and devicetree, respectively) since there are
>> constellations where gpio_to_irq() isn't working. E.g., in contrast to
>> controllers which are aware of their IRQs and providing to_irq(), there
>> is typically independent wiring from GPIO expander chips' interrupt line
>> to individual IRQ inputs on SoCs/CPUs. Or should all this be solved via
>> devicetree and drivers (which should support IRQ config where possible)?
>
> Yes, I think it's up to the device tree or platform code to properly setup
> the interrupt... like for defining the GPIO block.
OK, sounds reasonable. Luckily, in reality it already works fine in this
regard with many current drivers.
>> * For the same reason, the IRQ flags are currently IRQF_TRIGGER_FALLING,
>> which isn't flexible. Instead, either preset by board setup/firmware, or
>> via interrupts config in devicetree (optional property of a GPIO block?)
>
> Yes, and it did fail on my setup.
OK, will replace the flags with 0 (and need to fix my own board setup ;-) ).
>> * Some GPIOs' IRQs are not suitable for GPI input change detection. E.g.
>> on LPC32xx, I can configure the IRQ which is controlled directly by the
>> GPI's values as FALLING, RISING, HIGH /exclusive/ or LOW. I.e., this way
>> it's not possible to detect both 0->1 and 1->0 changes without
>> reconfiguring the GPIO controller inbetween. Other controllers provide a
>> dedicated interrupt on all values changes.
>
> Hm.
For now, we are expecting IRQs to fire on "changes". Otherwise, the user
needs to handle the issue manually, using busy polling, manual
reconfiguration of the GPIO controller etc.
>> * Would IRQF_SHARED be appropriate to enable opening IRQ enabled GPIO
>> blocks multiple times?
>
> Sounds reasonable for me. Some more comments in the patch mails...
OK, will do in the next update.
Thanks for your feedback,
Roland
next prev parent reply other threads:[~2012-12-05 22:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 18:03 [PATCH 0/6 v8] gpio: Add block GPIO Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-11-30 18:03 ` [PATCH 1/6 v8] gpio: Add a block GPIO API to gpiolib Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-11-30 18:03 ` [PATCH 2/6 v8] gpio: Add sysfs support to block GPIO API Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-11-30 18:03 ` [PATCH 3/6 v8] gpio: Add userland device interface to block GPIO Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-11-30 18:03 ` [PATCH 4/6 v8] gpiolib: Fix default attributes for class Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-11-30 18:03 ` [PATCH 5/6 v8] gpio: Add device tree support to block GPIO API Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-11-30 18:03 ` [PATCH 6/6 v8] gpio: Add block gpio to several gpio drivers Roland Stigge
2012-11-30 18:03 ` Roland Stigge
2012-12-03 9:17 ` [PATCH 0/6 v8] gpio: Add block GPIO Wolfgang Grandegger
2012-12-03 9:17 ` Wolfgang Grandegger
2012-12-04 20:39 ` Roland Stigge
2012-12-04 20:39 ` Roland Stigge
2012-12-05 18:44 ` Wolfgang Grandegger
2012-12-05 18:44 ` Wolfgang Grandegger
2012-12-05 22:10 ` Roland Stigge [this message]
2012-12-05 22:10 ` Roland Stigge
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=50BFC664.8080708@antcom.de \
--to=stigge@antcom.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.