aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-cards.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-cards.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c116
1 files changed, 114 insertions, 2 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index dfa269838e01..6ebf58724a01 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -73,6 +73,7 @@ struct cx23885_board cx23885_boards[] = {
73 [CX23885_BOARD_HAUPPAUGE_HVR1800] = { 73 [CX23885_BOARD_HAUPPAUGE_HVR1800] = {
74 .name = "Hauppauge WinTV-HVR1800", 74 .name = "Hauppauge WinTV-HVR1800",
75 .porta = CX23885_ANALOG_VIDEO, 75 .porta = CX23885_ANALOG_VIDEO,
76 .portb = CX23885_MPEG_ENCODER,
76 .portc = CX23885_MPEG_DVB, 77 .portc = CX23885_MPEG_DVB,
77 .tuner_type = TUNER_PHILIPS_TDA8290, 78 .tuner_type = TUNER_PHILIPS_TDA8290,
78 .tuner_addr = 0x42, /* 0x84 >> 1 */ 79 .tuner_addr = 0x42, /* 0x84 >> 1 */
@@ -130,6 +131,18 @@ struct cx23885_board cx23885_boards[] = {
130 .name = "Hauppauge WinTV-HVR1500", 131 .name = "Hauppauge WinTV-HVR1500",
131 .portc = CX23885_MPEG_DVB, 132 .portc = CX23885_MPEG_DVB,
132 }, 133 },
134 [CX23885_BOARD_HAUPPAUGE_HVR1200] = {
135 .name = "Hauppauge WinTV-HVR1200",
136 .portc = CX23885_MPEG_DVB,
137 },
138 [CX23885_BOARD_HAUPPAUGE_HVR1700] = {
139 .name = "Hauppauge WinTV-HVR1700",
140 .portc = CX23885_MPEG_DVB,
141 },
142 [CX23885_BOARD_HAUPPAUGE_HVR1400] = {
143 .name = "Hauppauge WinTV-HVR1400",
144 .portc = CX23885_MPEG_DVB,
145 },
133}; 146};
134const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); 147const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
135 148
@@ -181,6 +194,18 @@ struct cx23885_subid cx23885_subids[] = {
181 .subvendor = 0x0070, 194 .subvendor = 0x0070,
182 .subdevice = 0x7717, 195 .subdevice = 0x7717,
183 .card = CX23885_BOARD_HAUPPAUGE_HVR1500, 196 .card = CX23885_BOARD_HAUPPAUGE_HVR1500,
197 }, {
198 .subvendor = 0x0070,
199 .subdevice = 0x71d1,
200 .card = CX23885_BOARD_HAUPPAUGE_HVR1200,
201 }, {
202 .subvendor = 0x0070,
203 .subdevice = 0x8101,
204 .card = CX23885_BOARD_HAUPPAUGE_HVR1700,
205 }, {
206 .subvendor = 0x0070,
207 .subdevice = 0x8010,
208 .card = CX23885_BOARD_HAUPPAUGE_HVR1400,
184 }, 209 },
185}; 210};
186const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); 211const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -235,6 +260,12 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
235 case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ 260 case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
236 case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ 261 case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */
237 case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ 262 case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
263 case 80019:
264 /* WinTV-HVR1400 (Express Card, Retail, IR,
265 * DVB-T and Basic analog */
266 case 81519:
267 /* WinTV-HVR1700 (PCIe, Retail, No IR, half height,
268 * DVB-T and MPEG2 HW Encoder */
238 break; 269 break;
239 default: 270 default:
240 printk("%s: warning: unknown hauppauge model #%d\n", dev->name, tv.model); 271 printk("%s: warning: unknown hauppauge model #%d\n", dev->name, tv.model);
@@ -264,7 +295,7 @@ int cx23885_tuner_callback(void *priv, int command, int arg)
264 } 295 }
265 else { 296 else {
266 printk(KERN_ERR 297 printk(KERN_ERR
267 "%s(): Unknow command.\n", __FUNCTION__); 298 "%s(): Unknow command.\n", __func__);
268 return -EINVAL; 299 return -EINVAL;
269 } 300 }
270 break; 301 break;
@@ -306,6 +337,10 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
306 /* GPIO-15-18 cx23417 READY, CS, RD, WR */ 337 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
307 /* GPIO-19 IR_RX */ 338 /* GPIO-19 IR_RX */
308 339
340 /* CX23417 GPIO's */
341 /* EIO15 Zilog Reset */
342 /* EIO14 S5H1409/CX24227 Reset */
343
309 /* Force the TDA8295A into reset and back */ 344 /* Force the TDA8295A into reset and back */
310 cx_set(GP0_IO, 0x00040004); 345 cx_set(GP0_IO, 0x00040004);
311 mdelay(20); 346 mdelay(20);
@@ -314,6 +349,50 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
314 cx_set(GP0_IO, 0x00040004); 349 cx_set(GP0_IO, 0x00040004);
315 mdelay(20); 350 mdelay(20);
316 break; 351 break;
352 case CX23885_BOARD_HAUPPAUGE_HVR1200:
353 /* GPIO-0 tda10048 demodulator reset */
354 /* GPIO-2 tda18271 tuner reset */
355
356 /* Put the parts into reset and back */
357 cx_set(GP0_IO, 0x00050000);
358 mdelay(20);
359 cx_clear(GP0_IO, 0x00000005);
360 mdelay(20);
361 cx_set(GP0_IO, 0x00050005);
362 break;
363 case CX23885_BOARD_HAUPPAUGE_HVR1700:
364 /* GPIO-0 TDA10048 demodulator reset */
365 /* GPIO-2 TDA8295A Reset */
366 /* GPIO-3-10 cx23417 data0-7 */
367 /* GPIO-11-14 cx23417 addr0-3 */
368 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
369
370 /* The following GPIO's are on the interna AVCore (cx25840) */
371 /* GPIO-19 IR_RX */
372 /* GPIO-20 IR_TX 416/DVBT Select */
373 /* GPIO-21 IIS DAT */
374 /* GPIO-22 IIS WCLK */
375 /* GPIO-23 IIS BCLK */
376
377 /* Put the parts into reset and back */
378 cx_set(GP0_IO, 0x00050000);
379 mdelay(20);
380 cx_clear(GP0_IO, 0x00000005);
381 mdelay(20);
382 cx_set(GP0_IO, 0x00050005);
383 break;
384 case CX23885_BOARD_HAUPPAUGE_HVR1400:
385 /* GPIO-0 Dibcom7000p demodulator reset */
386 /* GPIO-2 xc3028L tuner reset */
387 /* GPIO-13 LED */
388
389 /* Put the parts into reset and back */
390 cx_set(GP0_IO, 0x00050000);
391 mdelay(20);
392 cx_clear(GP0_IO, 0x00000005);
393 mdelay(20);
394 cx_set(GP0_IO, 0x00050005);
395 break;
317 } 396 }
318} 397}
319 398
@@ -324,6 +403,8 @@ int cx23885_ir_init(struct cx23885_dev *dev)
324 case CX23885_BOARD_HAUPPAUGE_HVR1500: 403 case CX23885_BOARD_HAUPPAUGE_HVR1500:
325 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 404 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
326 case CX23885_BOARD_HAUPPAUGE_HVR1800: 405 case CX23885_BOARD_HAUPPAUGE_HVR1800:
406 case CX23885_BOARD_HAUPPAUGE_HVR1200:
407 case CX23885_BOARD_HAUPPAUGE_HVR1400:
327 /* FIXME: Implement me */ 408 /* FIXME: Implement me */
328 break; 409 break;
329 } 410 }
@@ -348,11 +429,14 @@ void cx23885_card_setup(struct cx23885_dev *dev)
348 case CX23885_BOARD_HAUPPAUGE_HVR1250: 429 case CX23885_BOARD_HAUPPAUGE_HVR1250:
349 case CX23885_BOARD_HAUPPAUGE_HVR1500: 430 case CX23885_BOARD_HAUPPAUGE_HVR1500:
350 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 431 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
432 case CX23885_BOARD_HAUPPAUGE_HVR1400:
351 if (dev->i2c_bus[0].i2c_rc == 0) 433 if (dev->i2c_bus[0].i2c_rc == 0)
352 hauppauge_eeprom(dev, eeprom+0x80); 434 hauppauge_eeprom(dev, eeprom+0x80);
353 break; 435 break;
354 case CX23885_BOARD_HAUPPAUGE_HVR1800: 436 case CX23885_BOARD_HAUPPAUGE_HVR1800:
355 case CX23885_BOARD_HAUPPAUGE_HVR1800lp: 437 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
438 case CX23885_BOARD_HAUPPAUGE_HVR1200:
439 case CX23885_BOARD_HAUPPAUGE_HVR1700:
356 if (dev->i2c_bus[0].i2c_rc == 0) 440 if (dev->i2c_bus[0].i2c_rc == 0)
357 hauppauge_eeprom(dev, eeprom+0xc0); 441 hauppauge_eeprom(dev, eeprom+0xc0);
358 break; 442 break;
@@ -364,17 +448,45 @@ void cx23885_card_setup(struct cx23885_dev *dev)
364 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ 448 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
365 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; 449 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
366 break; 450 break;
451 case CX23885_BOARD_HAUPPAUGE_HVR1800:
452 /* Defaults for VID B - Analog encoder */
453 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
454 ts1->gen_ctrl_val = 0x10e;
455 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
456 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
457
458 /* APB_TSVALERR_POL (active low)*/
459 ts1->vld_misc_val = 0x2000;
460 ts1->hw_sop_ctrl_val = (0x47 << 16 | 188 << 4 | 0xc);
461
462 /* Defaults for VID C */
463 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
464 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
465 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
466 break;
367 case CX23885_BOARD_HAUPPAUGE_HVR1250: 467 case CX23885_BOARD_HAUPPAUGE_HVR1250:
368 case CX23885_BOARD_HAUPPAUGE_HVR1500: 468 case CX23885_BOARD_HAUPPAUGE_HVR1500:
369 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 469 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
370 case CX23885_BOARD_HAUPPAUGE_HVR1800:
371 case CX23885_BOARD_HAUPPAUGE_HVR1800lp: 470 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
471 case CX23885_BOARD_HAUPPAUGE_HVR1200:
472 case CX23885_BOARD_HAUPPAUGE_HVR1700:
473 case CX23885_BOARD_HAUPPAUGE_HVR1400:
372 default: 474 default:
373 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ 475 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
374 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ 476 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
375 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; 477 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
376 } 478 }
377 479
480 /* Certain boards support analog, or require the avcore to be
481 * loaded, ensure this happens.
482 */
483 switch (dev->board) {
484 case CX23885_BOARD_HAUPPAUGE_HVR1800:
485 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
486 case CX23885_BOARD_HAUPPAUGE_HVR1700:
487 request_module("cx25840");
488 break;
489 }
378} 490}
379 491
380/* ------------------------------------------------------------------ */ 492/* ------------------------------------------------------------------ */