From: Thor Thayer <tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
To: Dmitry Torokhov
<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Using gpio_keys with regmapped gpio?
Date: Tue, 31 Mar 2015 16:06:11 -0500 [thread overview]
Message-ID: <551B0C43.5000101@opensource.altera.com> (raw)
In-Reply-To: <20150331201739.GA29015@dtor-ws>
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?
How does the gpio-key framework work with register mapped GPIOs that are
rising-edge or falling-edge triggered? I tend to think of these IRQ
states as the general case for GPIO.
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-03-31 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-31 19:57 Using gpio_keys with regmapped gpio? Thor Thayer
[not found] ` <551AFC2F.3060300-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2015-03-31 20:04 ` Mark Brown
2015-03-31 20:17 ` Dmitry Torokhov
2015-03-31 21:06 ` Thor Thayer [this message]
[not found] ` <551B0C43.5000101-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2015-04-01 15:59 ` Dmitry Torokhov
[not found] ` <CAKdAkRTwPwSThinV-t6UN3LMY8-XXYJ1dB+11U9SZ=zZT4Kt7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-01 16:00 ` Dmitry Torokhov
2015-04-03 7:13 ` Geert Uytterhoeven
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=551B0C43.5000101@opensource.altera.com \
--to=tthayer-yzvpicuk2abmcg4ihk0kfoh6mc4mb0vx@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).