aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/IR/Makefile2
-rw-r--r--drivers/media/IR/ir-sysfs.c4
-rw-r--r--drivers/media/IR/rc-map.c27
-rw-r--r--drivers/media/dvb/dm1105/dm1105.c4
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c10
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c28
-rw-r--r--drivers/media/video/cx18/cx18-i2c.c2
-rw-r--r--drivers/media/video/cx23885/cx23885-input.c6
-rw-r--r--drivers/media/video/cx88/cx88-input.c42
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c34
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c6
-rw-r--r--drivers/media/video/em28xx/em28xx.h2
-rw-r--r--drivers/media/video/ir-kbd-i2c.c22
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c81
15 files changed, 145 insertions, 131 deletions
diff --git a/drivers/media/IR/Makefile b/drivers/media/IR/Makefile
index 3a4f590d0bbb..3d8dd306df46 100644
--- a/drivers/media/IR/Makefile
+++ b/drivers/media/IR/Makefile
@@ -1,6 +1,8 @@
1ir-common-objs := ir-functions.o ir-keymaps.o 1ir-common-objs := ir-functions.o ir-keymaps.o
2ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o 2ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o
3 3
4obj-y += keymaps/
5
4obj-$(CONFIG_IR_CORE) += ir-core.o 6obj-$(CONFIG_IR_CORE) += ir-core.o
5obj-$(CONFIG_VIDEO_IR) += ir-common.o 7obj-$(CONFIG_VIDEO_IR) += ir-common.o
6obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o 8obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o
diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c
index 36dfe51aad92..58ecca2003a4 100644
--- a/drivers/media/IR/ir-sysfs.c
+++ b/drivers/media/IR/ir-sysfs.c
@@ -251,8 +251,10 @@ static int __init ir_core_init(void)
251 return rc; 251 return rc;
252 } 252 }
253 253
254 /* Initialize/load the decoders that will be used */ 254 /* Initialize/load the decoders/keymap code that will be used */
255 ir_raw_init(); 255 ir_raw_init();
256 rc_map_init();
257
256 258
257 return 0; 259 return 0;
258} 260}
diff --git a/drivers/media/IR/rc-map.c b/drivers/media/IR/rc-map.c
index 02c72f086fe0..2f6201ce1898 100644
--- a/drivers/media/IR/rc-map.c
+++ b/drivers/media/IR/rc-map.c
@@ -26,12 +26,14 @@ static struct rc_keymap *seek_rc_map(const char *name)
26 26
27 spin_lock(&rc_map_lock); 27 spin_lock(&rc_map_lock);
28 list_for_each_entry(map, &rc_map_list, list) { 28 list_for_each_entry(map, &rc_map_list, list) {
29 if (!strcmp(name, map->map.name)) 29 if (!strcmp(name, map->map.name)) {
30 break; 30 spin_unlock(&rc_map_lock);
31 return map;
32 }
31 } 33 }
32 spin_unlock(&rc_map_lock); 34 spin_unlock(&rc_map_lock);
33 35
34 return map; 36 return NULL;
35} 37}
36 38
37struct ir_scancode_table *get_rc_map(const char *name) 39struct ir_scancode_table *get_rc_map(const char *name)
@@ -43,15 +45,22 @@ struct ir_scancode_table *get_rc_map(const char *name)
43 map = seek_rc_map(name); 45 map = seek_rc_map(name);
44#ifdef MODULE 46#ifdef MODULE
45 if (!map) { 47 if (!map) {
46 rc = request_module("name"); 48 rc = request_module(name);
47 if (rc < 0) 49 if (rc < 0) {
50 printk(KERN_ERR "Couldn't load IR keymap %s\n", name);
48 return NULL; 51 return NULL;
52 }
53 msleep(20); /* Give some time for IR to register */
49 54
50 map = seek_rc_map(name); 55 map = seek_rc_map(name);
51 } 56 }
52#endif 57#endif
53 if (!map) 58 if (!map) {
59 printk(KERN_ERR "IR keymap %s not found\n", name);
54 return NULL; 60 return NULL;
61 }
62
63 printk(KERN_INFO "Registered IR keymap %s\n", map->map.name);
55 64
56 return &map->map; 65 return &map->map;
57} 66}
@@ -73,3 +82,9 @@ void ir_unregister_map(struct rc_keymap *map)
73 spin_unlock(&rc_map_lock); 82 spin_unlock(&rc_map_lock);
74} 83}
75EXPORT_SYMBOL_GPL(ir_unregister_map); 84EXPORT_SYMBOL_GPL(ir_unregister_map);
85
86void rc_map_init(void)
87{
88 spin_lock_init(&rc_map_lock);
89
90}
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c
index 416c29bf78d9..9d389bdaca41 100644
--- a/drivers/media/dvb/dm1105/dm1105.c
+++ b/drivers/media/dvb/dm1105/dm1105.c
@@ -596,7 +596,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
596int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) 596int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
597{ 597{
598 struct input_dev *input_dev; 598 struct input_dev *input_dev;
599 struct ir_scancode_table *ir_codes = &IR_KEYTABLE(dm1105_nec); 599 char *ir_codes = NULL;
600 u64 ir_type = IR_TYPE_OTHER; 600 u64 ir_type = IR_TYPE_OTHER;
601 int err = -ENOMEM; 601 int err = -ENOMEM;
602 602
@@ -630,7 +630,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
630 630
631 INIT_WORK(&dm1105->ir.work, dm1105_emit_key); 631 INIT_WORK(&dm1105->ir.work, dm1105_emit_key);
632 632
633 err = __ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); 633 err = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME);
634 634
635 return err; 635 return err;
636} 636}
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index ab7479ad592f..be2074995a0d 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -192,7 +192,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
192 struct saa7146_dev *saa = budget_ci->budget.dev; 192 struct saa7146_dev *saa = budget_ci->budget.dev;
193 struct input_dev *input_dev = budget_ci->ir.dev; 193 struct input_dev *input_dev = budget_ci->ir.dev;
194 int error; 194 int error;
195 struct ir_scancode_table *ir_codes; 195 char *ir_codes = NULL;
196 196
197 197
198 budget_ci->ir.dev = input_dev = input_allocate_device(); 198 budget_ci->ir.dev = input_dev = input_allocate_device();
@@ -232,7 +232,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
232 case 0x1011: 232 case 0x1011:
233 case 0x1012: 233 case 0x1012:
234 /* The hauppauge keymap is a superset of these remotes */ 234 /* The hauppauge keymap is a superset of these remotes */
235 ir_codes = &IR_KEYTABLE(hauppauge_new); 235 ir_codes = RC_MAP_HAUPPAUGE_NEW;
236 236
237 if (rc5_device < 0) 237 if (rc5_device < 0)
238 budget_ci->ir.rc5_device = 0x1f; 238 budget_ci->ir.rc5_device = 0x1f;
@@ -241,11 +241,11 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
241 case 0x1017: 241 case 0x1017:
242 case 0x101a: 242 case 0x101a:
243 /* for the Technotrend 1500 bundled remote */ 243 /* for the Technotrend 1500 bundled remote */
244 ir_codes = &IR_KEYTABLE(tt_1500); 244 ir_codes = RC_MAP_TT_1500;
245 break; 245 break;
246 default: 246 default:
247 /* unknown remote */ 247 /* unknown remote */
248 ir_codes = &IR_KEYTABLE(budget_ci_old); 248 ir_codes = RC_MAP_BUDGET_CI_OLD;
249 break; 249 break;
250 } 250 }
251 251
@@ -256,7 +256,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
256 budget_ci->ir.timer_keyup.function = msp430_ir_keyup; 256 budget_ci->ir.timer_keyup.function = msp430_ir_keyup;
257 budget_ci->ir.timer_keyup.data = (unsigned long) &budget_ci->ir; 257 budget_ci->ir.timer_keyup.data = (unsigned long) &budget_ci->ir;
258 budget_ci->ir.last_raw = 0xffff; /* An impossible value */ 258 budget_ci->ir.last_raw = 0xffff; /* An impossible value */
259 error = __ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); 259 error = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME);
260 if (error) { 260 if (error) {
261 printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error); 261 printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error);
262 return error; 262 return error;
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 71a0047ca7b2..f68717a4bdec 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -248,7 +248,7 @@ static void bttv_ir_stop(struct bttv *btv)
248int bttv_input_init(struct bttv *btv) 248int bttv_input_init(struct bttv *btv)
249{ 249{
250 struct card_ir *ir; 250 struct card_ir *ir;
251 struct ir_scancode_table *ir_codes = NULL; 251 char *ir_codes = NULL;
252 struct input_dev *input_dev; 252 struct input_dev *input_dev;
253 u64 ir_type = IR_TYPE_OTHER; 253 u64 ir_type = IR_TYPE_OTHER;
254 int err = -ENOMEM; 254 int err = -ENOMEM;
@@ -266,7 +266,7 @@ int bttv_input_init(struct bttv *btv)
266 case BTTV_BOARD_AVERMEDIA: 266 case BTTV_BOARD_AVERMEDIA:
267 case BTTV_BOARD_AVPHONE98: 267 case BTTV_BOARD_AVPHONE98:
268 case BTTV_BOARD_AVERMEDIA98: 268 case BTTV_BOARD_AVERMEDIA98:
269 ir_codes = &IR_KEYTABLE(avermedia); 269 ir_codes = RC_MAP_AVERMEDIA;
270 ir->mask_keycode = 0xf88000; 270 ir->mask_keycode = 0xf88000;
271 ir->mask_keydown = 0x010000; 271 ir->mask_keydown = 0x010000;
272 ir->polling = 50; // ms 272 ir->polling = 50; // ms
@@ -274,14 +274,14 @@ int bttv_input_init(struct bttv *btv)
274 274
275 case BTTV_BOARD_AVDVBT_761: 275 case BTTV_BOARD_AVDVBT_761:
276 case BTTV_BOARD_AVDVBT_771: 276 case BTTV_BOARD_AVDVBT_771:
277 ir_codes = &IR_KEYTABLE(avermedia_dvbt); 277 ir_codes = RC_MAP_AVERMEDIA_DVBT;
278 ir->mask_keycode = 0x0f00c0; 278 ir->mask_keycode = 0x0f00c0;
279 ir->mask_keydown = 0x000020; 279 ir->mask_keydown = 0x000020;
280 ir->polling = 50; // ms 280 ir->polling = 50; // ms
281 break; 281 break;
282 282
283 case BTTV_BOARD_PXELVWPLTVPAK: 283 case BTTV_BOARD_PXELVWPLTVPAK:
284 ir_codes = &IR_KEYTABLE(pixelview); 284 ir_codes = RC_MAP_PIXELVIEW;
285 ir->mask_keycode = 0x003e00; 285 ir->mask_keycode = 0x003e00;
286 ir->mask_keyup = 0x010000; 286 ir->mask_keyup = 0x010000;
287 ir->polling = 50; // ms 287 ir->polling = 50; // ms
@@ -289,24 +289,24 @@ int bttv_input_init(struct bttv *btv)
289 case BTTV_BOARD_PV_M4900: 289 case BTTV_BOARD_PV_M4900:
290 case BTTV_BOARD_PV_BT878P_9B: 290 case BTTV_BOARD_PV_BT878P_9B:
291 case BTTV_BOARD_PV_BT878P_PLUS: 291 case BTTV_BOARD_PV_BT878P_PLUS:
292 ir_codes = &IR_KEYTABLE(pixelview); 292 ir_codes = RC_MAP_PIXELVIEW;
293 ir->mask_keycode = 0x001f00; 293 ir->mask_keycode = 0x001f00;
294 ir->mask_keyup = 0x008000; 294 ir->mask_keyup = 0x008000;
295 ir->polling = 50; // ms 295 ir->polling = 50; // ms
296 break; 296 break;
297 297
298 case BTTV_BOARD_WINFAST2000: 298 case BTTV_BOARD_WINFAST2000:
299 ir_codes = &IR_KEYTABLE(winfast); 299 ir_codes = RC_MAP_WINFAST;
300 ir->mask_keycode = 0x1f8; 300 ir->mask_keycode = 0x1f8;
301 break; 301 break;
302 case BTTV_BOARD_MAGICTVIEW061: 302 case BTTV_BOARD_MAGICTVIEW061:
303 case BTTV_BOARD_MAGICTVIEW063: 303 case BTTV_BOARD_MAGICTVIEW063:
304 ir_codes = &IR_KEYTABLE(winfast); 304 ir_codes = RC_MAP_WINFAST;
305 ir->mask_keycode = 0x0008e000; 305 ir->mask_keycode = 0x0008e000;
306 ir->mask_keydown = 0x00200000; 306 ir->mask_keydown = 0x00200000;
307 break; 307 break;
308 case BTTV_BOARD_APAC_VIEWCOMP: 308 case BTTV_BOARD_APAC_VIEWCOMP:
309 ir_codes = &IR_KEYTABLE(apac_viewcomp); 309 ir_codes = RC_MAP_APAC_VIEWCOMP;
310 ir->mask_keycode = 0x001f00; 310 ir->mask_keycode = 0x001f00;
311 ir->mask_keyup = 0x008000; 311 ir->mask_keyup = 0x008000;
312 ir->polling = 50; // ms 312 ir->polling = 50; // ms
@@ -314,30 +314,30 @@ int bttv_input_init(struct bttv *btv)
314 case BTTV_BOARD_ASKEY_CPH03X: 314 case BTTV_BOARD_ASKEY_CPH03X:
315 case BTTV_BOARD_CONCEPTRONIC_CTVFMI2: 315 case BTTV_BOARD_CONCEPTRONIC_CTVFMI2:
316 case BTTV_BOARD_CONTVFMI: 316 case BTTV_BOARD_CONTVFMI:
317 ir_codes = &IR_KEYTABLE(pixelview); 317 ir_codes = RC_MAP_PIXELVIEW;
318 ir->mask_keycode = 0x001F00; 318 ir->mask_keycode = 0x001F00;
319 ir->mask_keyup = 0x006000; 319 ir->mask_keyup = 0x006000;
320 ir->polling = 50; // ms 320 ir->polling = 50; // ms
321 break; 321 break;
322 case BTTV_BOARD_NEBULA_DIGITV: 322 case BTTV_BOARD_NEBULA_DIGITV:
323 ir_codes = &IR_KEYTABLE(nebula); 323 ir_codes = RC_MAP_NEBULA;
324 btv->custom_irq = bttv_rc5_irq; 324 btv->custom_irq = bttv_rc5_irq;
325 ir->rc5_gpio = 1; 325 ir->rc5_gpio = 1;
326 break; 326 break;
327 case BTTV_BOARD_MACHTV_MAGICTV: 327 case BTTV_BOARD_MACHTV_MAGICTV:
328 ir_codes = &IR_KEYTABLE(apac_viewcomp); 328 ir_codes = RC_MAP_APAC_VIEWCOMP;
329 ir->mask_keycode = 0x001F00; 329 ir->mask_keycode = 0x001F00;
330 ir->mask_keyup = 0x004000; 330 ir->mask_keyup = 0x004000;
331 ir->polling = 50; /* ms */ 331 ir->polling = 50; /* ms */
332 break; 332 break;
333 case BTTV_BOARD_KOZUMI_KTV_01C: 333 case BTTV_BOARD_KOZUMI_KTV_01C:
334 ir_codes = &IR_KEYTABLE(pctv_sedna); 334 ir_codes = RC_MAP_PCTV_SEDNA;
335 ir->mask_keycode = 0x001f00; 335 ir->mask_keycode = 0x001f00;
336 ir->mask_keyup = 0x006000; 336 ir->mask_keyup = 0x006000;
337 ir->polling = 50; /* ms */ 337 ir->polling = 50; /* ms */
338 break; 338 break;
339 case BTTV_BOARD_ENLTV_FM_2: 339 case BTTV_BOARD_ENLTV_FM_2:
340 ir_codes = &IR_KEYTABLE(encore_enltv2); 340 ir_codes = RC_MAP_ENCORE_ENLTV2;
341 ir->mask_keycode = 0x00fd00; 341 ir->mask_keycode = 0x00fd00;
342 ir->mask_keyup = 0x000080; 342 ir->mask_keyup = 0x000080;
343 ir->polling = 1; /* ms */ 343 ir->polling = 1; /* ms */
@@ -392,7 +392,7 @@ int bttv_input_init(struct bttv *btv)
392 bttv_ir_start(btv, ir); 392 bttv_ir_start(btv, ir);
393 393
394 /* all done */ 394 /* all done */
395 err = __ir_input_register(btv->remote->dev, ir_codes, NULL, MODULE_NAME); 395 err = ir_input_register(btv->remote->dev, ir_codes, NULL, MODULE_NAME);
396 if (err) 396 if (err)
397 goto err_out_stop; 397 goto err_out_stop;
398 398
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index 476c016e63a8..cfa1f289b0f5 100644
--- a/drivers/media/video/cx18/cx18-i2c.c
+++ b/drivers/media/video/cx18/cx18-i2c.c
@@ -109,7 +109,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,
109 /* Our default information for ir-kbd-i2c.c to use */ 109 /* Our default information for ir-kbd-i2c.c to use */
110 switch (hw) { 110 switch (hw) {
111 case CX18_HW_Z8F0811_IR_RX_HAUP: 111 case CX18_HW_Z8F0811_IR_RX_HAUP:
112 init_data->ir_codes = &IR_KEYTABLE(hauppauge_new); 112 init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
113 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 113 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
114 init_data->type = IR_TYPE_RC5; 114 init_data->type = IR_TYPE_RC5;
115 init_data->name = cx->card_name; 115 init_data->name = cx->card_name;
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index cef36f6b93e3..8d306d8bb61c 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -340,7 +340,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
340{ 340{
341 struct card_ir *ir; 341 struct card_ir *ir;
342 struct input_dev *input_dev; 342 struct input_dev *input_dev;
343 struct ir_scancode_table *ir_codes = NULL; 343 char *ir_codes = NULL;
344 int ir_type, ir_addr, ir_start; 344 int ir_type, ir_addr, ir_start;
345 int ret; 345 int ret;
346 346
@@ -355,7 +355,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
355 case CX23885_BOARD_HAUPPAUGE_HVR1850: 355 case CX23885_BOARD_HAUPPAUGE_HVR1850:
356 case CX23885_BOARD_HAUPPAUGE_HVR1290: 356 case CX23885_BOARD_HAUPPAUGE_HVR1290:
357 /* Parameters for the grey Hauppauge remote for the HVR-1850 */ 357 /* Parameters for the grey Hauppauge remote for the HVR-1850 */
358 ir_codes = &IR_KEYTABLE(hauppauge_new); 358 ir_codes = RC_MAP_HAUPPAUGE_NEW;
359 ir_type = IR_TYPE_RC5; 359 ir_type = IR_TYPE_RC5;
360 ir_addr = 0x1e; /* RC-5 system bits emitted by the remote */ 360 ir_addr = 0x1e; /* RC-5 system bits emitted by the remote */
361 ir_start = RC5_START_BITS_NORMAL; /* A basic RC-5 remote */ 361 ir_start = RC5_START_BITS_NORMAL; /* A basic RC-5 remote */
@@ -400,7 +400,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
400 dev->ir_input = ir; 400 dev->ir_input = ir;
401 cx23885_input_ir_start(dev); 401 cx23885_input_ir_start(dev);
402 402
403 ret = __ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME); 403 ret = ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME);
404 if (ret) 404 if (ret)
405 goto err_out_stop; 405 goto err_out_stop;
406 406
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 30af956a9eaa..6efad1da65bf 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -245,7 +245,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
245{ 245{
246 struct cx88_IR *ir; 246 struct cx88_IR *ir;
247 struct input_dev *input_dev; 247 struct input_dev *input_dev;
248 struct ir_scancode_table *ir_codes = NULL; 248 char *ir_codes = NULL;
249 u64 ir_type = IR_TYPE_OTHER; 249 u64 ir_type = IR_TYPE_OTHER;
250 int err = -ENOMEM; 250 int err = -ENOMEM;
251 251
@@ -261,14 +261,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
261 case CX88_BOARD_DNTV_LIVE_DVB_T: 261 case CX88_BOARD_DNTV_LIVE_DVB_T:
262 case CX88_BOARD_KWORLD_DVB_T: 262 case CX88_BOARD_KWORLD_DVB_T:
263 case CX88_BOARD_KWORLD_DVB_T_CX22702: 263 case CX88_BOARD_KWORLD_DVB_T_CX22702:
264 ir_codes = &IR_KEYTABLE(dntv_live_dvb_t); 264 ir_codes = RC_MAP_DNTV_LIVE_DVB_T;
265 ir->gpio_addr = MO_GP1_IO; 265 ir->gpio_addr = MO_GP1_IO;
266 ir->mask_keycode = 0x1f; 266 ir->mask_keycode = 0x1f;
267 ir->mask_keyup = 0x60; 267 ir->mask_keyup = 0x60;
268 ir->polling = 50; /* ms */ 268 ir->polling = 50; /* ms */
269 break; 269 break;
270 case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: 270 case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
271 ir_codes = &IR_KEYTABLE(cinergy_1400); 271 ir_codes = RC_MAP_CINERGY_1400;
272 ir_type = IR_TYPE_PD; 272 ir_type = IR_TYPE_PD;
273 ir->sampling = 0xeb04; /* address */ 273 ir->sampling = 0xeb04; /* address */
274 break; 274 break;
@@ -283,14 +283,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
283 case CX88_BOARD_PCHDTV_HD3000: 283 case CX88_BOARD_PCHDTV_HD3000:
284 case CX88_BOARD_PCHDTV_HD5500: 284 case CX88_BOARD_PCHDTV_HD5500:
285 case CX88_BOARD_HAUPPAUGE_IRONLY: 285 case CX88_BOARD_HAUPPAUGE_IRONLY:
286 ir_codes = &IR_KEYTABLE(hauppauge_new); 286 ir_codes = RC_MAP_HAUPPAUGE_NEW;
287 ir_type = IR_TYPE_RC5; 287 ir_type = IR_TYPE_RC5;
288 ir->sampling = 1; 288 ir->sampling = 1;
289 break; 289 break;
290 case CX88_BOARD_WINFAST_DTV2000H: 290 case CX88_BOARD_WINFAST_DTV2000H:
291 case CX88_BOARD_WINFAST_DTV2000H_J: 291 case CX88_BOARD_WINFAST_DTV2000H_J:
292 case CX88_BOARD_WINFAST_DTV1800H: 292 case CX88_BOARD_WINFAST_DTV1800H:
293 ir_codes = &IR_KEYTABLE(winfast); 293 ir_codes = RC_MAP_WINFAST;
294 ir->gpio_addr = MO_GP0_IO; 294 ir->gpio_addr = MO_GP0_IO;
295 ir->mask_keycode = 0x8f8; 295 ir->mask_keycode = 0x8f8;
296 ir->mask_keyup = 0x100; 296 ir->mask_keyup = 0x100;
@@ -299,14 +299,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
299 case CX88_BOARD_WINFAST2000XP_EXPERT: 299 case CX88_BOARD_WINFAST2000XP_EXPERT:
300 case CX88_BOARD_WINFAST_DTV1000: 300 case CX88_BOARD_WINFAST_DTV1000:
301 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: 301 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
302 ir_codes = &IR_KEYTABLE(winfast); 302 ir_codes = RC_MAP_WINFAST;
303 ir->gpio_addr = MO_GP0_IO; 303 ir->gpio_addr = MO_GP0_IO;
304 ir->mask_keycode = 0x8f8; 304 ir->mask_keycode = 0x8f8;
305 ir->mask_keyup = 0x100; 305 ir->mask_keyup = 0x100;
306 ir->polling = 1; /* ms */ 306 ir->polling = 1; /* ms */
307 break; 307 break;
308 case CX88_BOARD_IODATA_GVBCTV7E: 308 case CX88_BOARD_IODATA_GVBCTV7E:
309 ir_codes = &IR_KEYTABLE(iodata_bctv7e); 309 ir_codes = RC_MAP_IODATA_BCTV7E;
310 ir->gpio_addr = MO_GP0_IO; 310 ir->gpio_addr = MO_GP0_IO;
311 ir->mask_keycode = 0xfd; 311 ir->mask_keycode = 0xfd;
312 ir->mask_keydown = 0x02; 312 ir->mask_keydown = 0x02;
@@ -314,7 +314,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
314 break; 314 break;
315 case CX88_BOARD_PROLINK_PLAYTVPVR: 315 case CX88_BOARD_PROLINK_PLAYTVPVR:
316 case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO: 316 case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO:
317 ir_codes = &IR_KEYTABLE(pixelview); 317 ir_codes = RC_MAP_PIXELVIEW;
318 ir->gpio_addr = MO_GP1_IO; 318 ir->gpio_addr = MO_GP1_IO;
319 ir->mask_keycode = 0x1f; 319 ir->mask_keycode = 0x1f;
320 ir->mask_keyup = 0x80; 320 ir->mask_keyup = 0x80;
@@ -322,28 +322,28 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
322 break; 322 break;
323 case CX88_BOARD_PROLINK_PV_8000GT: 323 case CX88_BOARD_PROLINK_PV_8000GT:
324 case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME: 324 case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
325 ir_codes = &IR_KEYTABLE(pixelview_new); 325 ir_codes = RC_MAP_PIXELVIEW_NEW;
326 ir->gpio_addr = MO_GP1_IO; 326 ir->gpio_addr = MO_GP1_IO;
327 ir->mask_keycode = 0x3f; 327 ir->mask_keycode = 0x3f;
328 ir->mask_keyup = 0x80; 328 ir->mask_keyup = 0x80;
329 ir->polling = 1; /* ms */ 329 ir->polling = 1; /* ms */
330 break; 330 break;
331 case CX88_BOARD_KWORLD_LTV883: 331 case CX88_BOARD_KWORLD_LTV883:
332 ir_codes = &IR_KEYTABLE(pixelview); 332 ir_codes = RC_MAP_PIXELVIEW;
333 ir->gpio_addr = MO_GP1_IO; 333 ir->gpio_addr = MO_GP1_IO;
334 ir->mask_keycode = 0x1f; 334 ir->mask_keycode = 0x1f;
335 ir->mask_keyup = 0x60; 335 ir->mask_keyup = 0x60;
336 ir->polling = 1; /* ms */ 336 ir->polling = 1; /* ms */
337 break; 337 break;
338 case CX88_BOARD_ADSTECH_DVB_T_PCI: 338 case CX88_BOARD_ADSTECH_DVB_T_PCI:
339 ir_codes = &IR_KEYTABLE(adstech_dvb_t_pci); 339 ir_codes = RC_MAP_ADSTECH_DVB_T_PCI;
340 ir->gpio_addr = MO_GP1_IO; 340 ir->gpio_addr = MO_GP1_IO;
341 ir->mask_keycode = 0xbf; 341 ir->mask_keycode = 0xbf;
342 ir->mask_keyup = 0x40; 342 ir->mask_keyup = 0x40;
343 ir->polling = 50; /* ms */ 343 ir->polling = 50; /* ms */
344 break; 344 break;
345 case CX88_BOARD_MSI_TVANYWHERE_MASTER: 345 case CX88_BOARD_MSI_TVANYWHERE_MASTER:
346 ir_codes = &IR_KEYTABLE(msi_tvanywhere); 346 ir_codes = RC_MAP_MSI_TVANYWHERE;
347 ir->gpio_addr = MO_GP1_IO; 347 ir->gpio_addr = MO_GP1_IO;
348 ir->mask_keycode = 0x1f; 348 ir->mask_keycode = 0x1f;
349 ir->mask_keyup = 0x40; 349 ir->mask_keyup = 0x40;
@@ -351,7 +351,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
351 break; 351 break;
352 case CX88_BOARD_AVERTV_303: 352 case CX88_BOARD_AVERTV_303:
353 case CX88_BOARD_AVERTV_STUDIO_303: 353 case CX88_BOARD_AVERTV_STUDIO_303:
354 ir_codes = &IR_KEYTABLE(avertv_303); 354 ir_codes = RC_MAP_AVERTV_303;
355 ir->gpio_addr = MO_GP2_IO; 355 ir->gpio_addr = MO_GP2_IO;
356 ir->mask_keycode = 0xfb; 356 ir->mask_keycode = 0xfb;
357 ir->mask_keydown = 0x02; 357 ir->mask_keydown = 0x02;
@@ -364,41 +364,41 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
364 case CX88_BOARD_PROF_7300: 364 case CX88_BOARD_PROF_7300:
365 case CX88_BOARD_PROF_7301: 365 case CX88_BOARD_PROF_7301:
366 case CX88_BOARD_PROF_6200: 366 case CX88_BOARD_PROF_6200:
367 ir_codes = &IR_KEYTABLE(tbs_nec); 367 ir_codes = RC_MAP_TBS_NEC;
368 ir_type = IR_TYPE_PD; 368 ir_type = IR_TYPE_PD;
369 ir->sampling = 0xff00; /* address */ 369 ir->sampling = 0xff00; /* address */
370 break; 370 break;
371 case CX88_BOARD_TEVII_S460: 371 case CX88_BOARD_TEVII_S460:
372 case CX88_BOARD_TEVII_S420: 372 case CX88_BOARD_TEVII_S420:
373 ir_codes = &IR_KEYTABLE(tevii_nec); 373 ir_codes = RC_MAP_TEVII_NEC;
374 ir_type = IR_TYPE_PD; 374 ir_type = IR_TYPE_PD;
375 ir->sampling = 0xff00; /* address */ 375 ir->sampling = 0xff00; /* address */
376 break; 376 break;
377 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: 377 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
378 ir_codes = &IR_KEYTABLE(dntv_live_dvbt_pro); 378 ir_codes = RC_MAP_DNTV_LIVE_DVBT_PRO;
379 ir_type = IR_TYPE_PD; 379 ir_type = IR_TYPE_PD;
380 ir->sampling = 0xff00; /* address */ 380 ir->sampling = 0xff00; /* address */
381 break; 381 break;
382 case CX88_BOARD_NORWOOD_MICRO: 382 case CX88_BOARD_NORWOOD_MICRO:
383 ir_codes = &IR_KEYTABLE(norwood); 383 ir_codes = RC_MAP_NORWOOD;
384 ir->gpio_addr = MO_GP1_IO; 384 ir->gpio_addr = MO_GP1_IO;
385 ir->mask_keycode = 0x0e; 385 ir->mask_keycode = 0x0e;
386 ir->mask_keyup = 0x80; 386 ir->mask_keyup = 0x80;
387 ir->polling = 50; /* ms */ 387 ir->polling = 50; /* ms */
388 break; 388 break;
389 case CX88_BOARD_NPGTECH_REALTV_TOP10FM: 389 case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
390 ir_codes = &IR_KEYTABLE(npgtech); 390 ir_codes = RC_MAP_NPGTECH;
391 ir->gpio_addr = MO_GP0_IO; 391 ir->gpio_addr = MO_GP0_IO;
392 ir->mask_keycode = 0xfa; 392 ir->mask_keycode = 0xfa;
393 ir->polling = 50; /* ms */ 393 ir->polling = 50; /* ms */
394 break; 394 break;
395 case CX88_BOARD_PINNACLE_PCTV_HD_800i: 395 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
396 ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd); 396 ir_codes = RC_MAP_PINNACLE_PCTV_HD;
397 ir_type = IR_TYPE_RC5; 397 ir_type = IR_TYPE_RC5;
398 ir->sampling = 1; 398 ir->sampling = 1;
399 break; 399 break;
400 case CX88_BOARD_POWERCOLOR_REAL_ANGEL: 400 case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
401 ir_codes = &IR_KEYTABLE(powercolor_real_angel); 401 ir_codes = RC_MAP_POWERCOLOR_REAL_ANGEL;
402 ir->gpio_addr = MO_GP2_IO; 402 ir->gpio_addr = MO_GP2_IO;
403 ir->mask_keycode = 0x7e; 403 ir->mask_keycode = 0x7e;
404 ir->polling = 100; /* ms */ 404 ir->polling = 100; /* ms */
@@ -439,7 +439,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
439 ir->props.close = cx88_ir_close; 439 ir->props.close = cx88_ir_close;
440 440
441 /* all done */ 441 /* all done */
442 err = __ir_input_register(ir->input, ir_codes, &ir->props, MODULE_NAME); 442 err = ir_input_register(ir->input, ir_codes, &ir->props, MODULE_NAME);
443 if (err) 443 if (err)
444 goto err_out_free; 444 goto err_out_free;
445 445
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 29201438b45f..3a4fd8514511 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -602,7 +602,7 @@ struct em28xx_board em28xx_boards[] = {
602 .name = "Gadmei UTV330+", 602 .name = "Gadmei UTV330+",
603 .tuner_type = TUNER_TNF_5335MF, 603 .tuner_type = TUNER_TNF_5335MF,
604 .tda9887_conf = TDA9887_PRESENT, 604 .tda9887_conf = TDA9887_PRESENT,
605 .ir_codes = &IR_KEYTABLE(gadmei_rm008z), 605 .ir_codes = RC_MAP_GADMEI_RM008Z,
606 .decoder = EM28XX_SAA711X, 606 .decoder = EM28XX_SAA711X,
607 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 607 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
608 .input = { { 608 .input = { {
@@ -791,7 +791,7 @@ struct em28xx_board em28xx_boards[] = {
791 .mts_firmware = 1, 791 .mts_firmware = 1,
792 .has_dvb = 1, 792 .has_dvb = 1,
793 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 793 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
794 .ir_codes = &IR_KEYTABLE(hauppauge_new), 794 .ir_codes = RC_MAP_HAUPPAUGE_NEW,
795 .decoder = EM28XX_TVP5150, 795 .decoder = EM28XX_TVP5150,
796 .input = { { 796 .input = { {
797 .type = EM28XX_VMUX_TELEVISION, 797 .type = EM28XX_VMUX_TELEVISION,
@@ -816,7 +816,7 @@ struct em28xx_board em28xx_boards[] = {
816 .tuner_type = TUNER_XC2028, 816 .tuner_type = TUNER_XC2028,
817 .tuner_gpio = default_tuner_gpio, 817 .tuner_gpio = default_tuner_gpio,
818 .mts_firmware = 1, 818 .mts_firmware = 1,
819 .ir_codes = &IR_KEYTABLE(hauppauge_new), 819 .ir_codes = RC_MAP_HAUPPAUGE_NEW,
820 .decoder = EM28XX_TVP5150, 820 .decoder = EM28XX_TVP5150,
821 .input = { { 821 .input = { {
822 .type = EM28XX_VMUX_TELEVISION, 822 .type = EM28XX_VMUX_TELEVISION,
@@ -842,7 +842,7 @@ struct em28xx_board em28xx_boards[] = {
842 .mts_firmware = 1, 842 .mts_firmware = 1,
843 .has_dvb = 1, 843 .has_dvb = 1,
844 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 844 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
845 .ir_codes = &IR_KEYTABLE(hauppauge_new), 845 .ir_codes = RC_MAP_HAUPPAUGE_NEW,
846 .decoder = EM28XX_TVP5150, 846 .decoder = EM28XX_TVP5150,
847 .input = { { 847 .input = { {
848 .type = EM28XX_VMUX_TELEVISION, 848 .type = EM28XX_VMUX_TELEVISION,
@@ -868,7 +868,7 @@ struct em28xx_board em28xx_boards[] = {
868 .mts_firmware = 1, 868 .mts_firmware = 1,
869 .has_dvb = 1, 869 .has_dvb = 1,
870 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 870 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
871 .ir_codes = &IR_KEYTABLE(rc5_hauppauge_new), 871 .ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW,
872 .decoder = EM28XX_TVP5150, 872 .decoder = EM28XX_TVP5150,
873 .input = { { 873 .input = { {
874 .type = EM28XX_VMUX_TELEVISION, 874 .type = EM28XX_VMUX_TELEVISION,
@@ -894,7 +894,7 @@ struct em28xx_board em28xx_boards[] = {
894 .mts_firmware = 1, 894 .mts_firmware = 1,
895 .has_dvb = 1, 895 .has_dvb = 1,
896 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 896 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
897 .ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd), 897 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
898 .decoder = EM28XX_TVP5150, 898 .decoder = EM28XX_TVP5150,
899 .input = { { 899 .input = { {
900 .type = EM28XX_VMUX_TELEVISION, 900 .type = EM28XX_VMUX_TELEVISION,
@@ -920,7 +920,7 @@ struct em28xx_board em28xx_boards[] = {
920 .mts_firmware = 1, 920 .mts_firmware = 1,
921 .has_dvb = 1, 921 .has_dvb = 1,
922 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 922 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
923 .ir_codes = &IR_KEYTABLE(ati_tv_wonder_hd_600), 923 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
924 .decoder = EM28XX_TVP5150, 924 .decoder = EM28XX_TVP5150,
925 .input = { { 925 .input = { {
926 .type = EM28XX_VMUX_TELEVISION, 926 .type = EM28XX_VMUX_TELEVISION,
@@ -946,7 +946,7 @@ struct em28xx_board em28xx_boards[] = {
946 .decoder = EM28XX_TVP5150, 946 .decoder = EM28XX_TVP5150,
947 .has_dvb = 1, 947 .has_dvb = 1,
948 .dvb_gpio = default_digital, 948 .dvb_gpio = default_digital,
949 .ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), 949 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
950 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ 950 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
951 .input = { { 951 .input = { {
952 .type = EM28XX_VMUX_TELEVISION, 952 .type = EM28XX_VMUX_TELEVISION,
@@ -1296,7 +1296,7 @@ struct em28xx_board em28xx_boards[] = {
1296 .decoder = EM28XX_SAA711X, 1296 .decoder = EM28XX_SAA711X,
1297 .has_dvb = 1, 1297 .has_dvb = 1,
1298 .dvb_gpio = em2882_kworld_315u_digital, 1298 .dvb_gpio = em2882_kworld_315u_digital,
1299 .ir_codes = &IR_KEYTABLE(kworld_315u), 1299 .ir_codes = RC_MAP_KWORLD_315U,
1300 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1300 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1301 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE, 1301 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1302 /* Analog mode - still not ready */ 1302 /* Analog mode - still not ready */
@@ -1425,7 +1425,7 @@ struct em28xx_board em28xx_boards[] = {
1425 .has_dvb = 1, 1425 .has_dvb = 1,
1426 .dvb_gpio = kworld_330u_digital, 1426 .dvb_gpio = kworld_330u_digital,
1427 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ 1427 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
1428 .ir_codes = &IR_KEYTABLE(kworld_315u), 1428 .ir_codes = RC_MAP_KWORLD_315U,
1429 .input = { { 1429 .input = { {
1430 .type = EM28XX_VMUX_TELEVISION, 1430 .type = EM28XX_VMUX_TELEVISION,
1431 .vmux = TVP5150_COMPOSITE0, 1431 .vmux = TVP5150_COMPOSITE0,
@@ -1448,7 +1448,7 @@ struct em28xx_board em28xx_boards[] = {
1448 .decoder = EM28XX_TVP5150, 1448 .decoder = EM28XX_TVP5150,
1449 .has_dvb = 1, 1449 .has_dvb = 1,
1450 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 1450 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
1451 .ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), 1451 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
1452 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, 1452 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1453 .input = { { 1453 .input = { {
1454 .type = EM28XX_VMUX_TELEVISION, 1454 .type = EM28XX_VMUX_TELEVISION,
@@ -1541,7 +1541,7 @@ struct em28xx_board em28xx_boards[] = {
1541 .mts_firmware = 1, 1541 .mts_firmware = 1,
1542 .decoder = EM28XX_TVP5150, 1542 .decoder = EM28XX_TVP5150,
1543 .tuner_gpio = default_tuner_gpio, 1543 .tuner_gpio = default_tuner_gpio,
1544 .ir_codes = &IR_KEYTABLE(kaiomy), 1544 .ir_codes = RC_MAP_KAIOMY,
1545 .input = { { 1545 .input = { {
1546 .type = EM28XX_VMUX_TELEVISION, 1546 .type = EM28XX_VMUX_TELEVISION,
1547 .vmux = TVP5150_COMPOSITE0, 1547 .vmux = TVP5150_COMPOSITE0,
@@ -1641,7 +1641,7 @@ struct em28xx_board em28xx_boards[] = {
1641 .mts_firmware = 1, 1641 .mts_firmware = 1,
1642 .has_dvb = 1, 1642 .has_dvb = 1,
1643 .dvb_gpio = evga_indtube_digital, 1643 .dvb_gpio = evga_indtube_digital,
1644 .ir_codes = &IR_KEYTABLE(evga_indtube), 1644 .ir_codes = RC_MAP_EVGA_INDTUBE,
1645 .input = { { 1645 .input = { {
1646 .type = EM28XX_VMUX_TELEVISION, 1646 .type = EM28XX_VMUX_TELEVISION,
1647 .vmux = TVP5150_COMPOSITE0, 1647 .vmux = TVP5150_COMPOSITE0,
@@ -2335,21 +2335,21 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
2335 switch (dev->model) { 2335 switch (dev->model) {
2336 case EM2800_BOARD_TERRATEC_CINERGY_200: 2336 case EM2800_BOARD_TERRATEC_CINERGY_200:
2337 case EM2820_BOARD_TERRATEC_CINERGY_250: 2337 case EM2820_BOARD_TERRATEC_CINERGY_250:
2338 dev->init_data.ir_codes = &IR_KEYTABLE(em_terratec); 2338 dev->init_data.ir_codes = RC_MAP_EM_TERRATEC;
2339 dev->init_data.get_key = em28xx_get_key_terratec; 2339 dev->init_data.get_key = em28xx_get_key_terratec;
2340 dev->init_data.name = "i2c IR (EM28XX Terratec)"; 2340 dev->init_data.name = "i2c IR (EM28XX Terratec)";
2341 break; 2341 break;
2342 case EM2820_BOARD_PINNACLE_USB_2: 2342 case EM2820_BOARD_PINNACLE_USB_2:
2343 dev->init_data.ir_codes = &IR_KEYTABLE(pinnacle_grey); 2343 dev->init_data.ir_codes = RC_MAP_PINNACLE_GREY;
2344 dev->init_data.get_key = em28xx_get_key_pinnacle_usb_grey; 2344 dev->init_data.get_key = em28xx_get_key_pinnacle_usb_grey;
2345 dev->init_data.name = "i2c IR (EM28XX Pinnacle PCTV)"; 2345 dev->init_data.name = "i2c IR (EM28XX Pinnacle PCTV)";
2346 break; 2346 break;
2347 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: 2347 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
2348 dev->init_data.ir_codes = &IR_KEYTABLE(rc5_hauppauge_new); 2348 dev->init_data.ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW;
2349 dev->init_data.get_key = em28xx_get_key_em_haup; 2349 dev->init_data.get_key = em28xx_get_key_em_haup;
2350 dev->init_data.name = "i2c IR (EM2840 Hauppauge)"; 2350 dev->init_data.name = "i2c IR (EM2840 Hauppauge)";
2351 case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: 2351 case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE:
2352 dev->init_data.ir_codes = &IR_KEYTABLE(winfast_usbii_deluxe);; 2352 dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE;;
2353 dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; 2353 dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe;
2354 dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)"; 2354 dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)";
2355 break; 2355 break;
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 6f1fc695c561..e2772a1470cb 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -382,7 +382,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type)
382 382
383 /* Adjust xclk based o IR table for RC5/NEC tables */ 383 /* Adjust xclk based o IR table for RC5/NEC tables */
384 384
385 dev->board.ir_codes->ir_type = IR_TYPE_OTHER;
386 if (ir_type == IR_TYPE_RC5) { 385 if (ir_type == IR_TYPE_RC5) {
387 dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE; 386 dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE;
388 ir->full_code = 1; 387 ir->full_code = 1;
@@ -393,8 +392,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type)
393 } else 392 } else
394 rc = -EINVAL; 393 rc = -EINVAL;
395 394
396 dev->board.ir_codes->ir_type = ir_type;
397
398 em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, 395 em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk,
399 EM28XX_XCLK_IR_RC5_MODE); 396 EM28XX_XCLK_IR_RC5_MODE);
400 397
@@ -457,7 +454,6 @@ int em28xx_ir_init(struct em28xx *dev)
457 strlcat(ir->phys, "/input0", sizeof(ir->phys)); 454 strlcat(ir->phys, "/input0", sizeof(ir->phys));
458 455
459 /* Set IR protocol */ 456 /* Set IR protocol */
460 em28xx_ir_change_protocol(ir, dev->board.ir_codes->ir_type);
461 err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER); 457 err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER);
462 if (err < 0) 458 if (err < 0)
463 goto err_out_free; 459 goto err_out_free;
@@ -475,7 +471,7 @@ int em28xx_ir_init(struct em28xx *dev)
475 em28xx_ir_start(ir); 471 em28xx_ir_start(ir);
476 472
477 /* all done */ 473 /* all done */
478 err = __ir_input_register(ir->input, dev->board.ir_codes, 474 err = ir_input_register(ir->input, dev->board.ir_codes,
479 &ir->props, MODULE_NAME); 475 &ir->props, MODULE_NAME);
480 if (err) 476 if (err)
481 goto err_out_stop; 477 goto err_out_stop;
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index eec12910c8cf..b252d1b1b2a7 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -412,7 +412,7 @@ struct em28xx_board {
412 412
413 struct em28xx_input input[MAX_EM28XX_INPUT]; 413 struct em28xx_input input[MAX_EM28XX_INPUT];
414 struct em28xx_input radio; 414 struct em28xx_input radio;
415 struct ir_scancode_table *ir_codes; 415 char *ir_codes;
416}; 416};
417 417
418struct em28xx_eeprom { 418struct em28xx_eeprom {
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index e6ada5e46dfc..29d439742653 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -297,7 +297,7 @@ static void ir_work(struct work_struct *work)
297 297
298static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) 298static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
299{ 299{
300 struct ir_scancode_table *ir_codes = NULL; 300 char *ir_codes = NULL;
301 const char *name = NULL; 301 const char *name = NULL;
302 u64 ir_type = 0; 302 u64 ir_type = 0;
303 struct IR_i2c *ir; 303 struct IR_i2c *ir;
@@ -322,13 +322,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
322 name = "Pixelview"; 322 name = "Pixelview";
323 ir->get_key = get_key_pixelview; 323 ir->get_key = get_key_pixelview;
324 ir_type = IR_TYPE_OTHER; 324 ir_type = IR_TYPE_OTHER;
325 ir_codes = &IR_KEYTABLE(empty); 325 ir_codes = RC_MAP_EMPTY;
326 break; 326 break;
327 case 0x4b: 327 case 0x4b:
328 name = "PV951"; 328 name = "PV951";
329 ir->get_key = get_key_pv951; 329 ir->get_key = get_key_pv951;
330 ir_type = IR_TYPE_OTHER; 330 ir_type = IR_TYPE_OTHER;
331 ir_codes = &IR_KEYTABLE(pv951); 331 ir_codes = RC_MAP_PV951;
332 break; 332 break;
333 case 0x18: 333 case 0x18:
334 case 0x1f: 334 case 0x1f:
@@ -337,22 +337,22 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
337 ir->get_key = get_key_haup; 337 ir->get_key = get_key_haup;
338 ir_type = IR_TYPE_RC5; 338 ir_type = IR_TYPE_RC5;
339 if (hauppauge == 1) { 339 if (hauppauge == 1) {
340 ir_codes = &IR_KEYTABLE(hauppauge_new); 340 ir_codes = RC_MAP_HAUPPAUGE_NEW;
341 } else { 341 } else {
342 ir_codes = &IR_KEYTABLE(rc5_tv); 342 ir_codes = RC_MAP_RC5_TV;
343 } 343 }
344 break; 344 break;
345 case 0x30: 345 case 0x30:
346 name = "KNC One"; 346 name = "KNC One";
347 ir->get_key = get_key_knc1; 347 ir->get_key = get_key_knc1;
348 ir_type = IR_TYPE_OTHER; 348 ir_type = IR_TYPE_OTHER;
349 ir_codes = &IR_KEYTABLE(empty); 349 ir_codes = RC_MAP_EMPTY;
350 break; 350 break;
351 case 0x6b: 351 case 0x6b:
352 name = "FusionHDTV"; 352 name = "FusionHDTV";
353 ir->get_key = get_key_fusionhdtv; 353 ir->get_key = get_key_fusionhdtv;
354 ir_type = IR_TYPE_RC5; 354 ir_type = IR_TYPE_RC5;
355 ir_codes = &IR_KEYTABLE(fusionhdtv_mce); 355 ir_codes = RC_MAP_FUSIONHDTV_MCE;
356 break; 356 break;
357 case 0x0b: 357 case 0x0b:
358 case 0x47: 358 case 0x47:
@@ -365,9 +365,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
365 ir_type = IR_TYPE_RC5; 365 ir_type = IR_TYPE_RC5;
366 ir->get_key = get_key_haup_xvr; 366 ir->get_key = get_key_haup_xvr;
367 if (hauppauge == 1) { 367 if (hauppauge == 1) {
368 ir_codes = &IR_KEYTABLE(hauppauge_new); 368 ir_codes = RC_MAP_HAUPPAUGE_NEW;
369 } else { 369 } else {
370 ir_codes = &IR_KEYTABLE(rc5_tv); 370 ir_codes = RC_MAP_RC5_TV;
371 } 371 }
372 } else { 372 } else {
373 /* Handled by saa7134-input */ 373 /* Handled by saa7134-input */
@@ -379,7 +379,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
379 name = "AVerMedia Cardbus remote"; 379 name = "AVerMedia Cardbus remote";
380 ir->get_key = get_key_avermedia_cardbus; 380 ir->get_key = get_key_avermedia_cardbus;
381 ir_type = IR_TYPE_OTHER; 381 ir_type = IR_TYPE_OTHER;
382 ir_codes = &IR_KEYTABLE(avermedia_cardbus); 382 ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
383 break; 383 break;
384 } 384 }
385 385
@@ -447,7 +447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
447 input_dev->name = ir->name; 447 input_dev->name = ir->name;
448 input_dev->phys = ir->phys; 448 input_dev->phys = ir->phys;
449 449
450 err = __ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME); 450 err = ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME);
451 if (err) 451 if (err)
452 goto err_out_free; 452 goto err_out_free;
453 453
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index a363e334a50e..a5b92d109c6c 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -193,7 +193,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
193 /* Our default information for ir-kbd-i2c.c to use */ 193 /* Our default information for ir-kbd-i2c.c to use */
194 switch (hw) { 194 switch (hw) {
195 case IVTV_HW_I2C_IR_RX_AVER: 195 case IVTV_HW_I2C_IR_RX_AVER:
196 init_data->ir_codes = &IR_KEYTABLE(avermedia_cardbus); 196 init_data->ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
197 init_data->internal_get_key_func = 197 init_data->internal_get_key_func =
198 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS; 198 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS;
199 init_data->type = IR_TYPE_OTHER; 199 init_data->type = IR_TYPE_OTHER;
@@ -202,14 +202,14 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
202 case IVTV_HW_I2C_IR_RX_HAUP_EXT: 202 case IVTV_HW_I2C_IR_RX_HAUP_EXT:
203 case IVTV_HW_I2C_IR_RX_HAUP_INT: 203 case IVTV_HW_I2C_IR_RX_HAUP_INT:
204 /* Default to old black remote */ 204 /* Default to old black remote */
205 init_data->ir_codes = &IR_KEYTABLE(rc5_tv); 205 init_data->ir_codes = RC_MAP_RC5_TV;
206 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP; 206 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
207 init_data->type = IR_TYPE_RC5; 207 init_data->type = IR_TYPE_RC5;
208 init_data->name = itv->card_name; 208 init_data->name = itv->card_name;
209 break; 209 break;
210 case IVTV_HW_Z8F0811_IR_RX_HAUP: 210 case IVTV_HW_Z8F0811_IR_RX_HAUP:
211 /* Default to grey remote */ 211 /* Default to grey remote */
212 init_data->ir_codes = &IR_KEYTABLE(hauppauge_new); 212 init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
213 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 213 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
214 init_data->type = IR_TYPE_RC5; 214 init_data->type = IR_TYPE_RC5;
215 init_data->name = itv->card_name; 215 init_data->name = itv->card_name;
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index bf6751c760b4..f46dca3ccf79 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -587,7 +587,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
587{ 587{
588 struct card_ir *ir; 588 struct card_ir *ir;
589 struct input_dev *input_dev; 589 struct input_dev *input_dev;
590 struct ir_scancode_table *ir_codes = NULL; 590 char *ir_codes = NULL;
591 u32 mask_keycode = 0; 591 u32 mask_keycode = 0;
592 u32 mask_keydown = 0; 592 u32 mask_keydown = 0;
593 u32 mask_keyup = 0; 593 u32 mask_keyup = 0;
@@ -595,6 +595,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
595 int rc5_gpio = 0; 595 int rc5_gpio = 0;
596 int nec_gpio = 0; 596 int nec_gpio = 0;
597 int raw_decode = 0; 597 int raw_decode = 0;
598 int allow_protocol_change = 0;
598 u64 ir_type = IR_TYPE_OTHER; 599 u64 ir_type = IR_TYPE_OTHER;
599 int err; 600 int err;
600 601
@@ -610,27 +611,27 @@ int saa7134_input_init1(struct saa7134_dev *dev)
610 case SAA7134_BOARD_FLYTVPLATINUM_FM: 611 case SAA7134_BOARD_FLYTVPLATINUM_FM:
611 case SAA7134_BOARD_FLYTVPLATINUM_MINI2: 612 case SAA7134_BOARD_FLYTVPLATINUM_MINI2:
612 case SAA7134_BOARD_ROVERMEDIA_LINK_PRO_FM: 613 case SAA7134_BOARD_ROVERMEDIA_LINK_PRO_FM:
613 ir_codes = &IR_KEYTABLE(flyvideo); 614 ir_codes = RC_MAP_FLYVIDEO;
614 mask_keycode = 0xEC00000; 615 mask_keycode = 0xEC00000;
615 mask_keydown = 0x0040000; 616 mask_keydown = 0x0040000;
616 break; 617 break;
617 case SAA7134_BOARD_CINERGY400: 618 case SAA7134_BOARD_CINERGY400:
618 case SAA7134_BOARD_CINERGY600: 619 case SAA7134_BOARD_CINERGY600:
619 case SAA7134_BOARD_CINERGY600_MK3: 620 case SAA7134_BOARD_CINERGY600_MK3:
620 ir_codes = &IR_KEYTABLE(cinergy); 621 ir_codes = RC_MAP_CINERGY;
621 mask_keycode = 0x00003f; 622 mask_keycode = 0x00003f;
622 mask_keyup = 0x040000; 623 mask_keyup = 0x040000;
623 break; 624 break;
624 case SAA7134_BOARD_ECS_TVP3XP: 625 case SAA7134_BOARD_ECS_TVP3XP:
625 case SAA7134_BOARD_ECS_TVP3XP_4CB5: 626 case SAA7134_BOARD_ECS_TVP3XP_4CB5:
626 ir_codes = &IR_KEYTABLE(eztv); 627 ir_codes = RC_MAP_EZTV;
627 mask_keycode = 0x00017c; 628 mask_keycode = 0x00017c;
628 mask_keyup = 0x000002; 629 mask_keyup = 0x000002;
629 polling = 50; // ms 630 polling = 50; // ms
630 break; 631 break;
631 case SAA7134_BOARD_KWORLD_XPERT: 632 case SAA7134_BOARD_KWORLD_XPERT:
632 case SAA7134_BOARD_AVACSSMARTTV: 633 case SAA7134_BOARD_AVACSSMARTTV:
633 ir_codes = &IR_KEYTABLE(pixelview); 634 ir_codes = RC_MAP_PIXELVIEW;
634 mask_keycode = 0x00001F; 635 mask_keycode = 0x00001F;
635 mask_keyup = 0x000020; 636 mask_keyup = 0x000020;
636 polling = 50; // ms 637 polling = 50; // ms
@@ -647,7 +648,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
647 case SAA7134_BOARD_AVERMEDIA_GO_007_FM: 648 case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
648 case SAA7134_BOARD_AVERMEDIA_M102: 649 case SAA7134_BOARD_AVERMEDIA_M102:
649 case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS: 650 case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS:
650 ir_codes = &IR_KEYTABLE(avermedia); 651 ir_codes = RC_MAP_AVERMEDIA;
651 mask_keycode = 0x0007C8; 652 mask_keycode = 0x0007C8;
652 mask_keydown = 0x000010; 653 mask_keydown = 0x000010;
653 polling = 50; // ms 654 polling = 50; // ms
@@ -656,14 +657,14 @@ int saa7134_input_init1(struct saa7134_dev *dev)
656 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); 657 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4);
657 break; 658 break;
658 case SAA7134_BOARD_AVERMEDIA_M135A: 659 case SAA7134_BOARD_AVERMEDIA_M135A:
659 ir_codes = &IR_KEYTABLE(avermedia_m135a_rm_jx); 660 ir_codes = RC_MAP_AVERMEDIA_M135A_RM_JX;
660 mask_keydown = 0x0040000; 661 mask_keydown = 0x0040000;
661 mask_keycode = 0xffff; 662 mask_keycode = 0xffff;
662 raw_decode = 1; 663 raw_decode = 1;
663 break; 664 break;
664 case SAA7134_BOARD_AVERMEDIA_777: 665 case SAA7134_BOARD_AVERMEDIA_777:
665 case SAA7134_BOARD_AVERMEDIA_A16AR: 666 case SAA7134_BOARD_AVERMEDIA_A16AR:
666 ir_codes = &IR_KEYTABLE(avermedia); 667 ir_codes = RC_MAP_AVERMEDIA;
667 mask_keycode = 0x02F200; 668 mask_keycode = 0x02F200;
668 mask_keydown = 0x000400; 669 mask_keydown = 0x000400;
669 polling = 50; // ms 670 polling = 50; // ms
@@ -672,7 +673,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
672 saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1); 673 saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1);
673 break; 674 break;
674 case SAA7134_BOARD_AVERMEDIA_A16D: 675 case SAA7134_BOARD_AVERMEDIA_A16D:
675 ir_codes = &IR_KEYTABLE(avermedia_a16d); 676 ir_codes = RC_MAP_AVERMEDIA_A16D;
676 mask_keycode = 0x02F200; 677 mask_keycode = 0x02F200;
677 mask_keydown = 0x000400; 678 mask_keydown = 0x000400;
678 polling = 50; /* ms */ 679 polling = 50; /* ms */
@@ -681,14 +682,14 @@ int saa7134_input_init1(struct saa7134_dev *dev)
681 saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1); 682 saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1);
682 break; 683 break;
683 case SAA7134_BOARD_KWORLD_TERMINATOR: 684 case SAA7134_BOARD_KWORLD_TERMINATOR:
684 ir_codes = &IR_KEYTABLE(pixelview); 685 ir_codes = RC_MAP_PIXELVIEW;
685 mask_keycode = 0x00001f; 686 mask_keycode = 0x00001f;
686 mask_keyup = 0x000060; 687 mask_keyup = 0x000060;
687 polling = 50; // ms 688 polling = 50; // ms
688 break; 689 break;
689 case SAA7134_BOARD_MANLI_MTV001: 690 case SAA7134_BOARD_MANLI_MTV001:
690 case SAA7134_BOARD_MANLI_MTV002: 691 case SAA7134_BOARD_MANLI_MTV002:
691 ir_codes = &IR_KEYTABLE(manli); 692 ir_codes = RC_MAP_MANLI;
692 mask_keycode = 0x001f00; 693 mask_keycode = 0x001f00;
693 mask_keyup = 0x004000; 694 mask_keyup = 0x004000;
694 polling = 50; /* ms */ 695 polling = 50; /* ms */
@@ -708,25 +709,25 @@ int saa7134_input_init1(struct saa7134_dev *dev)
708 case SAA7134_BOARD_BEHOLD_507_9FM: 709 case SAA7134_BOARD_BEHOLD_507_9FM:
709 case SAA7134_BOARD_BEHOLD_507RDS_MK3: 710 case SAA7134_BOARD_BEHOLD_507RDS_MK3:
710 case SAA7134_BOARD_BEHOLD_507RDS_MK5: 711 case SAA7134_BOARD_BEHOLD_507RDS_MK5:
711 ir_codes = &IR_KEYTABLE(manli); 712 ir_codes = RC_MAP_MANLI;
712 mask_keycode = 0x003f00; 713 mask_keycode = 0x003f00;
713 mask_keyup = 0x004000; 714 mask_keyup = 0x004000;
714 polling = 50; /* ms */ 715 polling = 50; /* ms */
715 break; 716 break;
716 case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM: 717 case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM:
717 ir_codes = &IR_KEYTABLE(behold_columbus); 718 ir_codes = RC_MAP_BEHOLD_COLUMBUS;
718 mask_keycode = 0x003f00; 719 mask_keycode = 0x003f00;
719 mask_keyup = 0x004000; 720 mask_keyup = 0x004000;
720 polling = 50; // ms 721 polling = 50; // ms
721 break; 722 break;
722 case SAA7134_BOARD_SEDNA_PC_TV_CARDBUS: 723 case SAA7134_BOARD_SEDNA_PC_TV_CARDBUS:
723 ir_codes = &IR_KEYTABLE(pctv_sedna); 724 ir_codes = RC_MAP_PCTV_SEDNA;
724 mask_keycode = 0x001f00; 725 mask_keycode = 0x001f00;
725 mask_keyup = 0x004000; 726 mask_keyup = 0x004000;
726 polling = 50; // ms 727 polling = 50; // ms
727 break; 728 break;
728 case SAA7134_BOARD_GOTVIEW_7135: 729 case SAA7134_BOARD_GOTVIEW_7135:
729 ir_codes = &IR_KEYTABLE(gotview7135); 730 ir_codes = RC_MAP_GOTVIEW7135;
730 mask_keycode = 0x0003CC; 731 mask_keycode = 0x0003CC;
731 mask_keydown = 0x000010; 732 mask_keydown = 0x000010;
732 polling = 5; /* ms */ 733 polling = 5; /* ms */
@@ -735,80 +736,80 @@ int saa7134_input_init1(struct saa7134_dev *dev)
735 case SAA7134_BOARD_VIDEOMATE_TV_PVR: 736 case SAA7134_BOARD_VIDEOMATE_TV_PVR:
736 case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS: 737 case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS:
737 case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII: 738 case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII:
738 ir_codes = &IR_KEYTABLE(videomate_tv_pvr); 739 ir_codes = RC_MAP_VIDEOMATE_TV_PVR;
739 mask_keycode = 0x00003F; 740 mask_keycode = 0x00003F;
740 mask_keyup = 0x400000; 741 mask_keyup = 0x400000;
741 polling = 50; // ms 742 polling = 50; // ms
742 break; 743 break;
743 case SAA7134_BOARD_PROTEUS_2309: 744 case SAA7134_BOARD_PROTEUS_2309:
744 ir_codes = &IR_KEYTABLE(proteus_2309); 745 ir_codes = RC_MAP_PROTEUS_2309;
745 mask_keycode = 0x00007F; 746 mask_keycode = 0x00007F;
746 mask_keyup = 0x000080; 747 mask_keyup = 0x000080;
747 polling = 50; // ms 748 polling = 50; // ms
748 break; 749 break;
749 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 750 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
750 case SAA7134_BOARD_VIDEOMATE_DVBT_200: 751 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
751 ir_codes = &IR_KEYTABLE(videomate_tv_pvr); 752 ir_codes = RC_MAP_VIDEOMATE_TV_PVR;
752 mask_keycode = 0x003F00; 753 mask_keycode = 0x003F00;
753 mask_keyup = 0x040000; 754 mask_keyup = 0x040000;
754 break; 755 break;
755 case SAA7134_BOARD_FLYDVBS_LR300: 756 case SAA7134_BOARD_FLYDVBS_LR300:
756 case SAA7134_BOARD_FLYDVBT_LR301: 757 case SAA7134_BOARD_FLYDVBT_LR301:
757 case SAA7134_BOARD_FLYDVBTDUO: 758 case SAA7134_BOARD_FLYDVBTDUO:
758 ir_codes = &IR_KEYTABLE(flydvb); 759 ir_codes = RC_MAP_FLYDVB;
759 mask_keycode = 0x0001F00; 760 mask_keycode = 0x0001F00;
760 mask_keydown = 0x0040000; 761 mask_keydown = 0x0040000;
761 break; 762 break;
762 case SAA7134_BOARD_ASUSTeK_P7131_DUAL: 763 case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
763 case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA: 764 case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA:
764 case SAA7134_BOARD_ASUSTeK_P7131_ANALOG: 765 case SAA7134_BOARD_ASUSTeK_P7131_ANALOG:
765 ir_codes = &IR_KEYTABLE(asus_pc39); 766 ir_codes = RC_MAP_ASUS_PC39;
766 mask_keydown = 0x0040000; 767 mask_keydown = 0x0040000;
767 rc5_gpio = 1; 768 rc5_gpio = 1;
768 break; 769 break;
769 case SAA7134_BOARD_ENCORE_ENLTV: 770 case SAA7134_BOARD_ENCORE_ENLTV:
770 case SAA7134_BOARD_ENCORE_ENLTV_FM: 771 case SAA7134_BOARD_ENCORE_ENLTV_FM:
771 ir_codes = &IR_KEYTABLE(encore_enltv); 772 ir_codes = RC_MAP_ENCORE_ENLTV;
772 mask_keycode = 0x00007f; 773 mask_keycode = 0x00007f;
773 mask_keyup = 0x040000; 774 mask_keyup = 0x040000;
774 polling = 50; // ms 775 polling = 50; // ms
775 break; 776 break;
776 case SAA7134_BOARD_ENCORE_ENLTV_FM53: 777 case SAA7134_BOARD_ENCORE_ENLTV_FM53:
777 ir_codes = &IR_KEYTABLE(encore_enltv_fm53); 778 ir_codes = RC_MAP_ENCORE_ENLTV_FM53;
778 mask_keydown = 0x0040000; 779 mask_keydown = 0x0040000;
779 mask_keycode = 0x00007f; 780 mask_keycode = 0x00007f;
780 nec_gpio = 1; 781 nec_gpio = 1;
781 break; 782 break;
782 case SAA7134_BOARD_10MOONSTVMASTER3: 783 case SAA7134_BOARD_10MOONSTVMASTER3:
783 ir_codes = &IR_KEYTABLE(encore_enltv); 784 ir_codes = RC_MAP_ENCORE_ENLTV;
784 mask_keycode = 0x5f80000; 785 mask_keycode = 0x5f80000;
785 mask_keyup = 0x8000000; 786 mask_keyup = 0x8000000;
786 polling = 50; //ms 787 polling = 50; //ms
787 break; 788 break;
788 case SAA7134_BOARD_GENIUS_TVGO_A11MCE: 789 case SAA7134_BOARD_GENIUS_TVGO_A11MCE:
789 ir_codes = &IR_KEYTABLE(genius_tvgo_a11mce); 790 ir_codes = RC_MAP_GENIUS_TVGO_A11MCE;
790 mask_keycode = 0xff; 791 mask_keycode = 0xff;
791 mask_keydown = 0xf00000; 792 mask_keydown = 0xf00000;
792 polling = 50; /* ms */ 793 polling = 50; /* ms */
793 break; 794 break;
794 case SAA7134_BOARD_REAL_ANGEL_220: 795 case SAA7134_BOARD_REAL_ANGEL_220:
795 ir_codes = &IR_KEYTABLE(real_audio_220_32_keys); 796 ir_codes = RC_MAP_REAL_AUDIO_220_32_KEYS;
796 mask_keycode = 0x3f00; 797 mask_keycode = 0x3f00;
797 mask_keyup = 0x4000; 798 mask_keyup = 0x4000;
798 polling = 50; /* ms */ 799 polling = 50; /* ms */
799 break; 800 break;
800 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG: 801 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
801 ir_codes = &IR_KEYTABLE(kworld_plus_tv_analog); 802 ir_codes = RC_MAP_KWORLD_PLUS_TV_ANALOG;
802 mask_keycode = 0x7f; 803 mask_keycode = 0x7f;
803 polling = 40; /* ms */ 804 polling = 40; /* ms */
804 break; 805 break;
805 case SAA7134_BOARD_VIDEOMATE_S350: 806 case SAA7134_BOARD_VIDEOMATE_S350:
806 ir_codes = &IR_KEYTABLE(videomate_s350); 807 ir_codes = RC_MAP_VIDEOMATE_S350;
807 mask_keycode = 0x003f00; 808 mask_keycode = 0x003f00;
808 mask_keydown = 0x040000; 809 mask_keydown = 0x040000;
809 break; 810 break;
810 case SAA7134_BOARD_LEADTEK_WINFAST_DTV1000S: 811 case SAA7134_BOARD_LEADTEK_WINFAST_DTV1000S:
811 ir_codes = &IR_KEYTABLE(winfast); 812 ir_codes = RC_MAP_WINFAST;
812 mask_keycode = 0x5f00; 813 mask_keycode = 0x5f00;
813 mask_keyup = 0x020000; 814 mask_keyup = 0x020000;
814 polling = 50; /* ms */ 815 polling = 50; /* ms */
@@ -853,13 +854,11 @@ int saa7134_input_init1(struct saa7134_dev *dev)
853 ir->props.open = saa7134_ir_open; 854 ir->props.open = saa7134_ir_open;
854 ir->props.close = saa7134_ir_close; 855 ir->props.close = saa7134_ir_close;
855 856
856 if (ir_codes->ir_type != IR_TYPE_OTHER && !raw_decode) { 857 if (!raw_decode && allow_protocol_change) {
857 ir->props.allowed_protos = IR_TYPE_RC5 | IR_TYPE_NEC; 858 ir->props.allowed_protos = IR_TYPE_RC5 | IR_TYPE_NEC;
858 ir->props.change_protocol = saa7134_ir_change_protocol; 859 ir->props.change_protocol = saa7134_ir_change_protocol;
859
860 /* Set IR protocol */
861 saa7134_ir_change_protocol(ir->props.priv, ir_codes->ir_type);
862 } 860 }
861
863 err = ir_input_init(input_dev, &ir->ir, ir_type); 862 err = ir_input_init(input_dev, &ir->ir, ir_type);
864 if (err < 0) 863 if (err < 0)
865 goto err_out_free; 864 goto err_out_free;
@@ -877,10 +876,10 @@ int saa7134_input_init1(struct saa7134_dev *dev)
877 } 876 }
878 input_dev->dev.parent = &dev->pci->dev; 877 input_dev->dev.parent = &dev->pci->dev;
879 878
880 err = __ir_input_register(ir->dev, ir_codes, &ir->props, MODULE_NAME); 879 err = ir_input_register(ir->dev, ir_codes, &ir->props, MODULE_NAME);
881 if (err) 880 if (err)
882 goto err_out_free; 881 goto err_out_free;
883 if (ir_codes->ir_type != IR_TYPE_OTHER) { 882 if (raw_decode) {
884 err = ir_raw_event_register(ir->dev); 883 err = ir_raw_event_register(ir->dev);
885 if (err) 884 if (err)
886 goto err_out_free; 885 goto err_out_free;
@@ -938,24 +937,24 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
938 dev->init_data.name = "Pinnacle PCTV"; 937 dev->init_data.name = "Pinnacle PCTV";
939 if (pinnacle_remote == 0) { 938 if (pinnacle_remote == 0) {
940 dev->init_data.get_key = get_key_pinnacle_color; 939 dev->init_data.get_key = get_key_pinnacle_color;
941 dev->init_data.ir_codes = &IR_KEYTABLE(pinnacle_color); 940 dev->init_data.ir_codes = RC_MAP_PINNACLE_COLOR;
942 info.addr = 0x47; 941 info.addr = 0x47;
943 } else { 942 } else {
944 dev->init_data.get_key = get_key_pinnacle_grey; 943 dev->init_data.get_key = get_key_pinnacle_grey;
945 dev->init_data.ir_codes = &IR_KEYTABLE(pinnacle_grey); 944 dev->init_data.ir_codes = RC_MAP_PINNACLE_GREY;
946 info.addr = 0x47; 945 info.addr = 0x47;
947 } 946 }
948 break; 947 break;
949 case SAA7134_BOARD_UPMOST_PURPLE_TV: 948 case SAA7134_BOARD_UPMOST_PURPLE_TV:
950 dev->init_data.name = "Purple TV"; 949 dev->init_data.name = "Purple TV";
951 dev->init_data.get_key = get_key_purpletv; 950 dev->init_data.get_key = get_key_purpletv;
952 dev->init_data.ir_codes = &IR_KEYTABLE(purpletv); 951 dev->init_data.ir_codes = RC_MAP_PURPLETV;
953 info.addr = 0x7a; 952 info.addr = 0x7a;
954 break; 953 break;
955 case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS: 954 case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS:
956 dev->init_data.name = "MSI TV@nywhere Plus"; 955 dev->init_data.name = "MSI TV@nywhere Plus";
957 dev->init_data.get_key = get_key_msi_tvanywhere_plus; 956 dev->init_data.get_key = get_key_msi_tvanywhere_plus;
958 dev->init_data.ir_codes = &IR_KEYTABLE(msi_tvanywhere_plus); 957 dev->init_data.ir_codes = RC_MAP_MSI_TVANYWHERE_PLUS;
959 info.addr = 0x30; 958 info.addr = 0x30;
960 /* MSI TV@nywhere Plus controller doesn't seem to 959 /* MSI TV@nywhere Plus controller doesn't seem to
961 respond to probes unless we read something from 960 respond to probes unless we read something from
@@ -969,7 +968,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
969 case SAA7134_BOARD_HAUPPAUGE_HVR1110: 968 case SAA7134_BOARD_HAUPPAUGE_HVR1110:
970 dev->init_data.name = "HVR 1110"; 969 dev->init_data.name = "HVR 1110";
971 dev->init_data.get_key = get_key_hvr1110; 970 dev->init_data.get_key = get_key_hvr1110;
972 dev->init_data.ir_codes = &IR_KEYTABLE(hauppauge_new); 971 dev->init_data.ir_codes = RC_MAP_HAUPPAUGE_NEW;
973 info.addr = 0x71; 972 info.addr = 0x71;
974 break; 973 break;
975 case SAA7134_BOARD_BEHOLD_607FM_MK3: 974 case SAA7134_BOARD_BEHOLD_607FM_MK3:
@@ -987,7 +986,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
987 case SAA7134_BOARD_BEHOLD_X7: 986 case SAA7134_BOARD_BEHOLD_X7:
988 dev->init_data.name = "BeholdTV"; 987 dev->init_data.name = "BeholdTV";
989 dev->init_data.get_key = get_key_beholdm6xx; 988 dev->init_data.get_key = get_key_beholdm6xx;
990 dev->init_data.ir_codes = &IR_KEYTABLE(behold); 989 dev->init_data.ir_codes = RC_MAP_BEHOLD;
991 dev->init_data.type = IR_TYPE_NEC; 990 dev->init_data.type = IR_TYPE_NEC;
992 info.addr = 0x2d; 991 info.addr = 0x2d;
993 break; 992 break;
@@ -998,7 +997,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
998 case SAA7134_BOARD_FLYDVB_TRIO: 997 case SAA7134_BOARD_FLYDVB_TRIO:
999 dev->init_data.name = "FlyDVB Trio"; 998 dev->init_data.name = "FlyDVB Trio";
1000 dev->init_data.get_key = get_key_flydvb_trio; 999 dev->init_data.get_key = get_key_flydvb_trio;
1001 dev->init_data.ir_codes = &IR_KEYTABLE(flydvb); 1000 dev->init_data.ir_codes = RC_MAP_FLYDVB;
1002 info.addr = 0x0b; 1001 info.addr = 0x0b;
1003 break; 1002 break;
1004 default: 1003 default: