aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-input.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-07-18 23:41:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:42:55 -0400
commit98d109f90fc02ce8baf1c2471ffcf8d66fb0d8e6 (patch)
treedf1a3191953696bcccc618a25f749ee8071565a9 /drivers/media/video/cx23885/cx23885-input.c
parentd6b1850d3c49e66f17bbb67f964a48b11528f56b (diff)
V4L/DVB: cx23885: Add preliminary IR Rx support for the HVR-1250 and TeVii S470
Add initial IR Rx support using the intergrated IR controller in the A/V core of the CX23885 bridge chip. This initial support is flawed in that I2C transactions should not be performed in a hard irq context. That will be fixed in a follow on patch. The TeVii S470 support is reported to generate perptual interrupts that renders a user' system nearly unusable. The TeVii S470 IR will be disabled by default in a follow on patch. 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.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index 496d751ffdc8..3f924e21b957 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -99,8 +99,10 @@ void cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events)
99 switch (dev->board) { 99 switch (dev->board) {
100 case CX23885_BOARD_HAUPPAUGE_HVR1850: 100 case CX23885_BOARD_HAUPPAUGE_HVR1850:
101 case CX23885_BOARD_HAUPPAUGE_HVR1290: 101 case CX23885_BOARD_HAUPPAUGE_HVR1290:
102 case CX23885_BOARD_TEVII_S470:
103 case CX23885_BOARD_HAUPPAUGE_HVR1250:
102 /* 104 /*
103 * The only board we handle right now. However other boards 105 * The only boards we handle right now. However other boards
104 * using the CX2388x integrated IR controller should be similar 106 * using the CX2388x integrated IR controller should be similar
105 */ 107 */
106 break; 108 break;
@@ -148,6 +150,7 @@ static int cx23885_input_ir_start(struct cx23885_dev *dev)
148 switch (dev->board) { 150 switch (dev->board) {
149 case CX23885_BOARD_HAUPPAUGE_HVR1850: 151 case CX23885_BOARD_HAUPPAUGE_HVR1850:
150 case CX23885_BOARD_HAUPPAUGE_HVR1290: 152 case CX23885_BOARD_HAUPPAUGE_HVR1290:
153 case CX23885_BOARD_HAUPPAUGE_HVR1250:
151 /* 154 /*
152 * The IR controller on this board only returns pulse widths. 155 * The IR controller on this board only returns pulse widths.
153 * Any other mode setting will fail to set up the device. 156 * Any other mode setting will fail to set up the device.
@@ -172,6 +175,37 @@ static int cx23885_input_ir_start(struct cx23885_dev *dev)
172 */ 175 */
173 params.invert_level = true; 176 params.invert_level = true;
174 break; 177 break;
178 case CX23885_BOARD_TEVII_S470:
179 /*
180 * The IR controller on this board only returns pulse widths.
181 * Any other mode setting will fail to set up the device.
182 */
183 params.mode = V4L2_SUBDEV_IR_MODE_PULSE_WIDTH;
184 params.enable = true;
185 params.interrupt_enable = true;
186 params.shutdown = false;
187
188 /* Setup for a standard NEC protocol */
189 params.carrier_freq = 37917; /* Hz, 455 kHz/12 for NEC */
190 params.carrier_range_lower = 33000; /* Hz */
191 params.carrier_range_upper = 43000; /* Hz */
192 params.duty_cycle = 33; /* percent, 33 percent for NEC */
193
194 /*
195 * NEC max pulse width: (64/3)/(455 kHz/12) * 16 nec_units
196 * (64/3)/(455 kHz/12) * 16 nec_units * 1.375 = 12378022 ns
197 */
198 params.max_pulse_width = 12378022; /* ns */
199
200 /*
201 * NEC noise filter min width: (64/3)/(455 kHz/12) * 1 nec_unit
202 * (64/3)/(455 kHz/12) * 1 nec_units * 0.625 = 351648 ns
203 */
204 params.noise_filter_min_width = 351648; /* ns */
205
206 params.modulation = false;
207 params.invert_level = true;
208 break;
175 } 209 }
176 v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params); 210 v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params);
177 return 0; 211 return 0;
@@ -244,12 +278,20 @@ int cx23885_input_init(struct cx23885_dev *dev)
244 switch (dev->board) { 278 switch (dev->board) {
245 case CX23885_BOARD_HAUPPAUGE_HVR1850: 279 case CX23885_BOARD_HAUPPAUGE_HVR1850:
246 case CX23885_BOARD_HAUPPAUGE_HVR1290: 280 case CX23885_BOARD_HAUPPAUGE_HVR1290:
247 /* Integrated CX23888 IR controller */ 281 case CX23885_BOARD_HAUPPAUGE_HVR1250:
282 /* Integrated CX2388[58] IR controller */
248 driver_type = RC_DRIVER_IR_RAW; 283 driver_type = RC_DRIVER_IR_RAW;
249 allowed_protos = IR_TYPE_ALL; 284 allowed_protos = IR_TYPE_ALL;
250 /* The grey Hauppauge RC-5 remote */ 285 /* The grey Hauppauge RC-5 remote */
251 rc_map = RC_MAP_RC5_HAUPPAUGE_NEW; 286 rc_map = RC_MAP_RC5_HAUPPAUGE_NEW;
252 break; 287 break;
288 case CX23885_BOARD_TEVII_S470:
289 /* Integrated CX23885 IR controller */
290 driver_type = RC_DRIVER_IR_RAW;
291 allowed_protos = IR_TYPE_ALL;
292 /* A guess at the remote */
293 rc_map = RC_MAP_TEVII_NEC;
294 break;
253 default: 295 default:
254 return -ENODEV; 296 return -ENODEV;
255 } 297 }