aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--drivers/media/video/ir-kbd-i2c.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 225fee93cfd4..061dda10721b 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -8,6 +8,8 @@
8 * Christoph Bartelmus <lirc@bartelmus.de> 8 * Christoph Bartelmus <lirc@bartelmus.de>
9 * modified for KNC ONE TV Station/Anubis Typhoon TView Tuner by 9 * modified for KNC ONE TV Station/Anubis Typhoon TView Tuner by
10 * Ulrich Mueller <ulrich.mueller42@web.de> 10 * Ulrich Mueller <ulrich.mueller42@web.de>
11 * modified for em2820 based USB TV tuners by
12 * Markus Rechberger <mrechberger@gmail.com>
11 * 13 *
12 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
@@ -40,6 +42,38 @@
40#include <asm/semaphore.h> 42#include <asm/semaphore.h>
41#include <media/ir-common.h> 43#include <media/ir-common.h>
42 44
45static IR_KEYTAB_TYPE ir_codes_em2820[IR_KEYTAB_SIZE] = {
46 [ 0 ] = KEY_CHANNEL,
47 [ 1 ] = KEY_SELECT,
48 [ 2 ] = KEY_MUTE,
49 [ 3 ] = KEY_POWER,
50 [ 4 ] = KEY_KP1,
51 [ 5 ] = KEY_KP2,
52 [ 6 ] = KEY_KP3,
53 [ 7 ] = KEY_CHANNELUP,
54 [ 8 ] = KEY_KP4,
55 [ 9 ] = KEY_KP5,
56 [ 10 ] = KEY_KP6,
57
58 [ 11 ] = KEY_CHANNELDOWN,
59 [ 12 ] = KEY_KP7,
60 [ 13 ] = KEY_KP8,
61 [ 14 ] = KEY_KP9,
62 [ 15 ] = KEY_VOLUMEUP,
63 [ 16 ] = KEY_KP0,
64 [ 17 ] = KEY_MENU,
65 [ 18 ] = KEY_PRINT,
66
67 [ 19 ] = KEY_VOLUMEDOWN,
68 [ 21 ] = KEY_PAUSE,
69 [ 23 ] = KEY_RECORD,
70 [ 24 ] = KEY_REWIND,
71 [ 25 ] = KEY_PLAY,
72 [ 27 ] = KEY_BACKSPACE,
73 [ 29 ] = KEY_STOP,
74 [ 31 ] = KEY_ZOOM,
75};
76
43/* Mark Phalan <phalanm@o2.ie> */ 77/* Mark Phalan <phalanm@o2.ie> */
44static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = { 78static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = {
45 [ 0 ] = KEY_KP0, 79 [ 0 ] = KEY_KP0,
@@ -352,6 +386,13 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
352 ir_type = IR_TYPE_RC5; 386 ir_type = IR_TYPE_RC5;
353 ir_codes = ir_codes_rc5_tv; 387 ir_codes = ir_codes_rc5_tv;
354 break; 388 break;
389 case 0x60:
390 name = "em2820";
391 ir->get_key = get_key_knc1;
392 ir->c.addr = addr>>1;
393 ir_type = IR_TYPE_OTHER;
394 ir_codes = ir_codes_em2820;
395 break;
355 case 0x30: 396 case 0x30:
356 name = "KNC One"; 397 name = "KNC One";
357 ir->get_key = get_key_knc1; 398 ir->get_key = get_key_knc1;
@@ -427,6 +468,7 @@ static int ir_probe(struct i2c_adapter *adap)
427 468
428 static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1}; 469 static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
429 static const int probe_saa7134[] = { 0x7a, -1 }; 470 static const int probe_saa7134[] = { 0x7a, -1 };
471 static const int probe_em2820[] = { 0x60, -1 };
430 const int *probe = NULL; 472 const int *probe = NULL;
431 struct i2c_client c; char buf; int i,rc; 473 struct i2c_client c; char buf; int i,rc;
432 474
@@ -437,6 +479,9 @@ static int ir_probe(struct i2c_adapter *adap)
437 case I2C_HW_SAA7134: 479 case I2C_HW_SAA7134:
438 probe = probe_saa7134; 480 probe = probe_saa7134;
439 break; 481 break;
482 case I2C_HW_B_EM2820:
483 probe = probe_em2820;
484 break;
440 } 485 }
441 if (NULL == probe) 486 if (NULL == probe)
442 return 0; 487 return 0;