diff options
author | Andy Walls <awalls@md.metrocast.net> | 2010-07-31 23:28:37 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 23:42:56 -0300 |
commit | 2560d94e330f35776e944b54256a526a19259429 (patch) | |
tree | fb58a396664cf4b7e04566704d67e3df1a398144 /drivers/media/video/cx25840 | |
parent | ceb152add687db152d90ba64b54687b3975963cf (diff) | |
download | talos-op-linux-2560d94e330f35776e944b54256a526a19259429.tar.gz talos-op-linux-2560d94e330f35776e944b54256a526a19259429.zip |
V4L/DVB: cx23885, cx25840: Report the actual length of an IR Rx timeout event
Instead of reporting an IR Rx timeout event as a ridiculously
long space, report it as a space of the lenght of the timeout.
This partially fixes operation with LIRC without breaking
interoperation with the in kernel decoders. The gaps lengths
reported to LIRC are still not real however.
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-ir.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/video/cx25840/cx25840-ir.c b/drivers/media/video/cx25840/cx25840-ir.c index 326c2554c05c..be23c5b37a2f 100644 --- a/drivers/media/video/cx25840/cx25840-ir.c +++ b/drivers/media/video/cx25840/cx25840-ir.c @@ -677,16 +677,18 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count, *num = n * sizeof(u32); for (p = (u32 *) buf, i = 0; i < n; p++, i++) { + if ((*p & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) { - *p = V4L2_SUBDEV_IR_PULSE_RX_SEQ_END; + /* Assume RTO was because of no IR light input */ + u = 0; v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n"); - continue; + } else { + u = (*p & FIFO_RXTX_LVL) + ? V4L2_SUBDEV_IR_PULSE_LEVEL_MASK : 0; + if (invert) + u = u ? 0 : V4L2_SUBDEV_IR_PULSE_LEVEL_MASK; } - u = (*p & FIFO_RXTX_LVL) ? V4L2_SUBDEV_IR_PULSE_LEVEL_MASK : 0; - if (invert) - u = u ? 0 : V4L2_SUBDEV_IR_PULSE_LEVEL_MASK; - v = (u32) pulse_width_count_to_ns((u16) (*p & FIFO_RXTX), divider); if (v >= V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS) |