All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND] [PATCH for 2.6.37] cx23885, cx25840: Provide IR Rx timeout event reports
@ 2010-12-19 23:10 Andy Walls
  2011-09-21 15:01 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Walls @ 2010-12-19 23:10 UTC (permalink / raw
  To: linux-media
  Cc: David Härdeman, Maxim Levitsky, Jarod Wilson,
	Mauro Carvalho Chehab, stoth

(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>
---
 drivers/media/video/cx23885/cx23888-ir.c |   12 ++++++++----
 drivers/media/video/cx25840/cx25840-ir.c |   12 ++++++++----
 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 e37be6f..bb1ce34 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,
 
 	unsigned int i, n;
 	union cx23888_ir_fifo_rec *p;
-	unsigned u, v;
+	unsigned u, v, w;
 
 	n = count / sizeof(union cx23888_ir_fifo_rec)
 		* 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,
 		if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) {
 			/* Assume RTO was because of no IR light input */
 			u = 0;
-			v4l2_dbg(2, ir_888_debug, sd, "rx read: end of rx\n");
+			w = 1;
 		} else {
 			u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0;
 			if (invert)
 				u = u ? 0 : 1;
+			w = 0;
 		}
 
 		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,
 		init_ir_raw_event(&p->ir_core_data);
 		p->ir_core_data.pulse = u;
 		p->ir_core_data.duration = v;
+		p->ir_core_data.timeout = w;
 
-		v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns  %s\n",
-			 v, u ? "mark" : "space");
+		v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns  %s  %s\n",
+			 v, u ? "mark" : "space", w ? "(timed out)" : "");
+		if (w)
+			v4l2_dbg(2, ir_888_debug, sd, "rx read: end of rx\n");
 	}
 	return 0;
 }
diff --git a/drivers/media/video/cx25840/cx25840-ir.c b/drivers/media/video/cx25840/cx25840-ir.c
index 627926f..b210c29 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,
 	u16 divider;
 	unsigned int i, n;
 	union cx25840_ir_fifo_rec *p;
-	unsigned u, v;
+	unsigned u, v, w;
 
 	if (ir_state == NULL)
 		return -ENODEV;
@@ -694,11 +694,12 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
 		if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) {
 			/* Assume RTO was because of no IR light input */
 			u = 0;
-			v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n");
+			w = 1;
 		} else {
 			u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0;
 			if (invert)
 				u = u ? 0 : 1;
+			w = 0;
 		}
 
 		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,
 		init_ir_raw_event(&p->ir_core_data);
 		p->ir_core_data.pulse = u;
 		p->ir_core_data.duration = v;
+		p->ir_core_data.timeout = w;
 
-		v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns  %s\n",
-			 v, u ? "mark" : "space");
+		v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns  %s  %s\n",
+			 v, u ? "mark" : "space", w ? "(timed out)" : "");
+		if (w)
+			v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n");
 	}
 	return 0;
 }



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND] [PATCH for 2.6.37] cx23885, cx25840: Provide IR Rx timeout event reports
  2010-12-19 23:10 [RESEND] [PATCH for 2.6.37] cx23885, cx25840: Provide IR Rx timeout event reports Andy Walls
@ 2011-09-21 15:01 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2011-09-21 15:01 UTC (permalink / raw
  To: Andy Walls
  Cc: linux-media, David Härdeman, Maxim Levitsky, Jarod Wilson,
	stoth

Em 19-12-2010 21:10, Andy Walls escreveu:
> (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.

Hi Andy,

I've no idea what's happened with this patch[1], but it seems that it
were never applied. Is this patch still valid?

[1] http://patchwork.linuxtv.org/patch/5133/

Thanks,
Mauro

> 
> Signed-off-by: Andy Walls <awalls@md.metrocast.net>
> ---
>  drivers/media/video/cx23885/cx23888-ir.c |   12 ++++++++----
>  drivers/media/video/cx25840/cx25840-ir.c |   12 ++++++++----
>  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 e37be6f..bb1ce34 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,
>  
>  	unsigned int i, n;
>  	union cx23888_ir_fifo_rec *p;
> -	unsigned u, v;
> +	unsigned u, v, w;
>  
>  	n = count / sizeof(union cx23888_ir_fifo_rec)
>  		* 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,
>  		if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) {
>  			/* Assume RTO was because of no IR light input */
>  			u = 0;
> -			v4l2_dbg(2, ir_888_debug, sd, "rx read: end of rx\n");
> +			w = 1;
>  		} else {
>  			u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0;
>  			if (invert)
>  				u = u ? 0 : 1;
> +			w = 0;
>  		}
>  
>  		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,
>  		init_ir_raw_event(&p->ir_core_data);
>  		p->ir_core_data.pulse = u;
>  		p->ir_core_data.duration = v;
> +		p->ir_core_data.timeout = w;
>  
> -		v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns  %s\n",
> -			 v, u ? "mark" : "space");
> +		v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns  %s  %s\n",
> +			 v, u ? "mark" : "space", w ? "(timed out)" : "");
> +		if (w)
> +			v4l2_dbg(2, ir_888_debug, sd, "rx read: end of rx\n");
>  	}
>  	return 0;
>  }
> diff --git a/drivers/media/video/cx25840/cx25840-ir.c b/drivers/media/video/cx25840/cx25840-ir.c
> index 627926f..b210c29 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,
>  	u16 divider;
>  	unsigned int i, n;
>  	union cx25840_ir_fifo_rec *p;
> -	unsigned u, v;
> +	unsigned u, v, w;
>  
>  	if (ir_state == NULL)
>  		return -ENODEV;
> @@ -694,11 +694,12 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
>  		if ((p->hw_fifo_data & FIFO_RXTX_RTO) == FIFO_RXTX_RTO) {
>  			/* Assume RTO was because of no IR light input */
>  			u = 0;
> -			v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n");
> +			w = 1;
>  		} else {
>  			u = (p->hw_fifo_data & FIFO_RXTX_LVL) ? 1 : 0;
>  			if (invert)
>  				u = u ? 0 : 1;
> +			w = 0;
>  		}
>  
>  		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,
>  		init_ir_raw_event(&p->ir_core_data);
>  		p->ir_core_data.pulse = u;
>  		p->ir_core_data.duration = v;
> +		p->ir_core_data.timeout = w;
>  
> -		v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns  %s\n",
> -			 v, u ? "mark" : "space");
> +		v4l2_dbg(2, ir_debug, sd, "rx read: %10u ns  %s  %s\n",
> +			 v, u ? "mark" : "space", w ? "(timed out)" : "");
> +		if (w)
> +			v4l2_dbg(2, ir_debug, sd, "rx read: end of rx\n");
>  	}
>  	return 0;
>  }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-21 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-19 23:10 [RESEND] [PATCH for 2.6.37] cx23885, cx25840: Provide IR Rx timeout event reports Andy Walls
2011-09-21 15:01 ` Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.