diff options
author | Ricardo Cerqueira <v4l@cerqueira.org> | 2006-05-22 06:44:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 01:00:37 -0400 |
commit | 680543c5d2756ad3496f8ef197ba8825b78d6840 (patch) | |
tree | b3ce796bbb5855351194a2850467dd79198483aa /drivers/media | |
parent | d6144028af6b151018c50c160e794a4d7f686333 (diff) |
V4L/DVB (4038): New cx88 card #50: NPG Tech RealTV
Added support for a new cx88 card, including it's remote
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/common/ir-keymaps.c | 44 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 27 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 31 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 1 |
4 files changed, 100 insertions, 3 deletions
diff --git a/drivers/media/common/ir-keymaps.c b/drivers/media/common/ir-keymaps.c index 8f4a067afdb7..b655d8787ca9 100644 --- a/drivers/media/common/ir-keymaps.c +++ b/drivers/media/common/ir-keymaps.c | |||
@@ -1412,3 +1412,47 @@ IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = { | |||
1412 | }; | 1412 | }; |
1413 | 1413 | ||
1414 | EXPORT_SYMBOL_GPL(ir_codes_hauppauge_new); | 1414 | EXPORT_SYMBOL_GPL(ir_codes_hauppauge_new); |
1415 | |||
1416 | IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE] = { | ||
1417 | [ 0x1d ] = KEY_SWITCHVIDEOMODE, /* switch inputs */ | ||
1418 | [ 0x2a ] = KEY_FRONT, | ||
1419 | |||
1420 | [ 0x3e ] = KEY_1, | ||
1421 | [ 0x02 ] = KEY_2, | ||
1422 | [ 0x06 ] = KEY_3, | ||
1423 | [ 0x0a ] = KEY_4, | ||
1424 | [ 0x0e ] = KEY_5, | ||
1425 | [ 0x12 ] = KEY_6, | ||
1426 | [ 0x16 ] = KEY_7, | ||
1427 | [ 0x1a ] = KEY_8, | ||
1428 | [ 0x1e ] = KEY_9, | ||
1429 | [ 0x3a ] = KEY_0, | ||
1430 | [ 0x22 ] = KEY_NUMLOCK, /* -/-- */ | ||
1431 | [ 0x20 ] = KEY_REFRESH, | ||
1432 | |||
1433 | [ 0x03 ] = KEY_BRIGHTNESSDOWN, | ||
1434 | [ 0x28 ] = KEY_AUDIO, | ||
1435 | [ 0x3c ] = KEY_UP, | ||
1436 | [ 0x3f ] = KEY_LEFT, | ||
1437 | [ 0x2e ] = KEY_MUTE, | ||
1438 | [ 0x3b ] = KEY_RIGHT, | ||
1439 | [ 0x00 ] = KEY_DOWN, | ||
1440 | [ 0x07 ] = KEY_BRIGHTNESSUP, | ||
1441 | [ 0x2c ] = KEY_TEXT, | ||
1442 | |||
1443 | [ 0x37 ] = KEY_RECORD, | ||
1444 | [ 0x17 ] = KEY_PLAY, | ||
1445 | [ 0x13 ] = KEY_PAUSE, | ||
1446 | [ 0x26 ] = KEY_STOP, | ||
1447 | [ 0x18 ] = KEY_FASTFORWARD, | ||
1448 | [ 0x14 ] = KEY_REWIND, | ||
1449 | [ 0x33 ] = KEY_ZOOM, | ||
1450 | [ 0x32 ] = KEY_KEYBOARD, | ||
1451 | [ 0x30 ] = KEY_GOTO, /* Pointing arrow */ | ||
1452 | [ 0x36 ] = KEY_MACRO, /* Maximize/Minimize (yellow) */ | ||
1453 | [ 0x0b ] = KEY_RADIO, | ||
1454 | [ 0x10 ] = KEY_POWER, | ||
1455 | |||
1456 | }; | ||
1457 | |||
1458 | EXPORT_SYMBOL_GPL(ir_codes_npgtech); | ||
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 16cd6434f2b1..04ef1ccfb67f 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -1148,6 +1148,29 @@ struct cx88_board cx88_boards[] = { | |||
1148 | }}, | 1148 | }}, |
1149 | .blackbird = 1, | 1149 | .blackbird = 1, |
1150 | }, | 1150 | }, |
1151 | [CX88_BOARD_NPGTECH_REALTV] = { | ||
1152 | .name = "NPG Tech Real TV", | ||
1153 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, | ||
1154 | .radio_type = UNSET, | ||
1155 | .tuner_addr = ADDR_UNSET, | ||
1156 | .radio_addr = ADDR_UNSET, | ||
1157 | .input = {{ | ||
1158 | .type = CX88_VMUX_TELEVISION, | ||
1159 | .vmux = 0, | ||
1160 | .gpio0 = 0x0788, | ||
1161 | },{ | ||
1162 | .type = CX88_VMUX_COMPOSITE1, | ||
1163 | .vmux = 1, | ||
1164 | .gpio0 = 0x078b, | ||
1165 | },{ | ||
1166 | .type = CX88_VMUX_SVIDEO, | ||
1167 | .vmux = 2, | ||
1168 | }}, | ||
1169 | .radio = { | ||
1170 | .type = CX88_RADIO, | ||
1171 | .gpio0 = 0x074a, | ||
1172 | }, | ||
1173 | }, | ||
1151 | }; | 1174 | }; |
1152 | const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); | 1175 | const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); |
1153 | 1176 | ||
@@ -1381,6 +1404,10 @@ struct cx88_subid cx88_subids[] = { | |||
1381 | .subvendor = 0x1554, | 1404 | .subvendor = 0x1554, |
1382 | .subdevice = 0x4813, | 1405 | .subdevice = 0x4813, |
1383 | .card = CX88_BOARD_PIXELVIEW_PLAYTV_P7000, | 1406 | .card = CX88_BOARD_PIXELVIEW_PLAYTV_P7000, |
1407 | },{ | ||
1408 | .subvendor = 0x14f1, | ||
1409 | .subdevice = 0x0842, | ||
1410 | .card = CX88_BOARD_NPGTECH_REALTV, | ||
1384 | }, | 1411 | }, |
1385 | }; | 1412 | }; |
1386 | const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); | 1413 | const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); |
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 78a63b7dd380..4bd86c4fd1b2 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -70,14 +70,33 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); | |||
70 | static void cx88_ir_handle_key(struct cx88_IR *ir) | 70 | static void cx88_ir_handle_key(struct cx88_IR *ir) |
71 | { | 71 | { |
72 | struct cx88_core *core = ir->core; | 72 | struct cx88_core *core = ir->core; |
73 | u32 gpio, data; | 73 | u32 gpio, data, auxgpio; |
74 | 74 | ||
75 | /* read gpio value */ | 75 | /* read gpio value */ |
76 | gpio = cx_read(ir->gpio_addr); | 76 | gpio = cx_read(ir->gpio_addr); |
77 | if (core->board == CX88_BOARD_NPGTECH_REALTV) { | ||
78 | /* This board apparently uses a combination of 2 GPIO | ||
79 | to represent the keys. Additionally, the second GPIO | ||
80 | can be used for parity. | ||
81 | |||
82 | Example: | ||
83 | |||
84 | for key "5" | ||
85 | gpio = 0x758, auxgpio = 0xe5 or 0xf5 | ||
86 | for key "Power" | ||
87 | gpio = 0x758, auxgpio = 0xed or 0xfd | ||
88 | */ | ||
89 | |||
90 | auxgpio = cx_read(MO_GP1_IO); | ||
91 | /* Take out the parity part */ | ||
92 | gpio+=(auxgpio & 0xef); | ||
93 | } else | ||
94 | auxgpio = gpio; | ||
95 | |||
77 | if (ir->polling) { | 96 | if (ir->polling) { |
78 | if (ir->last_gpio == gpio) | 97 | if (ir->last_gpio == auxgpio) |
79 | return; | 98 | return; |
80 | ir->last_gpio = gpio; | 99 | ir->last_gpio = auxgpio; |
81 | } | 100 | } |
82 | 101 | ||
83 | /* extract data */ | 102 | /* extract data */ |
@@ -228,6 +247,12 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
228 | ir_type = IR_TYPE_PD; | 247 | ir_type = IR_TYPE_PD; |
229 | ir->sampling = 0xff00; /* address */ | 248 | ir->sampling = 0xff00; /* address */ |
230 | break; | 249 | break; |
250 | case CX88_BOARD_NPGTECH_REALTV: | ||
251 | ir_codes = ir_codes_npgtech; | ||
252 | ir->gpio_addr = MO_GP0_IO; | ||
253 | ir->mask_keycode = 0xfa; | ||
254 | ir->polling = 50; /* ms */ | ||
255 | break; | ||
231 | } | 256 | } |
232 | 257 | ||
233 | if (NULL == ir_codes) { | 258 | if (NULL == ir_codes) { |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 663def46f67c..5df6e41852bd 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -192,6 +192,7 @@ extern struct sram_channel cx88_sram_channels[]; | |||
192 | #define CX88_BOARD_PCHDTV_HD5500 47 | 192 | #define CX88_BOARD_PCHDTV_HD5500 47 |
193 | #define CX88_BOARD_KWORLD_MCE200_DELUXE 48 | 193 | #define CX88_BOARD_KWORLD_MCE200_DELUXE 48 |
194 | #define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49 | 194 | #define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49 |
195 | #define CX88_BOARD_NPGTECH_REALTV 50 | ||
195 | 196 | ||
196 | enum cx88_itype { | 197 | enum cx88_itype { |
197 | CX88_VMUX_COMPOSITE1 = 1, | 198 | CX88_VMUX_COMPOSITE1 = 1, |