All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Javier Martinez Canillas <martinez.javier@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"Shilimkar, Santosh" <santosh.shilimkar@ti.com>,
	ext Tony Lindgren <tony@atomide.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Kevin Hilman <khilman@linaro.org>,
	Jon Hunter <jgchunter@gmail.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Enric Balletbo Serra <eballetbo@gmail.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	Florian Vaussard <florian.vaussard@epfl.ch>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	"Krishnamoorthy, Balaji T" <balajitk@ti.com>
Subject: Re: [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT
Date: Mon, 29 Jul 2013 13:30:08 +0200	[thread overview]
Message-ID: <51F65240.4010308@ahsoftware.de> (raw)
In-Reply-To: <2AF86F5A-DEF4-47BD-A08D-7292753A51EC@collabora.co.uk>

Am 29.07.2013 13:11, schrieb Javier Martinez Canillas:
> On 29/07/2013, at 12:27, Alexander Holler <holler@ahsoftware.de> wrote:
>
>> Am 29.07.2013 10:17, schrieb Javier Martinez Canillas:
>>> Hi Alexander,
>>>
>>> On Mon, Jul 29, 2013 at 8:41 AM, Alexander Holler <holler@ahsoftware.de> wrote:
>>>> Am 28.07.2013 21:06, schrieb Javier Martinez Canillas:
>>>>
>>>>> On Sun, Jul 28, 2013 at 8:22 PM, Linus Walleij <linus.walleij@linaro.org>
>>>>> wrote:
>>>>>>
>>>>>> On Sun, Jul 28, 2013 at 7:33 PM, Javier Martinez Canillas
>>>>>> <martinez.javier@gmail.com> wrote:
>>>>>>
>>>>>>> According to Documentation/devicetree/bindings/mmc/mmc.txt:
>>>>>>>
>>>>>>> cd-gpios: Specify GPIOs for card detection, see gpio binding
>>>>>>>
>>>>>>> So it just says that it is a GPIO for card detection and not an IRQ so
>>>>>>> this assumption comes from either the omap_hsmmc driver or Alexander'
>>>>>>> DTS is missing something like:
>>>>>>>
>>>>>>>                  interrupt-parent = <&gpio6>;
>>>>>>>                  interrupts = <16 8>;
>>>>
>>>>
>>>> What do the values 16 and 8 mean here? GPIO numbers?
>>>> And where do I have to place that?
>>>
>>> If you look at Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
>>> for the two cells interrupt controllers definition:
>>>
>>>   b) two cells
>>>   ------------
>>>   The #interrupt-cells property is set to 2 and the first cell defines the
>>>   index of the interrupt within the controller, while the second cell is used
>>
>> I had read that. And there is written, "index of the interrupt". So may
>> I ask the question how you think people are translating GPIO number to
>> interrupt index?. And if it's the same, will GPIO0_0 map to IRQ 0 or how
>> is the magic formular people are supposed to use?
>>
>
> Yes, the GPIO-IRQ is a especial case since the chip is both a GPIO and a IRQ controller. In this context the "index of the interrupt" is the physical index of the GPIO line within that GPIO bank. Since each OMAP GPIO bank has 32 GPIO lines, in this example, gpio6 + 16 = GPIO 176.
>
> You define the hardware interrupt (GPIO line in this case) but that is not what drivers see, they see the virtual IRQ number mapped to the hardware IRQ which is just a cookie and the actual number depends on what GPIO to IRQ domain mapping is being used.
>
>> Besides that, the existing standard DTS I've modified into my
>> "non-standard" dts is arch/arm/boot/dts/am335x-bone.dts.
>>
>> if you look at the definition of the GPIO bank 0 in
>> arch/arm/boot/dts/am33xx.dtsi, you see
>>
>> #interrupt-cells = <1>;
>>
>
> Yes, that's probably because no one is using the edge/level flags on am33xx but that is a bug and has to be changed to #interrupt-cells = <2>
>
> This has been fixed recently for omap3.dtsi recently too.
>
>> Anyway, thanks for your time, but I don't want to spend more time on
>> that topic.
>>
>
> Thanks a lot for your time and sorry for the inconvenience. It seems these patches are going to be reverted anyways since it causes another regression on older OMAP1 platforms so you probably can forget about this issue.

