diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-09-09 16:03:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:49 -0400 |
commit | e52e98a7eccfb0e7e91630d01690fb11d77db77d (patch) | |
tree | d910e743159977ee695c40b795a4b84d43a4dbcb /drivers/media/video/cx88/cx88-input.c | |
parent | 24a70fdce872d70171b1f49dcd1a7c3a4e8396b2 (diff) |
[PATCH] v4l: CX88 updates and card additions
- Remove $Id CVS logs for V4L files
- add ioctl indirection via cx88_ioctl_hook and cx88_ioctl_translator to
cx88-blackbird.c.
- declare the indirection hooks from cx88-blackbird.c.
- dcprintk macro which uses core instead of dev->core on cx88-video.c.
- replace dev->core occurances with core on cx88-video.c.
- CodingStyle fixes.
- MaxInput replaced by a define.
- cx8801 structures moved from cx88.h.
- The output_mode needs to be set for the Hauppauge Nova-T DVB-T
for versions after 2.6.12.
- Corrected GPIO values for cx88 cards #28 & #31 for s-video and composite.
- Updated DViCO FusionHDTV5 Gold & added DVB support.
- Fixed DViCO FusionHDTV 3 Gold-Q GPIO.
- Some clean up in cx88-tvaudio.c
- replaced hex values when writing to AUD_CTL to EN_xx for better reading.
- Allow select by hand between Mono, Lang1, Lang2 and Stereo for BTSC.
- Support for stereo NICAM and BTSC improved.
- Broken stereo check removed.
- Added support for remote control to Cinergy DVBT-1400.
- local var renamed from rc5 to a better name (ircode).
- LGDT330X QAM lock bug fixes.
- Some reorg: move some bits to struct cx88_core, factor out common ioctl's
to cx88_do_ioctl.
- Get rid of '//' comments, replace them with #if 0 and /**/.
- Minor clean-ups: remove dcprintk and replace all instances of "dev->core"
with "core".
- Added some registers to control PCI controller at CX2388x chips.
- New tuner standby API.
- Small mpeg fixes and cleanups for blackbird.
- fix mpeg packet size & count
- add VIDIOC_QUERYCAP ioctl for the mpeg stream
- return more information in struct v4l2_format
- fix default window height
- small cleanups
Signed-off-by: Uli Luckas <luckas@musoft.de>
Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de>
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Patrick Boettcher <patrick.boettcher@desy.de>
Signed-off-by: Catalin Climov <catalin@climov.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-input.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 96 |
1 files changed, 89 insertions, 7 deletions
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 21488779819..d7980c51478 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-input.c,v 1.15 2005/07/07 13:58:38 mchehab Exp $ | ||
3 | * | 2 | * |
4 | * Device driver for GPIO attached remote control interfaces | 3 | * Device driver for GPIO attached remote control interfaces |
5 | * on Conexant 2388x based TV/DVB cards. | 4 | * on Conexant 2388x based TV/DVB cards. |
@@ -212,6 +211,53 @@ static IR_KEYTAB_TYPE ir_codes_msi_tvanywhere[IR_KEYTAB_SIZE] = { | |||
212 | 211 | ||
213 | /* ---------------------------------------------------------------------- */ | 212 | /* ---------------------------------------------------------------------- */ |
214 | 213 | ||
214 | /* Cinergy 1400 DVB-T */ | ||
215 | static IR_KEYTAB_TYPE ir_codes_cinergy_1400[IR_KEYTAB_SIZE] = { | ||
216 | [0x01] = KEY_POWER, | ||
217 | [0x02] = KEY_1, | ||
218 | [0x03] = KEY_2, | ||
219 | [0x04] = KEY_3, | ||
220 | [0x05] = KEY_4, | ||
221 | [0x06] = KEY_5, | ||
222 | [0x07] = KEY_6, | ||
223 | [0x08] = KEY_7, | ||
224 | [0x09] = KEY_8, | ||
225 | [0x0a] = KEY_9, | ||
226 | [0x0c] = KEY_0, | ||
227 | |||
228 | [0x0b] = KEY_VIDEO, | ||
229 | [0x0d] = KEY_REFRESH, | ||
230 | [0x0e] = KEY_SELECT, | ||
231 | [0x0f] = KEY_EPG, | ||
232 | [0x10] = KEY_UP, | ||
233 | [0x11] = KEY_LEFT, | ||
234 | [0x12] = KEY_OK, | ||
235 | [0x13] = KEY_RIGHT, | ||
236 | [0x14] = KEY_DOWN, | ||
237 | [0x15] = KEY_TEXT, | ||
238 | [0x16] = KEY_INFO, | ||
239 | |||
240 | [0x17] = KEY_RED, | ||
241 | [0x18] = KEY_GREEN, | ||
242 | [0x19] = KEY_YELLOW, | ||
243 | [0x1a] = KEY_BLUE, | ||
244 | |||
245 | [0x1b] = KEY_CHANNELUP, | ||
246 | [0x1c] = KEY_VOLUMEUP, | ||
247 | [0x1d] = KEY_MUTE, | ||
248 | [0x1e] = KEY_VOLUMEDOWN, | ||
249 | [0x1f] = KEY_CHANNELDOWN, | ||
250 | |||
251 | [0x40] = KEY_PAUSE, | ||
252 | [0x4c] = KEY_PLAY, | ||
253 | [0x58] = KEY_RECORD, | ||
254 | [0x54] = KEY_PREVIOUS, | ||
255 | [0x48] = KEY_STOP, | ||
256 | [0x5c] = KEY_NEXT, | ||
257 | }; | ||
258 | |||
259 | /* ---------------------------------------------------------------------- */ | ||
260 | |||
215 | struct cx88_IR { | 261 | struct cx88_IR { |
216 | struct cx88_core *core; | 262 | struct cx88_core *core; |
217 | struct input_dev input; | 263 | struct input_dev input; |
@@ -241,7 +287,7 @@ module_param(ir_debug, int, 0644); /* debug level [IR] */ | |||
241 | MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); | 287 | MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); |
242 | 288 | ||
243 | #define ir_dprintk(fmt, arg...) if (ir_debug) \ | 289 | #define ir_dprintk(fmt, arg...) if (ir_debug) \ |
244 | printk(KERN_DEBUG "%s IR: " fmt , ir->core->name, ## arg) | 290 | printk(KERN_DEBUG "%s IR: " fmt , ir->core->name , ##arg) |
245 | 291 | ||
246 | /* ---------------------------------------------------------------------- */ | 292 | /* ---------------------------------------------------------------------- */ |
247 | 293 | ||
@@ -329,6 +375,11 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
329 | ir->mask_keyup = 0x60; | 375 | ir->mask_keyup = 0x60; |
330 | ir->polling = 50; /* ms */ | 376 | ir->polling = 50; /* ms */ |
331 | break; | 377 | break; |
378 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: | ||
379 | ir_codes = ir_codes_cinergy_1400; | ||
380 | ir_type = IR_TYPE_PD; | ||
381 | ir->sampling = 1; | ||
382 | break; | ||
332 | case CX88_BOARD_HAUPPAUGE: | 383 | case CX88_BOARD_HAUPPAUGE: |
333 | case CX88_BOARD_HAUPPAUGE_DVB_T1: | 384 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
334 | ir_codes = ir_codes_hauppauge_new; | 385 | ir_codes = ir_codes_hauppauge_new; |
@@ -445,7 +496,7 @@ int cx88_ir_fini(struct cx88_core *core) | |||
445 | void cx88_ir_irq(struct cx88_core *core) | 496 | void cx88_ir_irq(struct cx88_core *core) |
446 | { | 497 | { |
447 | struct cx88_IR *ir = core->ir; | 498 | struct cx88_IR *ir = core->ir; |
448 | u32 samples, rc5; | 499 | u32 samples, ircode; |
449 | int i; | 500 | int i; |
450 | 501 | ||
451 | if (NULL == ir) | 502 | if (NULL == ir) |
@@ -477,13 +528,44 @@ void cx88_ir_irq(struct cx88_core *core) | |||
477 | 528 | ||
478 | /* decode it */ | 529 | /* decode it */ |
479 | switch (core->board) { | 530 | switch (core->board) { |
531 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: | ||
532 | ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4); | ||
533 | |||
534 | if (ircode == 0xffffffff) { /* decoding error */ | ||
535 | ir_dprintk("pulse distance decoding error\n"); | ||
536 | break; | ||
537 | } | ||
538 | |||
539 | ir_dprintk("pulse distance decoded: %x\n", ircode); | ||
540 | |||
541 | if (ircode == 0) { /* key still pressed */ | ||
542 | ir_dprintk("pulse distance decoded repeat code\n"); | ||
543 | ir->release = jiffies + msecs_to_jiffies(120); | ||
544 | break; | ||
545 | } | ||
546 | |||
547 | if ((ircode & 0xffff) != 0xeb04) { /* wrong address */ | ||
548 | ir_dprintk("pulse distance decoded wrong address\n"); | ||
549 | break; | ||
550 | } | ||
551 | |||
552 | if (((~ircode >> 24) & 0xff) != ((ircode >> 16) & 0xff)) { /* wrong checksum */ | ||
553 | ir_dprintk("pulse distance decoded wrong check sum\n"); | ||
554 | break; | ||
555 | } | ||
556 | |||
557 | ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0x7f); | ||
558 | |||
559 | ir_input_keydown(&ir->input, &ir->ir, (ircode >> 16) & 0x7f, (ircode >> 16) & 0xff); | ||
560 | ir->release = jiffies + msecs_to_jiffies(120); | ||
561 | break; | ||
480 | case CX88_BOARD_HAUPPAUGE: | 562 | case CX88_BOARD_HAUPPAUGE: |
481 | case CX88_BOARD_HAUPPAUGE_DVB_T1: | 563 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
482 | rc5 = ir_decode_biphase(ir->samples, ir->scount, 5, 7); | 564 | ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); |
483 | ir_dprintk("biphase decoded: %x\n", rc5); | 565 | ir_dprintk("biphase decoded: %x\n", ircode); |
484 | if ((rc5 & 0xfffff000) != 0x3000) | 566 | if ((ircode & 0xfffff000) != 0x3000) |
485 | break; | 567 | break; |
486 | ir_input_keydown(&ir->input, &ir->ir, rc5 & 0x3f, rc5); | 568 | ir_input_keydown(&ir->input, &ir->ir, ircode & 0x3f, ircode); |
487 | ir->release = jiffies + msecs_to_jiffies(120); | 569 | ir->release = jiffies + msecs_to_jiffies(120); |
488 | break; | 570 | break; |
489 | } | 571 | } |