Commit bdb39ccebcec202fe782292925a1485d8443edca
Committed by
Greg Kroah-Hartman
1 parent
4e55dad93e
media/rc: Send sync space information on the lirc device
commit a8f29e89f2b54fbf2c52be341f149bc195b63a8b upstream. Userspace expects to see a long space before the first pulse is sent on the lirc device. Currently, if a long time has passed and a new packet is started, the lirc codec just returns and doesn't send anything. This makes lircd ignore many perfectly valid signals unless they are sent in quick sucession. When a reset event is delivered, we cannot know anything about the duration of the space. But it should be safe to assume it has been a long time and we just set the duration to maximum. Signed-off-by: Austin Lund <austin.lund@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 9 additions and 3 deletions Side-by-side Diff
drivers/media/rc/ir-lirc-codec.c
... | ... | @@ -42,11 +42,17 @@ |
42 | 42 | return -EINVAL; |
43 | 43 | |
44 | 44 | /* Packet start */ |
45 | - if (ev.reset) | |
46 | - return 0; | |
45 | + if (ev.reset) { | |
46 | + /* Userspace expects a long space event before the start of | |
47 | + * the signal to use as a sync. This may be done with repeat | |
48 | + * packets and normal samples. But if a reset has been sent | |
49 | + * then we assume that a long time has passed, so we send a | |
50 | + * space with the maximum time value. */ | |
51 | + sample = LIRC_SPACE(LIRC_VALUE_MASK); | |
52 | + IR_dprintk(2, "delivering reset sync space to lirc_dev\n"); | |
47 | 53 | |
48 | 54 | /* Carrier reports */ |
49 | - if (ev.carrier_report) { | |
55 | + } else if (ev.carrier_report) { | |
50 | 56 | sample = LIRC_FREQUENCY(ev.carrier); |
51 | 57 | IR_dprintk(2, "carrier report (freq: %d)\n", sample); |
52 | 58 |