Re: Using gpio_keys with regmapped gpio?

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

 



On Wed, Apr 1, 2015 at 8:59 AM, Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
> On Tue, Mar 31, 2015 at 2:06 PM, Thor Thayer
> <tthayer@xxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>>
>> On 03/31/2015 03:17 PM, Dmitry Torokhov wrote:
>>>
>>> On Tue, Mar 31, 2015 at 02:57:35PM -0500, Thor Thayer wrote:
>>>>
>>>> Hi,
>>>>
>>>> I have a SPI gpio expander chip that is using the regmap framework.
>>>> There are some pushbuttons that I'd like to use the gpio_keys
>>>> framework for but only the first button press creates an input
>>>> event.
>>>>
>>>> It seems like my problem occurs because I'm only getting events on a
>>>> button press.  The input_get_disposition() function toggles a local
>>>> copy of the button state [__change_bit(code, dev->key);] in the
>>>> input.c file. I think this function also needs to be called when the
>>>> button is released to toggle the dev->key state and re-arm for the
>>>> next button press.
>>>
>>>
>>> Yes.
>>>
>>>>
>>>> I tried enabling autorepeat but that causes an infinite loop in the
>>>> input_repeat_key() function.
>>>>
>>>> In both cases, it seems like the button press condition must be
>>>> cleared when the button is released. This seems like it should be
>>>> common for all GPIOs so I'm probably missing something.
>>>
>>>
>>> It sounds like your expander does not generate interrupt when the button
>>> is released and so gpio-keys driver is not aware of it.
>>>
>>> Thanks.
>>>
>>
>> Thanks for the quick reply. Is giving an interrupt on both press and release
>> a requirement for gpio-keys? or is there another setup that I'm not aware
>> of?
>>
>
> Yes.

And by that I meant "Yes, it is a requirement".

Thanks.

-- 
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