Commit b464763c authored by Marko Mäkelä's avatar Marko Mäkelä Committed by Mauro Carvalho Chehab

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 de142c32 ("media: lirc: implement
reading scancode") would never set the LIRC_SCANCODE_FLAG_REPEAT flag.
Commit b66218fd
("media: lirc: ensure lirc device receives nec repeats") fixed it up for
rc_repeat() but not rc_keydown().
Signed-off-by: default avatarMarko Mäkelä <marko.makela@iki.fi>
Co-developed-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 6ab13540
......@@ -786,7 +786,8 @@ static void ir_do_keydown(struct rc_dev *dev, enum rc_proto protocol,
dev->last_toggle != toggle);
struct lirc_scancode sc = {
.scancode = scancode, .rc_proto = protocol,
.flags = toggle ? LIRC_SCANCODE_FLAG_TOGGLE : 0,
.flags = (toggle ? LIRC_SCANCODE_FLAG_TOGGLE : 0) |
(!new_event ? LIRC_SCANCODE_FLAG_REPEAT : 0),
.keycode = keycode
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment