diff options
author | Markus Rechberger <mrechberger@gmail.com> | 2005-11-09 00:37:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:19 -0500 |
commit | e43f14af143921ac6680aa3ddfff111bef4e034a (patch) | |
tree | 9b83b7070ecb3faeef8ef4515bcac61b071ff380 /drivers/media/video/em28xx/em28xx-input.c | |
parent | 340622c5a9028d70b1238ecafb463125277a30eb (diff) |
[PATCH] v4l: 790: added support for terratec cinergy 250 usb
- Added support for Terratec Cinergy 250 USB
Signed-off-by: Markus Rechberger <mrechberger@gmail.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/em28xx/em28xx-input.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-input.c | 94 |
1 files changed, 62 insertions, 32 deletions
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index d6b3e15a0350..3800b99e4b86 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c | |||
@@ -42,40 +42,68 @@ MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]"); | |||
42 | 42 | ||
43 | /* ---------------------------------------------------------------------- */ | 43 | /* ---------------------------------------------------------------------- */ |
44 | 44 | ||
45 | static IR_KEYTAB_TYPE ir_codes_em_pinnacle[IR_KEYTAB_SIZE] = { | 45 | static IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE] = { |
46 | [ 0 ] = KEY_CHANNEL, | 46 | [ 0x01 ] = KEY_CHANNEL, |
47 | [ 1 ] = KEY_SELECT, | 47 | [ 0x02 ] = KEY_SELECT, |
48 | [ 2 ] = KEY_MUTE, | 48 | [ 0x03 ] = KEY_MUTE, |
49 | [ 3 ] = KEY_POWER, | 49 | [ 0x04 ] = KEY_POWER, |
50 | [ 4 ] = KEY_KP1, | 50 | [ 0x05 ] = KEY_KP1, |
51 | [ 5 ] = KEY_KP2, | 51 | [ 0x06 ] = KEY_KP2, |
52 | [ 6 ] = KEY_KP3, | 52 | [ 0x07 ] = KEY_KP3, |
53 | [ 7 ] = KEY_CHANNELUP, | 53 | [ 0x08 ] = KEY_CHANNELUP, |
54 | [ 8 ] = KEY_KP4, | 54 | [ 0x09 ] = KEY_KP4, |
55 | [ 9 ] = KEY_KP5, | 55 | [ 0x0a ] = KEY_KP5, |
56 | [ 10 ] = KEY_KP6, | 56 | [ 0x0b ] = KEY_KP6, |
57 | 57 | [ 0x0c ] = KEY_CHANNELDOWN, | |
58 | [ 11 ] = KEY_CHANNELDOWN, | 58 | [ 0x0d ] = KEY_KP7, |
59 | [ 12 ] = KEY_KP7, | 59 | [ 0x0e ] = KEY_KP8, |
60 | [ 13 ] = KEY_KP8, | 60 | [ 0x0f ] = KEY_KP9, |
61 | [ 14 ] = KEY_KP9, | 61 | [ 0x10 ] = KEY_VOLUMEUP, |
62 | [ 15 ] = KEY_VOLUMEUP, | 62 | [ 0x11 ] = KEY_KP0, |
63 | [ 16 ] = KEY_KP0, | 63 | [ 0x12 ] = KEY_MENU, |
64 | [ 17 ] = KEY_MENU, | 64 | [ 0x13 ] = KEY_PRINT, |
65 | [ 18 ] = KEY_PRINT, | 65 | [ 0x14 ] = KEY_VOLUMEDOWN, |
66 | 66 | [ 0x16 ] = KEY_PAUSE, | |
67 | [ 19 ] = KEY_VOLUMEDOWN, | 67 | [ 0x18 ] = KEY_RECORD, |
68 | [ 21 ] = KEY_PAUSE, | 68 | [ 0x19 ] = KEY_REWIND, |
69 | [ 23 ] = KEY_RECORD, | 69 | [ 0x1a ] = KEY_PLAY, |
70 | [ 24 ] = KEY_REWIND, | 70 | [ 0x1b ] = KEY_FORWARD, |
71 | [ 25 ] = KEY_PLAY, | 71 | [ 0x1c ] = KEY_BACKSPACE, |
72 | [ 27 ] = KEY_BACKSPACE, | 72 | [ 0x1e ] = KEY_STOP, |
73 | [ 29 ] = KEY_STOP, | 73 | [ 0x40 ] = KEY_ZOOM, |
74 | [ 31 ] = KEY_ZOOM, | ||
75 | }; | 74 | }; |
76 | 75 | ||
77 | /* ----------------------------------------------------------------------- */ | 76 | /* ----------------------------------------------------------------------- */ |
78 | 77 | ||
78 | static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | ||
79 | { | ||
80 | unsigned char b; | ||
81 | |||
82 | /* poll IR chip */ | ||
83 | if (1 != i2c_master_recv(&ir->c,&b,1)) { | ||
84 | dprintk("read error\n"); | ||
85 | return -EIO; | ||
86 | } | ||
87 | |||
88 | /* it seems that 0xFE indicates that a button is still hold | ||
89 | down, while 0xFF indicates that no button is hold | ||
90 | down. 0xFE sequences are sometimes interrupted by 0xFF */ | ||
91 | |||
92 | dprintk("key %02x\n", b); | ||
93 | |||
94 | if (b == 0xFF) | ||
95 | return 0; | ||
96 | |||
97 | if (b == 0xFE) | ||
98 | /* keep old data */ | ||
99 | return 1; | ||
100 | |||
101 | *ir_key = b; | ||
102 | *ir_raw = b; | ||
103 | return 1; | ||
104 | } | ||
105 | |||
106 | |||
79 | static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | 107 | static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) |
80 | { | 108 | { |
81 | unsigned char buf[2]; | 109 | unsigned char buf[2]; |
@@ -123,14 +151,16 @@ void em2820_set_ir(struct em2820 * dev,struct IR_i2c *ir) | |||
123 | case (EM2820_BOARD_UNKNOWN): | 151 | case (EM2820_BOARD_UNKNOWN): |
124 | break; | 152 | break; |
125 | case (EM2820_BOARD_TERRATEC_CINERGY_250): | 153 | case (EM2820_BOARD_TERRATEC_CINERGY_250): |
154 | ir->ir_codes = ir_codes_em_terratec; | ||
155 | ir->get_key = get_key_terratec; | ||
156 | snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM2820 Terratec)"); | ||
126 | break; | 157 | break; |
127 | case (EM2820_BOARD_PINNACLE_USB_2): | 158 | case (EM2820_BOARD_PINNACLE_USB_2): |
128 | ir->ir_codes = ir_codes_em_pinnacle; | ||
129 | break; | 159 | break; |
130 | case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): | 160 | case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): |
131 | ir->ir_codes = ir_codes_hauppauge_new; | 161 | ir->ir_codes = ir_codes_hauppauge_new; |
132 | ir->get_key = get_key_em_haup; | 162 | ir->get_key = get_key_em_haup; |
133 | snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM2840 Hauppage)"); | 163 | snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM2840 Hauppauge)"); |
134 | break; | 164 | break; |
135 | case (EM2820_BOARD_MSI_VOX_USB_2): | 165 | case (EM2820_BOARD_MSI_VOX_USB_2): |
136 | break; | 166 | break; |