]> git.baikalelectronics.ru Git - kernel.git/commit
media: lirc: ensure lirc device receives repeats
authorMarko Mäkelä <marko.makela@iki.fi>
Fri, 8 Jul 2022 08:44:59 +0000 (09:44 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 15 Jul 2022 13:55:23 +0000 (14:55 +0100)
commit89d03cb1da36a460cd439e98b473b5aea92ea2f7
treeb3f208a6c6aaee4c711a25f1cc0faf2b9264e2f5
parentbcf9a77b2a4ed206d9c0f38d35f45436ff563ecb
media: lirc: ensure lirc device receives repeats

Pressing a button on a remote control unit will typically lead to
messages being sent several times per second until the button is released.

Some remote control units indicate long key presses by sending
special "repeat" messages, for which the protocol driver calls
rc_repeat(). Other units repeat the same message over and over,
which will be handled by calling rc_keydown().

The function rc_keydown() never set the LIRC "repeat" flag to distinguish
repeated messages that were sent due to a long keypress, and messages
sent due to repeated short keypresses. While a user-space program may
implement special logic to distinguish long keypresses, it is much simpler
to be able to rely on the flag.

Commit 975f8fe6cc7e3f48d88f30b7b292b3f4ce5e69f2 ("media: lirc: implement
reading scancode") would never set the LIRC_SCANCODE_FLAG_REPEAT flag.
Commit e1254f1cef23f032b2a8299848acf82030911095
("media: lirc: ensure lirc device receives nec repeats") fixed it up for
rc_repeat() but not rc_keydown().

Signed-off-by: Marko Mäkelä <marko.makela@iki.fi>
Co-developed-by: Sean Young <sean@mess.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/rc/rc-main.c