aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Rechberger <mrechberger@gmail.com>2006-01-15 18:04:27 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-15 18:28:37 -0500
commit366cc64b0d9ac922ac4f0f54e06c13ec95249928 (patch)
tree4e861ce8523559c83f738108bb1e928ef3245665
parent17c37efbb5163e5df118510c7b4243b7d3b32ce2 (diff)
V4L/DVB (3390): Added remote control support for pinnacle pctv
- Added remote control support for pinnacle pctv Signed-off-by: Markus Rechberger <mrechberger@gmail.com> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 9b94f77d6fd7..30dfa5370c73 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -76,6 +76,58 @@ static IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE] = {
76 [ 0x40 ] = KEY_ZOOM, 76 [ 0x40 ] = KEY_ZOOM,
77}; 77};
78 78
79static IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE] = {
80 [ 0x3a ] = KEY_KP0,
81 [ 0x31 ] = KEY_KP1,
82 [ 0x32 ] = KEY_KP2,
83 [ 0x33 ] = KEY_KP3,
84 [ 0x34 ] = KEY_KP4,
85 [ 0x35 ] = KEY_KP5,
86 [ 0x36 ] = KEY_KP6,
87 [ 0x37 ] = KEY_KP7,
88 [ 0x38 ] = KEY_KP8,
89 [ 0x39 ] = KEY_KP9,
90
91 [ 0x2f ] = KEY_POWER,
92
93 [ 0x2e ] = KEY_P,
94 [ 0x1f ] = KEY_L,
95 [ 0x2b ] = KEY_I,
96
97 [ 0x2d ] = KEY_ZOOM,
98 [ 0x1e ] = KEY_ZOOM,
99 [ 0x1b ] = KEY_VOLUMEUP,
100 [ 0x0f ] = KEY_VOLUMEDOWN,
101 [ 0x17 ] = KEY_CHANNELUP,
102 [ 0x1c ] = KEY_CHANNELDOWN,
103 [ 0x25 ] = KEY_INFO,
104
105 [ 0x3c ] = KEY_MUTE,
106
107 [ 0x3d ] = KEY_LEFT,
108 [ 0x3b ] = KEY_RIGHT,
109
110 [ 0x3f ] = KEY_UP,
111 [ 0x3e ] = KEY_DOWN,
112 [ 0x1a ] = KEY_PAUSE,
113
114 [ 0x1d ] = KEY_MENU,
115 [ 0x19 ] = KEY_PLAY,
116 [ 0x16 ] = KEY_REWIND,
117 [ 0x13 ] = KEY_FORWARD,
118 [ 0x15 ] = KEY_PAUSE,
119 [ 0x0e ] = KEY_REWIND,
120 [ 0x0d ] = KEY_PLAY,
121 [ 0x0b ] = KEY_STOP,
122 [ 0x07 ] = KEY_FORWARD,
123 [ 0x27 ] = KEY_RECORD,
124 [ 0x26 ] = KEY_TUNER,
125 [ 0x29 ] = KEY_TEXT,
126 [ 0x2a ] = KEY_MEDIA,
127 [ 0x18 ] = KEY_EPG,
128 [ 0x27 ] = KEY_RECORD,
129};
130
79/* ----------------------------------------------------------------------- */ 131/* ----------------------------------------------------------------------- */
80 132
81static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 133static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
@@ -138,6 +190,28 @@ static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
138 return 1; 190 return 1;
139} 191}
140 192
193static int get_key_pinnacle_usb(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
194{
195 unsigned char buf[3];
196
197 /* poll IR chip */
198
199 if (3 != i2c_master_recv(&ir->c,buf,3)) {
200 dprintk("read error\n");
201 return -EIO;
202 }
203
204 dprintk("key %02x\n", buf[2]&0x3f);
205 if (buf[0]!=0x00){
206 return 0;
207 }
208
209 *ir_key = buf[2]&0x3f;
210 *ir_raw = buf[2]&0x3f;
211
212 return 1;
213}
214
141/* ----------------------------------------------------------------------- */ 215/* ----------------------------------------------------------------------- */
142void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir) 216void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir)
143{ 217{
@@ -159,6 +233,9 @@ void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir)
159 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Terratec)"); 233 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Terratec)");
160 break; 234 break;
161 case (EM2820_BOARD_PINNACLE_USB_2): 235 case (EM2820_BOARD_PINNACLE_USB_2):
236 ir->ir_codes = ir_codes_em_pinnacle_usb;
237 ir->get_key = get_key_pinnacle_usb;
238 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Pinnacle PCTV)");
162 break; 239 break;
163 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): 240 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
164 ir->ir_codes = ir_codes_hauppauge_new; 241 ir->ir_codes = ir_codes_hauppauge_new;