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;
}
*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)
*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)