diff options
author | Chris Pascoe <c.pascoe@itee.uq.edu.au> | 2006-01-09 12:25:35 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-09 12:25:35 -0500 |
commit | fc40b261db15d010455ad0a4e2ac59da2ced730f (patch) | |
tree | d91b96cb35c8b2e978d6ff1be5bdf3aad1993709 /drivers/media/video/cx88/cx88-input.c | |
parent | 50c25fff5385c6baf3114f7c369b0f75a29ac1e8 (diff) |
V4L/DVB (3220): Add support for VP-3054 HDTV board
- Added support for VP-3054 (aka DigitalNow DNTV Live! DVB-T Pro!).
- This board has a secondary I2C bus and remote control.
- Added a new module to handle secondary I2C bus on this board.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/cx88/cx88-input.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 649bbf7bcc29..f40f97026b84 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (c) 2003 Pavel Machek | 6 | * Copyright (c) 2003 Pavel Machek |
7 | * Copyright (c) 2004 Gerd Knorr | 7 | * Copyright (c) 2004 Gerd Knorr |
8 | * Copyright (c) 2004 Chris Pascoe | 8 | * Copyright (c) 2004, 2005 Chris Pascoe |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -305,6 +305,66 @@ static IR_KEYTAB_TYPE ir_codes_avertv_303[IR_KEYTAB_SIZE] = { | |||
305 | 305 | ||
306 | /* ---------------------------------------------------------------------- */ | 306 | /* ---------------------------------------------------------------------- */ |
307 | 307 | ||
308 | /* DigitalNow DNTV Live! DVB-T Pro Remote */ | ||
309 | static IR_KEYTAB_TYPE ir_codes_dntv_live_dvbt_pro[IR_KEYTAB_SIZE] = { | ||
310 | [ 0x16 ] = KEY_POWER, | ||
311 | [ 0x5b ] = KEY_HOME, | ||
312 | |||
313 | [ 0x55 ] = KEY_TV, /* live tv */ | ||
314 | [ 0x58 ] = KEY_TUNER, /* digital Radio */ | ||
315 | [ 0x5a ] = KEY_RADIO, /* FM radio */ | ||
316 | [ 0x59 ] = KEY_DVD, /* dvd menu */ | ||
317 | [ 0x03 ] = KEY_1, | ||
318 | [ 0x01 ] = KEY_2, | ||
319 | [ 0x06 ] = KEY_3, | ||
320 | [ 0x09 ] = KEY_4, | ||
321 | [ 0x1d ] = KEY_5, | ||
322 | [ 0x1f ] = KEY_6, | ||
323 | [ 0x0d ] = KEY_7, | ||
324 | [ 0x19 ] = KEY_8, | ||
325 | [ 0x1b ] = KEY_9, | ||
326 | [ 0x0c ] = KEY_CANCEL, | ||
327 | [ 0x15 ] = KEY_0, | ||
328 | [ 0x4a ] = KEY_CLEAR, | ||
329 | [ 0x13 ] = KEY_BACK, | ||
330 | [ 0x00 ] = KEY_TAB, | ||
331 | [ 0x4b ] = KEY_UP, | ||
332 | [ 0x4e ] = KEY_LEFT, | ||
333 | [ 0x4f ] = KEY_OK, | ||
334 | [ 0x52 ] = KEY_RIGHT, | ||
335 | [ 0x51 ] = KEY_DOWN, | ||
336 | [ 0x1e ] = KEY_VOLUMEUP, | ||
337 | [ 0x0a ] = KEY_VOLUMEDOWN, | ||
338 | [ 0x02 ] = KEY_CHANNELDOWN, | ||
339 | [ 0x05 ] = KEY_CHANNELUP, | ||
340 | [ 0x11 ] = KEY_RECORD, | ||
341 | [ 0x14 ] = KEY_PLAY, | ||
342 | [ 0x4c ] = KEY_PAUSE, | ||
343 | [ 0x1a ] = KEY_STOP, | ||
344 | [ 0x40 ] = KEY_REWIND, | ||
345 | [ 0x12 ] = KEY_FASTFORWARD, | ||
346 | [ 0x41 ] = KEY_PREVIOUSSONG, /* replay |< */ | ||
347 | [ 0x42 ] = KEY_NEXTSONG, /* skip >| */ | ||
348 | [ 0x54 ] = KEY_CAMERA, /* capture */ | ||
349 | [ 0x50 ] = KEY_LANGUAGE, /* sap */ | ||
350 | [ 0x47 ] = KEY_TV2, /* pip */ | ||
351 | [ 0x4d ] = KEY_SCREEN, | ||
352 | [ 0x43 ] = KEY_SUBTITLE, | ||
353 | [ 0x10 ] = KEY_MUTE, | ||
354 | [ 0x49 ] = KEY_AUDIO, /* l/r */ | ||
355 | [ 0x07 ] = KEY_SLEEP, | ||
356 | [ 0x08 ] = KEY_VIDEO, /* a/v */ | ||
357 | [ 0x0e ] = KEY_PREVIOUS, /* recall */ | ||
358 | [ 0x45 ] = KEY_ZOOM, /* zoom + */ | ||
359 | [ 0x46 ] = KEY_ANGLE, /* zoom - */ | ||
360 | [ 0x56 ] = KEY_RED, | ||
361 | [ 0x57 ] = KEY_GREEN, | ||
362 | [ 0x5c ] = KEY_YELLOW, | ||
363 | [ 0x5d ] = KEY_BLUE, | ||
364 | }; | ||
365 | |||
366 | /* ---------------------------------------------------------------------- */ | ||
367 | |||
308 | struct cx88_IR { | 368 | struct cx88_IR { |
309 | struct cx88_core *core; | 369 | struct cx88_core *core; |
310 | struct input_dev *input; | 370 | struct input_dev *input; |
@@ -313,7 +373,7 @@ struct cx88_IR { | |||
313 | char phys[32]; | 373 | char phys[32]; |
314 | 374 | ||
315 | /* sample from gpio pin 16 */ | 375 | /* sample from gpio pin 16 */ |
316 | int sampling; | 376 | u32 sampling; |
317 | u32 samples[16]; | 377 | u32 samples[16]; |
318 | int scount; | 378 | int scount; |
319 | unsigned long release; | 379 | unsigned long release; |
@@ -431,7 +491,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
431 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: | 491 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: |
432 | ir_codes = ir_codes_cinergy_1400; | 492 | ir_codes = ir_codes_cinergy_1400; |
433 | ir_type = IR_TYPE_PD; | 493 | ir_type = IR_TYPE_PD; |
434 | ir->sampling = 1; | 494 | ir->sampling = 0xeb04; /* address */ |
435 | break; | 495 | break; |
436 | case CX88_BOARD_HAUPPAUGE: | 496 | case CX88_BOARD_HAUPPAUGE: |
437 | case CX88_BOARD_HAUPPAUGE_DVB_T1: | 497 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
@@ -484,6 +544,11 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
484 | ir->mask_keydown = 0x02; | 544 | ir->mask_keydown = 0x02; |
485 | ir->polling = 50; /* ms */ | 545 | ir->polling = 50; /* ms */ |
486 | break; | 546 | break; |
547 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: | ||
548 | ir_codes = ir_codes_dntv_live_dvbt_pro; | ||
549 | ir_type = IR_TYPE_PD; | ||
550 | ir->sampling = 0xff00; /* address */ | ||
551 | break; | ||
487 | } | 552 | } |
488 | 553 | ||
489 | if (NULL == ir_codes) { | 554 | if (NULL == ir_codes) { |
@@ -541,6 +606,10 @@ int cx88_ir_fini(struct cx88_core *core) | |||
541 | if (NULL == ir) | 606 | if (NULL == ir) |
542 | return 0; | 607 | return 0; |
543 | 608 | ||
609 | if (ir->sampling) { | ||
610 | cx_write(MO_DDSCFG_IO, 0x0); | ||
611 | core->pci_irqmask &= ~(1 << 18); | ||
612 | } | ||
544 | if (ir->polling) { | 613 | if (ir->polling) { |
545 | del_timer(&ir->timer); | 614 | del_timer(&ir->timer); |
546 | flush_scheduled_work(); | 615 | flush_scheduled_work(); |
@@ -592,6 +661,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
592 | /* decode it */ | 661 | /* decode it */ |
593 | switch (core->board) { | 662 | switch (core->board) { |
594 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: | 663 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: |
664 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: | ||
595 | ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4); | 665 | ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4); |
596 | 666 | ||
597 | if (ircode == 0xffffffff) { /* decoding error */ | 667 | if (ircode == 0xffffffff) { /* decoding error */ |
@@ -607,7 +677,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
607 | break; | 677 | break; |
608 | } | 678 | } |
609 | 679 | ||
610 | if ((ircode & 0xffff) != 0xeb04) { /* wrong address */ | 680 | if ((ircode & 0xffff) != (ir->sampling & 0xffff)) { /* wrong address */ |
611 | ir_dprintk("pulse distance decoded wrong address\n"); | 681 | ir_dprintk("pulse distance decoded wrong address\n"); |
612 | break; | 682 | break; |
613 | } | 683 | } |