]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/media/video/cx25840/cx25840-ir.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-artful-kernel.git] / drivers / media / video / cx25840 / cx25840-ir.c
index 4f12bcf44a6a5ef55c21068269a21fac996d471f..13c380ebb5621571bf43fc546acaa1aaf07b6029 100644 (file)
@@ -669,7 +669,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;
@@ -695,11 +695,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(
@@ -710,9 +711,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;
 }