aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-12-19 17:10:28 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-24 11:00:32 -0400
commitbd829e9d1d7de3178d67d94043f43527213a63a0 (patch)
treeb6847328682fb097d96e3687c95ce3258297d10d /drivers
parent5b3bdfce675040b65a8b97f8209d78a31935c48f (diff)
[media] cx23885, cx25840: Provide IR Rx timeout event reports
(Resending because Mauro reported losing some emails on IRC) Provide CX2388[578] IR receive timeout (RTO) reports in the final space raw event sent up the chain to the raw IR pulse decoders. This should allow the lirc decoder to actually measure the inter-transmission gap properly. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/cx23885/cx23888-ir.c12
-rw-r--r--drivers/media/video/cx25840/cx25840-ir.c12
2 files changed, 16 insertions, 8 deletions
diff --git a/drivers/media/video/cx23885/cx23888-ir.c b/drivers/media/video/cx23885/cx23888-ir.c
index e37be6fcf67..bb1ce346425 100644
--- a/drivers/media/video/cx23885/cx23888-ir.c
+++ b/drivers/media/video/cx23885/cx23888-ir.c
@@ -673,7 +673,7 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
673 673
674 unsigned int i, n; 674 unsigned int i, n;
675 union cx23888_ir_fifo_rec *p; 675 union cx23888_ir_fifo_rec *p;
676 unsigned u, v; 676 unsigned u, v, w;
677 677
678 n = count / sizeof(union cx23888_ir_fifo_rec) 678 n = count / sizeof(union cx23888_ir_fifo_rec)
679 * sizeof(union cx23888_ir_fifo_rec); 679 * sizeof(union cx23888_ir_fifo_rec);
@@ -692,11 +692,12 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
692 if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) { 692 if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) {
693 /* Assume RTO was because of no IR light input */ 693 /* Assume RTO was because of no IR light input */
694 u = 0; 694 u = 0;
695 v4l2_dbg(2, ir_888_debug, sd, "rx read: end of rx\n"); 695 w = 1;
696 } else { 696 } else {
697 u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0; 697 u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0;
698 if (invert) 698 if (invert)
699 u = u ? 0 : 1; 699 u = u ? 0 : 1;
700 w = 0;
700 } 701 }
701 702
702 v = (unsigned) pulse_width_count_to_ns( 703 v = (unsigned) pulse_width_count_to_ns(
@@ -707,9 +708,12 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
707 init_ir_raw_event(&p->ir_core_data); 708 init_ir_raw_event(&p->ir_core_data);
708 p->ir_core_data.pulse = u; 709 p->ir_core_data.pulse = u;
709 p->ir_core_data.duration = v; 710 p->ir_core_data.duration = v;
711 p->ir_core_data.timeout = w;
710 712
711 v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns %s\n", 713 v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns %s %s\n",
712 v, u ? "mark" : "space"); 714 v, u ? "mark" : "space", w ? "(timed out)" : "");
715 if (w)
716 v4l2_dbg(2, ir_888_debug, sd, "rx read: end of rx\n");
713 } 717 }
714 return 0; 718 return 0;
715} 719}
diff --git a/drivers/media/video/cx25840/cx25840-ir.c b/drivers/media/video/cx25840/cx25840-ir.c
index 7eb79af28aa..b718a3a4bed 100644
--- a/drivers/media/video/cx25840/cx25840-ir.c
+++ b/drivers/media/video/cx25840/cx25840-ir.c
@@ -668,7 +668,7 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
668 u16 divider; 668 u16 divider;
669 unsigned int i, n; 669 unsigned int i, n;
670 union cx25840_ir_fifo_rec *p; 670 union cx25840_ir_fifo_rec *p;
671 unsigned u, v; 671 unsigned u, v, w;
672 672
673 if (ir_state == NULL) 673 if (ir_state == NULL)
674 return -ENODEV; 674 return -ENODEV;
@@ -694,11 +694,12 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
694 if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) { 694 if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) {
695 /* Assume RTO was because of no IR light input */ 695 /* Assume RTO was because of no IR light input */
696 u = 0; 696 u = 0;
697 v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n"); 697 w = 1;
698 } else { 698 } else {
699 u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0; 699 u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0;
700 if (invert) 700 if (invert)
701 u = u ? 0 : 1; 701 u = u ? 0 : 1;
702 w = 0;
702 } 703 }
703 704
704 v = (unsigned) pulse_width_count_to_ns( 705 v = (unsigned) pulse_width_count_to_ns(
@@ -709,9 +710,12 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
709 init_ir_raw_event(&p->ir_core_data); 710 init_ir_raw_event(&p->ir_core_data);
710 p->ir_core_data.pulse = u; 711 p->ir_core_data.pulse = u;
711 p->ir_core_data.duration = v; 712 p->ir_core_data.duration = v;
713 p->ir_core_data.timeout = w;
712 714
713 v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns %s\n", 715 v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns %s %s\n",
714 v, u ? "mark" : "space"); 716 v, u ? "mark" : "space", w ? "(timed out)" : "");
717 if (w)
718 v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n");
715 } 719 }
716 return 0; 720 return 0;
717} 721}