aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-input.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-08-01 01:18:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:42:56 -0400
commitc02e0d12a9a0a913dee5efd695603b73ee4b729a (patch)
tree124e8438dc79d6bcc9d964cb555dbe3747c21e3d /drivers/media/video/cx23885/cx23885-input.c
parent2560d94e330f35776e944b54256a526a19259429 (diff)
V4L/DVB: cx23885, cx25840: Change IR measurment records to use struct ir_raw_event
The CX23885 and CX25840 modules were using their own simple IR pulse width measurement record type which required conversion when passing to the new IR core. This change makes that record type consistent with the new IR core and removes a data conversion. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-input.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-input.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index 252817acc35b..bb61870b8d6e 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -44,34 +44,26 @@
44 44
45#define MODULE_NAME "cx23885" 45#define MODULE_NAME "cx23885"
46 46
47static void convert_measurement(u32 x, struct ir_raw_event *y)
48{
49 y->pulse = (x & V4L2_SUBDEV_IR_PULSE_LEVEL_MASK) ? true : false;
50 y->duration = x & V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS;
51}
52
53static void cx23885_input_process_measurements(struct cx23885_dev *dev, 47static void cx23885_input_process_measurements(struct cx23885_dev *dev,
54 bool overrun) 48 bool overrun)
55{ 49{
56 struct cx23885_kernel_ir *kernel_ir = dev->kernel_ir; 50 struct cx23885_kernel_ir *kernel_ir = dev->kernel_ir;
57 struct ir_raw_event kernel_ir_event;
58 51
59 u32 sd_ir_data[64];
60 ssize_t num; 52 ssize_t num;
61 int count, i; 53 int count, i;
62 bool handle = false; 54 bool handle = false;
55 struct ir_raw_event ir_core_event[64];
63 56
64 do { 57 do {
65 num = 0; 58 num = 0;
66 v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) sd_ir_data, 59 v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) ir_core_event,
67 sizeof(sd_ir_data), &num); 60 sizeof(ir_core_event), &num);
68 61
69 count = num / sizeof(u32); 62 count = num / sizeof(struct ir_raw_event);
70 63
71 for (i = 0; i < count; i++) { 64 for (i = 0; i < count; i++) {
72 convert_measurement(sd_ir_data[i], &kernel_ir_event);
73 ir_raw_event_store(kernel_ir->inp_dev, 65 ir_raw_event_store(kernel_ir->inp_dev,
74 &kernel_ir_event); 66 &ir_core_event[i]);
75 handle = true; 67 handle = true;
76 } 68 }
77 } while (num != 0); 69 } while (num != 0);