Re: [PATCH v4 1/2] gpio/omap: don't create an IRQ mapping for every GPIO on DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 28, 2013 at 6:45 PM, Alexander Holler <holler@xxxxxxxxxxxxx> wrote:
> Am 28.07.2013 18:25, schrieb Linus Walleij:
>> On Sun, Jul 28, 2013 at 4:25 PM, Alexander Holler <holler@xxxxxxxxxxxxx> wrote:
>>
>>> By the way, if someone decides to touch omap_hsmmc, the driver wrongly
>>> assumes that 0 is not a valid IRQ number and it doesn't check if
>>> gpio_to_irq() returns a negative value. ;)
>>
>> Zero *is* *not* a valid IRQ number.
>
> Where is that mentioned?
>
> gpio.txt states:
>
> ----
> Non-error values returned from gpio_to_irq() can be passed to request_irq()
> or free_irq().  They will often be stored into IRQ resources for platform
> ----
>
> With the new patches gpio_to_irq() returns 0.
>

Hi Alexander,

gpio_to_irq() returns 0 because omap_gpio_to_irq() calls
irq_find_mapping() and this does:

if (domain == NULL)
       return 0;

So gpio_to_irq() returning zero means that there isn't a GPIO-IRQ
mapping domain not that the 0 is the virtual IRQ number mapped to this
GPIO.

> Documentation/IRQ-domain.txt:
> ----
> The legacy map should only be used if fixed IRQ mappings must be
> supported.  For example, ISA controllers would use the legacy map for
> mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ
> numbers.
> ----
>
> You see the 0 too?
>
> And while browsing some other source I had the impression zero might be
> a valid irq number too, at least in regard to the IRQ apis. If it's a
> valid IRQ nuber on ARM is something else.
>
> Of ourse, I might be wrong, but you just stated that 0 isn't valid, and
> I would be happy to find a source for your statement.
>
> Alexander Holler
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux