Re: [PATCH] input: make gpio-keys use IRQF_SHARED

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

 



On Wed, Sep 16, 2009 at 10:41 PM, Dmitry Eremin-Solenikov
<dbaryshkov@xxxxxxxxx> wrote:
> On Wed, Sep 16, 2009 at 8:28 PM, Dmitry Torokhov
> <dmitry.torokhov@xxxxxxxxx> wrote:
>> On Wed, Sep 16, 2009 at 07:03:18PM +0400, Dmitry Eremin-Solenikov wrote:
>>> There is nothing that disallows gpio-keys to share it's IRQ line
>>> w/ other drivers. Make it use IRQF_SHARED in request_irq().
>>>
>>> An example of other driver with which I'd like to share IRQ line
>>> for GPIO buttons is ledtrig-gpio.
>>>
>>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@xxxxxxxxx>
>>> ---
>>>  drivers/input/keyboard/gpio_keys.c |    1 +
>>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
>>> index efed0c9..9fc2fab 100644
>>> --- a/drivers/input/keyboard/gpio_keys.c
>>> +++ b/drivers/input/keyboard/gpio_keys.c
>>> @@ -147,6 +147,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
>>>               }
>>>
>>>               error = request_irq(irq, gpio_keys_isr,
>>> +                                 IRQF_SHARED |
>>>                                   IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
>>>                                   button->desc ? button->desc : "gpio_keys",
>>>                                   bdata);
>>
>> How will you determine which device generated the interrupt? Because you
>> can't return IRQ_HANDLED unconditionally and expect both devices work
>> reliably.
>
> It's a single device (gpio pin). However I'd like to be able to attach
> several handlers to it.
> E.g. one isr is gpio-keys (for reporting event to userspace), another
> isr will be from
> ledtrig-gpio (controlling the LED). Another can be some kind of
> battery driver, etc.
>
> All these drivers will provide different kinds of response for single GPIO pin.

So, what about this patch?

-- 
With best wishes
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux