From 2560d94e330f35776e944b54256a526a19259429 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Sat, 31 Jul 2010 23:28:37 -0300 Subject: 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx23885/cx23885-input.c | 6 ------ drivers/media/video/cx23885/cx23888-ir.c | 14 ++++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'drivers/media/video/cx23885') diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c index 3f924e21b957..252817acc35b 100644 --- a/drivers/media/video/cx23885/cx23885-input.c +++ b/drivers/media/video/cx23885/cx23885-input.c @@ -46,12 +46,6 @@ static void convert_measurement(u32 x, struct ir_raw_event *y) { - if (x == V4L2_SUBDEV_IR_PULSE_RX_SEQ_END) { - y->pulse = false; - y->duration = V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS; - return; - } - y->pulse = (x & V4L2_SUBDEV_IR_PULSE_LEVEL_MASK) ? true : false; y->duration = x & V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS; } diff --git a/drivers/media/video/cx23885/cx23888-ir.c b/drivers/media/video/cx23885/cx23888-ir.c index aa07286b8d9b..684d23db98a7 100644 --- a/drivers/media/video/cx23885/cx23888-ir.c +++ b/drivers/media/video/cx23885/cx23888-ir.c @@ -675,16 +675,18 @@ static int cx23888_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_888_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) -- cgit v1.2.2