Hopefully I'm not the reason for the revert. I don't want to block new 
approaches and it seems to make sense to not map an irq for every 
possible gpio. I've just tried to dig out how one is supposed to use the 
new feature with existing drivers which do use gpio_to_irq().

>
> A different "GPIO hogs" approach will be used to pre-define which GPIO are going to be used as IRQ so the core can request them and setup as input.
>
> I expect you will have the same issue with this new approach though since the omap hsmmc driver will try to call gpio_request() on a previously requested GPIO.
>
> So I think the driver has to be changed independently of the approach for auto request GPIO used.

Maybe, but that isn't much effort. I had done that in 3 minutes (ok, 
without the would be necessary #ifdef CONFIG_OF_GPIO). But you have a 
chicken and egg situation here, because you can't change drivers without 
the new patch and you can't introduce the new patch without changes to 
drivers.

As I had mentioned before, another approach could be to map the irq when 
gpio_to_irq() is called. I think that would be downward compatible 
without the need for some changes in a dts.

Regards,

Alexander Holler

  reply	other threads:[~2013-07-29 11:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 15:27 [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT Javier Martinez Canillas
2013-06-28 15:27 ` [PATCH v4 2/2] gpio/omap: auto request GPIO as input if used as IRQ via DT Javier Martinez Canillas
2013-06-28 15:32   ` Santosh Shilimkar
2013-06-28 15:28 ` [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT Santosh Shilimkar
2013-06-29 23:44 ` Linus Walleij
2013-06-30  0:25   ` Javier Martinez Canillas
2013-07-01  8:04     ` Linus Walleij
2013-07-01 11:01       ` Javier Martinez Canillas
2013-07-01 12:35         ` Linus Walleij
2013-07-01 12:49       ` Grant Likely
2013-07-01 13:23         ` Linus Walleij
2013-07-28 10:58 ` Alexander Holler
2013-07-28 11:14   ` Linus Walleij
2013-07-28 12:59     ` Alexander Holler
2013-07-28 14:11       ` Linus Walleij
2013-07-28 14:37         ` Shilimkar, Santosh
2013-07-28 16:29           ` Linus Walleij
2013-07-28 17:13             ` Alexander Holler
2013-07-28 18:10               ` Linus Walleij
2013-07-28 17:33             ` Javier Martinez Canillas
2013-07-28 17:36               ` Javier Martinez Canillas
2013-07-28 18:22               ` Linus Walleij
2013-07-28 19:06                 ` Javier Martinez Canillas
2013-07-29  6:41                   ` Alexander Holler
2013-07-29  8:17                     ` Javier Martinez Canillas
2013-07-29  9:13                       ` Linus Walleij
2013-07-29 10:27                       ` Alexander Holler
2013-07-29 11:11                         ` Javier Martinez Canillas
2013-07-29 11:30                           ` Alexander Holler [this message]
2013-07-29 11:33                             ` Alexander Holler
2013-07-29 11:48                           ` Linus Walleij
2013-07-29 11:53                       ` Balaji T K
2013-07-28 19:30                 ` Javier Martinez Canillas
2013-07-29  6:54                   ` Alexander Holler
2013-07-28 14:25   ` Alexander Holler
2013-07-28 16:25     ` Linus Walleij
2013-07-28 16:45       ` Alexander Holler
2013-07-28 17:47         ` Javier Martinez Canillas
2013-07-28 18:06         ` Linus Walleij
2013-07-28 18:50           ` Javier Martinez Canillas
2013-07-29  5:24             ` Alexander Holler
2013-07-29  9:05               ` Linus Walleij
2013-07-29 10:48                 ` Alexander Holler

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=51F65240.4010308@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=aaro.koskinen@iki.fi \
    --cc=balajitk@ti.com \
    --cc=eballetbo@gmail.com \
    --cc=florian.vaussard@epfl.ch \
    --cc=grant.likely@secretlab.ca \
    --cc=javier.martinez@collabora.co.uk \
    --cc=jgchunter@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=martinez.javier@gmail.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tony@atomide.com \
    /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.