Commit 02858eed authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB: ir-core: Make use of the new IR keymap modules

Instead of using the ugly keymap sequences, use the new rc-*.ko keymap
files. For now, it is still needed to have one keymap loaded, for the
RC code to work. Later patches will remove this depenency.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b2245ba1
ir-common-objs := ir-functions.o ir-keymaps.o ir-common-objs := ir-functions.o ir-keymaps.o
ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o
obj-y += keymaps/
obj-$(CONFIG_IR_CORE) += ir-core.o obj-$(CONFIG_IR_CORE) += ir-core.o
obj-$(CONFIG_VIDEO_IR) += ir-common.o obj-$(CONFIG_VIDEO_IR) += ir-common.o
obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o
...@@ -251,8 +251,10 @@ static int __init ir_core_init(void) ...@@ -251,8 +251,10 @@ static int __init ir_core_init(void)
return rc; return rc;
} }
/* Initialize/load the decoders that will be used */ /* Initialize/load the decoders/keymap code that will be used */
ir_raw_init(); ir_raw_init();
rc_map_init();
return 0; return 0;
} }
......
...@@ -26,12 +26,14 @@ static struct rc_keymap *seek_rc_map(const char *name) ...@@ -26,12 +26,14 @@ static struct rc_keymap *seek_rc_map(const char *name)
spin_lock(&rc_map_lock); spin_lock(&rc_map_lock);
list_for_each_entry(map, &rc_map_list, list) { list_for_each_entry(map, &rc_map_list, list) {
if (!strcmp(name, map->map.name)) if (!strcmp(name, map->map.name)) {
break; spin_unlock(&rc_map_lock);
return map;
}
} }
spin_unlock(&rc_map_lock); spin_unlock(&rc_map_lock);
return map; return NULL;
} }
struct ir_scancode_table *get_rc_map(const char *name) struct ir_scancode_table *get_rc_map(const char *name)
...@@ -43,15 +45,22 @@ struct ir_scancode_table *get_rc_map(const char *name) ...@@ -43,15 +45,22 @@ struct ir_scancode_table *get_rc_map(const char *name)
map = seek_rc_map(name); map = seek_rc_map(name);
#ifdef MODULE #ifdef MODULE
if (!map) { if (!map) {
rc = request_module("name"); rc = request_module(name);
if (rc < 0) if (rc < 0) {
printk(KERN_ERR "Couldn't load IR keymap %s\n", name);
return NULL; return NULL;
}
msleep(20); /* Give some time for IR to register */
map = seek_rc_map(name); map = seek_rc_map(name);
} }
#endif #endif
if (!map) if (!map) {
printk(KERN_ERR "IR keymap %s not found\n", name);
return NULL; return NULL;
}
printk(KERN_INFO "Registered IR keymap %s\n", map->map.name);
return &map->map; return &map->map;
} }
...@@ -73,3 +82,9 @@ void ir_unregister_map(struct rc_keymap *map) ...@@ -73,3 +82,9 @@ void ir_unregister_map(struct rc_keymap *map)
spin_unlock(&rc_map_lock); spin_unlock(&rc_map_lock);
} }
EXPORT_SYMBOL_GPL(ir_unregister_map); EXPORT_SYMBOL_GPL(ir_unregister_map);
void rc_map_init(void)
{
spin_lock_init(&rc_map_lock);
}
...@@ -596,7 +596,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id) ...@@ -596,7 +596,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
{ {
struct input_dev *input_dev; struct input_dev *input_dev;
struct ir_scancode_table *ir_codes = &IR_KEYTABLE(dm1105_nec); char *ir_codes = NULL;
u64 ir_type = IR_TYPE_OTHER; u64 ir_type = IR_TYPE_OTHER;
int err = -ENOMEM; int err = -ENOMEM;
...@@ -630,7 +630,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) ...@@ -630,7 +630,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
INIT_WORK(&dm1105->ir.work, dm1105_emit_key); INIT_WORK(&dm1105->ir.work, dm1105_emit_key);
err = __ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); err = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME);
return err; return err;
} }
......
...@@ -192,7 +192,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) ...@@ -192,7 +192,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
struct saa7146_dev *saa = budget_ci->budget.dev; struct saa7146_dev *saa = budget_ci->budget.dev;
struct input_dev *input_dev = budget_ci->ir.dev; struct input_dev *input_dev = budget_ci->ir.dev;
int error; int error;
struct ir_scancode_table *ir_codes; char *ir_codes = NULL;
budget_ci->ir.dev = input_dev = input_allocate_device(); budget_ci->ir.dev = input_dev = input_allocate_device();
...@@ -232,7 +232,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) ...@@ -232,7 +232,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
case 0x1011: case 0x1011:
case 0x1012: case 0x1012:
/* The hauppauge keymap is a superset of these remotes */ /* The hauppauge keymap is a superset of these remotes */
ir_codes = &IR_KEYTABLE(hauppauge_new); ir_codes = RC_MAP_HAUPPAUGE_NEW;
if (rc5_device < 0) if (rc5_device < 0)
budget_ci->ir.rc5_device = 0x1f; budget_ci->ir.rc5_device = 0x1f;
...@@ -241,11 +241,11 @@ static int msp430_ir_init(struct budget_ci *budget_ci) ...@@ -241,11 +241,11 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
case 0x1017: case 0x1017:
case 0x101a: case 0x101a:
/* for the Technotrend 1500 bundled remote */ /* for the Technotrend 1500 bundled remote */
ir_codes = &IR_KEYTABLE(tt_1500); ir_codes = RC_MAP_TT_1500;
break; break;
default: default:
/* unknown remote */ /* unknown remote */
ir_codes = &IR_KEYTABLE(budget_ci_old); ir_codes = RC_MAP_BUDGET_CI_OLD;
break; break;
} }
...@@ -256,7 +256,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) ...@@ -256,7 +256,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
budget_ci->ir.timer_keyup.function = msp430_ir_keyup; budget_ci->ir.timer_keyup.function = msp430_ir_keyup;
budget_ci->ir.timer_keyup.data = (unsigned long) &budget_ci->ir; budget_ci->ir.timer_keyup.data = (unsigned long) &budget_ci->ir;
budget_ci->ir.last_raw = 0xffff; /* An impossible value */ budget_ci->ir.last_raw = 0xffff; /* An impossible value */
error = __ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); error = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME);
if (error) { if (error) {
printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error); printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error);
return error; return error;
......
...@@ -248,7 +248,7 @@ static void bttv_ir_stop(struct bttv *btv) ...@@ -248,7 +248,7 @@ static void bttv_ir_stop(struct bttv *btv)
int bttv_input_init(struct bttv *btv) int bttv_input_init(struct bttv *btv)
{ {
struct card_ir *ir; struct card_ir *ir;
struct ir_scancode_table *ir_codes = NULL; char *ir_codes = NULL;
struct input_dev *input_dev; struct input_dev *input_dev;
u64 ir_type = IR_TYPE_OTHER; u64 ir_type = IR_TYPE_OTHER;
int err = -ENOMEM; int err = -ENOMEM;
...@@ -266,7 +266,7 @@ int bttv_input_init(struct bttv *btv) ...@@ -266,7 +266,7 @@ int bttv_input_init(struct bttv *btv)
case BTTV_BOARD_AVERMEDIA: case BTTV_BOARD_AVERMEDIA:
case BTTV_BOARD_AVPHONE98: case BTTV_BOARD_AVPHONE98:
case BTTV_BOARD_AVERMEDIA98: case BTTV_BOARD_AVERMEDIA98:
ir_codes = &IR_KEYTABLE(avermedia); ir_codes = RC_MAP_AVERMEDIA;
ir->mask_keycode = 0xf88000; ir->mask_keycode = 0xf88000;
ir->mask_keydown = 0x010000; ir->mask_keydown = 0x010000;
ir->polling = 50; // ms ir->polling = 50; // ms
...@@ -274,14 +274,14 @@ int bttv_input_init(struct bttv *btv) ...@@ -274,14 +274,14 @@ int bttv_input_init(struct bttv *btv)
case BTTV_BOARD_AVDVBT_761: case BTTV_BOARD_AVDVBT_761:
case BTTV_BOARD_AVDVBT_771: case BTTV_BOARD_AVDVBT_771:
ir_codes = &IR_KEYTABLE(avermedia_dvbt); ir_codes = RC_MAP_AVERMEDIA_DVBT;
ir->mask_keycode = 0x0f00c0; ir->mask_keycode = 0x0f00c0;
ir->mask_keydown = 0x000020; ir->mask_keydown = 0x000020;
ir->polling = 50; // ms ir->polling = 50; // ms
break; break;
case BTTV_BOARD_PXELVWPLTVPAK: case BTTV_BOARD_PXELVWPLTVPAK:
ir_codes = &IR_KEYTABLE(pixelview); ir_codes = RC_MAP_PIXELVIEW;
ir->mask_keycode = 0x003e00; ir->mask_keycode = 0x003e00;
ir->mask_keyup = 0x010000; ir->mask_keyup = 0x010000;
ir->polling = 50; // ms ir->polling = 50; // ms
...@@ -289,24 +289,24 @@ int bttv_input_init(struct bttv *btv) ...@@ -289,24 +289,24 @@ int bttv_input_init(struct bttv *btv)
case BTTV_BOARD_PV_M4900: case BTTV_BOARD_PV_M4900:
case BTTV_BOARD_PV_BT878P_9B: case BTTV_BOARD_PV_BT878P_9B:
case BTTV_BOARD_PV_BT878P_PLUS: case BTTV_BOARD_PV_BT878P_PLUS:
ir_codes = &IR_KEYTABLE(pixelview); ir_codes = RC_MAP_PIXELVIEW;
ir->mask_keycode = 0x001f00; ir->mask_keycode = 0x001f00;
ir->mask_keyup = 0x008000; ir->mask_keyup = 0x008000;
ir->polling = 50; // ms ir->polling = 50; // ms
break; break;
case BTTV_BOARD_WINFAST2000: case BTTV_BOARD_WINFAST2000:
ir_codes = &IR_KEYTABLE(winfast); ir_codes = RC_MAP_WINFAST;
ir->mask_keycode = 0x1f8; ir->mask_keycode = 0x1f8;
break; break;
case BTTV_BOARD_MAGICTVIEW061: case BTTV_BOARD_MAGICTVIEW061:
case BTTV_BOARD_MAGICTVIEW063: case BTTV_BOARD_MAGICTVIEW063:
ir_codes = &IR_KEYTABLE(winfast); ir_codes = RC_MAP_WINFAST;
ir->mask_keycode = 0x0008e000; ir->mask_keycode = 0x0008e000;
ir->mask_keydown = 0x00200000; ir->mask_keydown = 0x00200000;
break; break;
case BTTV_BOARD_APAC_VIEWCOMP: case BTTV_BOARD_APAC_VIEWCOMP:
ir_codes = &IR_KEYTABLE(apac_viewcomp); ir_codes = RC_MAP_APAC_VIEWCOMP;
ir->mask_keycode = 0x001f00; ir->mask_keycode = 0x001f00;
ir->mask_keyup = 0x008000; ir->mask_keyup = 0x008000;
ir->polling = 50; // ms ir->polling = 50; // ms
...@@ -314,30 +314,30 @@ int bttv_input_init(struct bttv *btv) ...@@ -314,30 +314,30 @@ int bttv_input_init(struct bttv *btv)
case BTTV_BOARD_ASKEY_CPH03X: case BTTV_BOARD_ASKEY_CPH03X:
case BTTV_BOARD_CONCEPTRONIC_CTVFMI2: case BTTV_BOARD_CONCEPTRONIC_CTVFMI2:
case BTTV_BOARD_CONTVFMI: case BTTV_BOARD_CONTVFMI:
ir_codes = &IR_KEYTABLE(pixelview); ir_codes = RC_MAP_PIXELVIEW;
ir->mask_keycode = 0x001F00; ir->mask_keycode = 0x001F00;
ir->mask_keyup = 0x006000; ir->mask_keyup = 0x006000;
ir->polling = 50; // ms ir->polling = 50; // ms
break; break;
case BTTV_BOARD_NEBULA_DIGITV: case BTTV_BOARD_NEBULA_DIGITV:
ir_codes = &IR_KEYTABLE(nebula); ir_codes = RC_MAP_NEBULA;
btv->custom_irq = bttv_rc5_irq; btv->custom_irq = bttv_rc5_irq;
ir->rc5_gpio = 1; ir->rc5_gpio = 1;
break; break;
case BTTV_BOARD_MACHTV_MAGICTV: case BTTV_BOARD_MACHTV_MAGICTV:
ir_codes = &IR_KEYTABLE(apac_viewcomp); ir_codes = RC_MAP_APAC_VIEWCOMP;
ir->mask_keycode = 0x001F00; ir->mask_keycode = 0x001F00;
ir->mask_keyup = 0x004000; ir->mask_keyup = 0x004000;
ir->polling = 50; /* ms */ ir->polling = 50; /* ms */
break; break;
case BTTV_BOARD_KOZUMI_KTV_01C: case BTTV_BOARD_KOZUMI_KTV_01C:
ir_codes = &IR_KEYTABLE(pctv_sedna); ir_codes = RC_MAP_PCTV_SEDNA;
ir->mask_keycode = 0x001f00; ir->mask_keycode = 0x001f00;
ir->mask_keyup = 0x006000; ir->mask_keyup = 0x006000;
ir->polling = 50; /* ms */ ir->polling = 50; /* ms */
break; break;
case BTTV_BOARD_ENLTV_FM_2: case BTTV_BOARD_ENLTV_FM_2:
ir_codes = &IR_KEYTABLE(encore_enltv2); ir_codes = RC_MAP_ENCORE_ENLTV2;
ir->mask_keycode = 0x00fd00; ir->mask_keycode = 0x00fd00;
ir->mask_keyup = 0x000080; ir->mask_keyup = 0x000080;
ir->polling = 1; /* ms */ ir->polling = 1; /* ms */
...@@ -392,7 +392,7 @@ int bttv_input_init(struct bttv *btv) ...@@ -392,7 +392,7 @@ int bttv_input_init(struct bttv *btv)
bttv_ir_start(btv, ir); bttv_ir_start(btv, ir);
/* all done */ /* all done */
err = __ir_input_register(btv->remote->dev, ir_codes, NULL, MODULE_NAME); err = ir_input_register(btv->remote->dev, ir_codes, NULL, MODULE_NAME);
if (err) if (err)
goto err_out_stop; goto err_out_stop;
......
...@@ -109,7 +109,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw, ...@@ -109,7 +109,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,
/* Our default information for ir-kbd-i2c.c to use */ /* Our default information for ir-kbd-i2c.c to use */
switch (hw) { switch (hw) {
case CX18_HW_Z8F0811_IR_RX_HAUP: case CX18_HW_Z8F0811_IR_RX_HAUP:
init_data->ir_codes = &IR_KEYTABLE(hauppauge_new); init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
init_data->type = IR_TYPE_RC5; init_data->type = IR_TYPE_RC5;
init_data->name = cx->card_name; init_data->name = cx->card_name;
......
...@@ -340,7 +340,7 @@ int cx23885_input_init(struct cx23885_dev *dev) ...@@ -340,7 +340,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
{ {
struct card_ir *ir; struct card_ir *ir;
struct input_dev *input_dev; struct input_dev *input_dev;
struct ir_scancode_table *ir_codes = NULL; char *ir_codes = NULL;
int ir_type, ir_addr, ir_start; int ir_type, ir_addr, ir_start;
int ret; int ret;
...@@ -355,7 +355,7 @@ int cx23885_input_init(struct cx23885_dev *dev) ...@@ -355,7 +355,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
case CX23885_BOARD_HAUPPAUGE_HVR1850: case CX23885_BOARD_HAUPPAUGE_HVR1850:
case CX23885_BOARD_HAUPPAUGE_HVR1290: case CX23885_BOARD_HAUPPAUGE_HVR1290:
/* Parameters for the grey Hauppauge remote for the HVR-1850 */ /* Parameters for the grey Hauppauge remote for the HVR-1850 */
ir_codes = &IR_KEYTABLE(hauppauge_new); ir_codes = RC_MAP_HAUPPAUGE_NEW;
ir_type = IR_TYPE_RC5; ir_type = IR_TYPE_RC5;
ir_addr = 0x1e; /* RC-5 system bits emitted by the remote */ ir_addr = 0x1e; /* RC-5 system bits emitted by the remote */
ir_start = RC5_START_BITS_NORMAL; /* A basic RC-5 remote */ ir_start = RC5_START_BITS_NORMAL; /* A basic RC-5 remote */
...@@ -400,7 +400,7 @@ int cx23885_input_init(struct cx23885_dev *dev) ...@@ -400,7 +400,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
dev->ir_input = ir; dev->ir_input = ir;
cx23885_input_ir_start(dev); cx23885_input_ir_start(dev);
ret = __ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME); ret = ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME);
if (ret) if (ret)
goto err_out_stop; goto err_out_stop;
......
...@@ -245,7 +245,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -245,7 +245,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
{ {
struct cx88_IR *ir; struct cx88_IR *ir;
struct input_dev *input_dev; struct input_dev *input_dev;
struct ir_scancode_table *ir_codes = NULL; char *ir_codes = NULL;
u64 ir_type = IR_TYPE_OTHER; u64 ir_type = IR_TYPE_OTHER;
int err = -ENOMEM; int err = -ENOMEM;
...@@ -261,14 +261,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -261,14 +261,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
case CX88_BOARD_DNTV_LIVE_DVB_T: case CX88_BOARD_DNTV_LIVE_DVB_T:
case CX88_BOARD_KWORLD_DVB_T: case CX88_BOARD_KWORLD_DVB_T:
case CX88_BOARD_KWORLD_DVB_T_CX22702: case CX88_BOARD_KWORLD_DVB_T_CX22702:
ir_codes = &IR_KEYTABLE(dntv_live_dvb_t); ir_codes = RC_MAP_DNTV_LIVE_DVB_T;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f; ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x60; ir->mask_keyup = 0x60;
ir->polling = 50; /* ms */ ir->polling = 50; /* ms */
break; break;
case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
ir_codes = &IR_KEYTABLE(cinergy_1400); ir_codes = RC_MAP_CINERGY_1400;
ir_type = IR_TYPE_PD; ir_type = IR_TYPE_PD;
ir->sampling = 0xeb04; /* address */ ir->sampling = 0xeb04; /* address */
break; break;
...@@ -283,14 +283,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -283,14 +283,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
case CX88_BOARD_PCHDTV_HD3000: case CX88_BOARD_PCHDTV_HD3000:
case CX88_BOARD_PCHDTV_HD5500: case CX88_BOARD_PCHDTV_HD5500:
case CX88_BOARD_HAUPPAUGE_IRONLY: case CX88_BOARD_HAUPPAUGE_IRONLY:
ir_codes = &IR_KEYTABLE(hauppauge_new); ir_codes = RC_MAP_HAUPPAUGE_NEW;
ir_type = IR_TYPE_RC5; ir_type = IR_TYPE_RC5;
ir->sampling = 1; ir->sampling = 1;
break; break;
case CX88_BOARD_WINFAST_DTV2000H: case CX88_BOARD_WINFAST_DTV2000H:
case CX88_BOARD_WINFAST_DTV2000H_J: case CX88_BOARD_WINFAST_DTV2000H_J:
case CX88_BOARD_WINFAST_DTV1800H: case CX88_BOARD_WINFAST_DTV1800H:
ir_codes = &IR_KEYTABLE(winfast); ir_codes = RC_MAP_WINFAST;
ir->gpio_addr = MO_GP0_IO; ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0x8f8; ir->mask_keycode = 0x8f8;
ir->mask_keyup = 0x100; ir->mask_keyup = 0x100;
...@@ -299,14 +299,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -299,14 +299,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
case CX88_BOARD_WINFAST2000XP_EXPERT: case CX88_BOARD_WINFAST2000XP_EXPERT:
case CX88_BOARD_WINFAST_DTV1000: case CX88_BOARD_WINFAST_DTV1000:
case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
ir_codes = &IR_KEYTABLE(winfast); ir_codes = RC_MAP_WINFAST;
ir->gpio_addr = MO_GP0_IO; ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0x8f8; ir->mask_keycode = 0x8f8;
ir->mask_keyup = 0x100; ir->mask_keyup = 0x100;
ir->polling = 1; /* ms */ ir->polling = 1; /* ms */
break; break;
case CX88_BOARD_IODATA_GVBCTV7E: case CX88_BOARD_IODATA_GVBCTV7E:
ir_codes = &IR_KEYTABLE(iodata_bctv7e); ir_codes = RC_MAP_IODATA_BCTV7E;
ir->gpio_addr = MO_GP0_IO; ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0xfd; ir->mask_keycode = 0xfd;
ir->mask_keydown = 0x02; ir->mask_keydown = 0x02;
...@@ -314,7 +314,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -314,7 +314,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
break; break;
case CX88_BOARD_PROLINK_PLAYTVPVR: case CX88_BOARD_PROLINK_PLAYTVPVR:
case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO: case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO:
ir_codes = &IR_KEYTABLE(pixelview); ir_codes = RC_MAP_PIXELVIEW;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f; ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x80; ir->mask_keyup = 0x80;
...@@ -322,28 +322,28 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -322,28 +322,28 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
break; break;
case CX88_BOARD_PROLINK_PV_8000GT: case CX88_BOARD_PROLINK_PV_8000GT:
case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME: case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
ir_codes = &IR_KEYTABLE(pixelview_new); ir_codes = RC_MAP_PIXELVIEW_NEW;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x3f; ir->mask_keycode = 0x3f;
ir->mask_keyup = 0x80; ir->mask_keyup = 0x80;
ir->polling = 1; /* ms */ ir->polling = 1; /* ms */
break; break;
case CX88_BOARD_KWORLD_LTV883: case CX88_BOARD_KWORLD_LTV883:
ir_codes = &IR_KEYTABLE(pixelview); ir_codes = RC_MAP_PIXELVIEW;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f; ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x60; ir->mask_keyup = 0x60;
ir->polling = 1; /* ms */ ir->polling = 1; /* ms */
break; break;
case CX88_BOARD_ADSTECH_DVB_T_PCI: case CX88_BOARD_ADSTECH_DVB_T_PCI:
ir_codes = &IR_KEYTABLE(adstech_dvb_t_pci); ir_codes = RC_MAP_ADSTECH_DVB_T_PCI;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0xbf; ir->mask_keycode = 0xbf;
ir->mask_keyup = 0x40; ir->mask_keyup = 0x40;
ir->polling = 50; /* ms */ ir->polling = 50; /* ms */
break; break;
case CX88_BOARD_MSI_TVANYWHERE_MASTER: case CX88_BOARD_MSI_TVANYWHERE_MASTER:
ir_codes = &IR_KEYTABLE(msi_tvanywhere); ir_codes = RC_MAP_MSI_TVANYWHERE;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f; ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x40; ir->mask_keyup = 0x40;
...@@ -351,7 +351,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -351,7 +351,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
break; break;
case CX88_BOARD_AVERTV_303: case CX88_BOARD_AVERTV_303:
case CX88_BOARD_AVERTV_STUDIO_303: case CX88_BOARD_AVERTV_STUDIO_303:
ir_codes = &IR_KEYTABLE(avertv_303); ir_codes = RC_MAP_AVERTV_303;
ir->gpio_addr = MO_GP2_IO; ir->gpio_addr = MO_GP2_IO;
ir->mask_keycode = 0xfb; ir->mask_keycode = 0xfb;
ir->mask_keydown = 0x02; ir->mask_keydown = 0x02;
...@@ -364,41 +364,41 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -364,41 +364,41 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
case CX88_BOARD_PROF_7300: case CX88_BOARD_PROF_7300:
case CX88_BOARD_PROF_7301: case CX88_BOARD_PROF_7301:
case CX88_BOARD_PROF_6200: case CX88_BOARD_PROF_6200:
ir_codes = &IR_KEYTABLE(tbs_nec); ir_codes = RC_MAP_TBS_NEC;
ir_type = IR_TYPE_PD; ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */ ir->sampling = 0xff00; /* address */
break; break;
case CX88_BOARD_TEVII_S460: case CX88_BOARD_TEVII_S460:
case CX88_BOARD_TEVII_S420: case CX88_BOARD_TEVII_S420:
ir_codes = &IR_KEYTABLE(tevii_nec); ir_codes = RC_MAP_TEVII_NEC;
ir_type = IR_TYPE_PD; ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */ ir->sampling = 0xff00; /* address */
break; break;
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
ir_codes = &IR_KEYTABLE(dntv_live_dvbt_pro); ir_codes = RC_MAP_DNTV_LIVE_DVBT_PRO;
ir_type = IR_TYPE_PD; ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */ ir->sampling = 0xff00; /* address */
break; break;
case CX88_BOARD_NORWOOD_MICRO: case CX88_BOARD_NORWOOD_MICRO:
ir_codes = &IR_KEYTABLE(norwood); ir_codes = RC_MAP_NORWOOD;
ir->gpio_addr = MO_GP1_IO; ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x0e; ir->mask_keycode = 0x0e;
ir->mask_keyup = 0x80; ir->mask_keyup = 0x80;
ir->polling = 50; /* ms */ ir->polling = 50; /* ms */
break; break;
case CX88_BOARD_NPGTECH_REALTV_TOP10FM: case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
ir_codes = &IR_KEYTABLE(npgtech); ir_codes = RC_MAP_NPGTECH;
ir->gpio_addr = MO_GP0_IO; ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0xfa; ir->mask_keycode = 0xfa;
ir->polling = 50; /* ms */ ir->polling = 50; /* ms */
break; break;
case CX88_BOARD_PINNACLE_PCTV_HD_800i: case CX88_BOARD_PINNACLE_PCTV_HD_800i:
ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd); ir_codes = RC_MAP_PINNACLE_PCTV_HD;
ir_type = IR_TYPE_RC5; ir_type = IR_TYPE_RC5;
ir->sampling = 1; ir->sampling = 1;
break; break;
case CX88_BOARD_POWERCOLOR_REAL_ANGEL: case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
ir_codes = &IR_KEYTABLE(powercolor_real_angel); ir_codes = RC_MAP_POWERCOLOR_REAL_ANGEL;
ir->gpio_addr = MO_GP2_IO; ir->gpio_addr = MO_GP2_IO;
ir->mask_keycode = 0x7e; ir->mask_keycode = 0x7e;
ir->polling = 100; /* ms */ ir->polling = 100; /* ms */
...@@ -439,7 +439,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ...@@ -439,7 +439,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
ir->props.close = cx88_ir_close; ir->props.close = cx88_ir_close;
/* all done */ /* all done */
err = __ir_input_register(ir->input, ir_codes, &ir->props, MODULE_NAME); err = ir_input_register(ir->input, ir_codes, &ir->props, MODULE_NAME);
if (err) if (err)
goto err_out_free; goto err_out_free;
......
...@@ -602,7 +602,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -602,7 +602,7 @@ struct em28xx_board em28xx_boards[] = {
.name = "Gadmei UTV330+", .name = "Gadmei UTV330+",
.tuner_type = TUNER_TNF_5335MF, .tuner_type = TUNER_TNF_5335MF,
.tda9887_conf = TDA9887_PRESENT, .tda9887_conf = TDA9887_PRESENT,
.ir_codes = &IR_KEYTABLE(gadmei_rm008z), .ir_codes = RC_MAP_GADMEI_RM008Z,
.decoder = EM28XX_SAA711X, .decoder = EM28XX_SAA711X,
.xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
.input = { { .input = { {
...@@ -791,7 +791,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -791,7 +791,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = hauppauge_wintv_hvr_900_digital, .dvb_gpio = hauppauge_wintv_hvr_900_digital,
.ir_codes = &IR_KEYTABLE(hauppauge_new), .ir_codes = RC_MAP_HAUPPAUGE_NEW,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -816,7 +816,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -816,7 +816,7 @@ struct em28xx_board em28xx_boards[] = {
.tuner_type = TUNER_XC2028, .tuner_type = TUNER_XC2028,
.tuner_gpio = default_tuner_gpio, .tuner_gpio = default_tuner_gpio,
.mts_firmware = 1, .mts_firmware = 1,
.ir_codes = &IR_KEYTABLE(hauppauge_new), .ir_codes = RC_MAP_HAUPPAUGE_NEW,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -842,7 +842,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -842,7 +842,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = hauppauge_wintv_hvr_900_digital, .dvb_gpio = hauppauge_wintv_hvr_900_digital,
.ir_codes = &IR_KEYTABLE(hauppauge_new), .ir_codes = RC_MAP_HAUPPAUGE_NEW,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -868,7 +868,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -868,7 +868,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = hauppauge_wintv_hvr_900_digital, .dvb_gpio = hauppauge_wintv_hvr_900_digital,
.ir_codes = &IR_KEYTABLE(rc5_hauppauge_new), .ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -894,7 +894,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -894,7 +894,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = hauppauge_wintv_hvr_900_digital, .dvb_gpio = hauppauge_wintv_hvr_900_digital,
.ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd), .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -920,7 +920,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -920,7 +920,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = hauppauge_wintv_hvr_900_digital, .dvb_gpio = hauppauge_wintv_hvr_900_digital,
.ir_codes = &IR_KEYTABLE(ati_tv_wonder_hd_600), .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -946,7 +946,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -946,7 +946,7 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = default_digital, .dvb_gpio = default_digital,
.ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
.xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -1296,7 +1296,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -1296,7 +1296,7 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA711X, .decoder = EM28XX_SAA711X,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = em2882_kworld_315u_digital, .dvb_gpio = em2882_kworld_315u_digital,
.ir_codes = &IR_KEYTABLE(kworld_315u), .ir_codes = RC_MAP_KWORLD_315U,
.xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE, .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
/* Analog mode - still not ready */ /* Analog mode - still not ready */
...@@ -1425,7 +1425,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -1425,7 +1425,7 @@ struct em28xx_board em28xx_boards[] = {
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = kworld_330u_digital, .dvb_gpio = kworld_330u_digital,
.xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */ .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
.ir_codes = &IR_KEYTABLE(kworld_315u), .ir_codes = RC_MAP_KWORLD_315U,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
.vmux = TVP5150_COMPOSITE0, .vmux = TVP5150_COMPOSITE0,
...@@ -1448,7 +1448,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -1448,7 +1448,7 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = hauppauge_wintv_hvr_900_digital, .dvb_gpio = hauppauge_wintv_hvr_900_digital,
.ir_codes = &IR_KEYTABLE(terratec_cinergy_xs), .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
.xclk = EM28XX_XCLK_FREQUENCY_12MHZ, .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -1541,7 +1541,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -1541,7 +1541,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.tuner_gpio = default_tuner_gpio, .tuner_gpio = default_tuner_gpio,
.ir_codes = &IR_KEYTABLE(kaiomy), .ir_codes = RC_MAP_KAIOMY,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
.vmux = TVP5150_COMPOSITE0, .vmux = TVP5150_COMPOSITE0,
...@@ -1641,7 +1641,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -1641,7 +1641,7 @@ struct em28xx_board em28xx_boards[] = {
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = evga_indtube_digital, .dvb_gpio = evga_indtube_digital,
.ir_codes = &IR_KEYTABLE(evga_indtube), .ir_codes = RC_MAP_EVGA_INDTUBE,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
.vmux = TVP5150_COMPOSITE0, .vmux = TVP5150_COMPOSITE0,
...@@ -2335,21 +2335,21 @@ void em28xx_register_i2c_ir(struct em28xx *dev) ...@@ -2335,21 +2335,21 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
switch (dev->model) { switch (dev->model) {
case EM2800_BOARD_TERRATEC_CINERGY_200: case EM2800_BOARD_TERRATEC_CINERGY_200:
case EM2820_BOARD_TERRATEC_CINERGY_250: case EM2820_BOARD_TERRATEC_CINERGY_250:
dev->init_data.ir_codes = &IR_KEYTABLE(em_terratec); dev->init_data.ir_codes = RC_MAP_EM_TERRATEC;
dev->init_data.get_key = em28xx_get_key_terratec; dev->init_data.get_key = em28xx_get_key_terratec;
dev->init_data.name = "i2c IR (EM28XX Terratec)"; dev->init_data.name = "i2c IR (EM28XX Terratec)";
break; break;
case EM2820_BOARD_PINNACLE_USB_2: case EM2820_BOARD_PINNACLE_USB_2:
dev->init_data.ir_codes = &IR_KEYTABLE(pinnacle_grey); dev->init_data.ir_codes = RC_MAP_PINNACLE_GREY;
dev->init_data.get_key = em28xx_get_key_pinnacle_usb_grey; dev->init_data.get_key = em28xx_get_key_pinnacle_usb_grey;
dev->init_data.name = "i2c IR (EM28XX Pinnacle PCTV)"; dev->init_data.name = "i2c IR (EM28XX Pinnacle PCTV)";
break; break;
case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
dev->init_data.ir_codes = &IR_KEYTABLE(rc5_hauppauge_new); dev->init_data.ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW;
dev->init_data.get_key = em28xx_get_key_em_haup; dev->init_data.get_key = em28xx_get_key_em_haup;
dev->init_data.name = "i2c IR (EM2840 Hauppauge)"; dev->init_data.name = "i2c IR (EM2840 Hauppauge)";
case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE:
dev->init_data.ir_codes = &IR_KEYTABLE(winfast_usbii_deluxe);; dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE;;
dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe; dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe;
dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)"; dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)";
break; break;
......
...@@ -382,7 +382,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type) ...@@ -382,7 +382,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type)
/* Adjust xclk based o IR table for RC5/NEC tables */ /* Adjust xclk based o IR table for RC5/NEC tables */
dev->board.ir_codes->ir_type = IR_TYPE_OTHER;
if (ir_type == IR_TYPE_RC5) { if (ir_type == IR_TYPE_RC5) {
dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE; dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE;
ir->full_code = 1; ir->full_code = 1;
...@@ -393,8 +392,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type) ...@@ -393,8 +392,6 @@ int em28xx_ir_change_protocol(void *priv, u64 ir_type)
} else } else
rc = -EINVAL; rc = -EINVAL;
dev->board.ir_codes->ir_type = ir_type;
em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk,
EM28XX_XCLK_IR_RC5_MODE); EM28XX_XCLK_IR_RC5_MODE);
...@@ -457,7 +454,6 @@ int em28xx_ir_init(struct em28xx *dev) ...@@ -457,7 +454,6 @@ int em28xx_ir_init(struct em28xx *dev)
strlcat(ir->phys, "/input0", sizeof(ir->phys)); strlcat(ir->phys, "/input0", sizeof(ir->phys));
/* Set IR protocol */ /* Set IR protocol */
em28xx_ir_change_protocol(ir, dev->board.ir_codes->ir_type);
err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER); err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER);
if (err < 0) if (err < 0)
goto err_out_free; goto err_out_free;
...@@ -475,7 +471,7 @@ int em28xx_ir_init(struct em28xx *dev) ...@@ -475,7 +471,7 @@ int em28xx_ir_init(struct em28xx *dev)
em28xx_ir_start(ir); em28xx_ir_start(ir);
/* all done */ /* all done */
err = __ir_input_register(ir->input, dev->board.ir_codes, err = ir_input_register(ir->input, dev->board.ir_codes,
&ir->props, MODULE_NAME); &ir->props, MODULE_NAME);
if (err) if (err)
goto err_out_stop; goto err_out_stop;
......
...@@ -412,7 +412,7 @@ struct em28xx_board { ...@@ -412,7 +412,7 @@ struct em28xx_board {
struct em28xx_input input[MAX_EM28XX_INPUT]; struct em28xx_input input[MAX_EM28XX_INPUT];
struct em28xx_input radio; struct em28xx_input radio;
struct ir_scancode_table *ir_codes; char *ir_codes;
}; };
struct em28xx_eeprom { struct em28xx_eeprom {
......
...@@ -297,7 +297,7 @@ static void ir_work(struct work_struct *work) ...@@ -297,7 +297,7 @@ static void ir_work(struct work_struct *work)
static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
{ {
struct ir_scancode_table *ir_codes = NULL; char *ir_codes = NULL;
const char *name = NULL; const char *name = NULL;
u64 ir_type = 0; u64 ir_type = 0;
struct IR_i2c *ir; struct IR_i2c *ir;
...@@ -322,13 +322,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -322,13 +322,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
name = "Pixelview"; name = "Pixelview";
ir->get_key = get_key_pixelview; ir->get_key = get_key_pixelview;
ir_type = IR_TYPE_OTHER; ir_type = IR_TYPE_OTHER;
ir_codes = &IR_KEYTABLE(empty); ir_codes = RC_MAP_EMPTY;
break; break;
case 0x4b: case 0x4b:
name = "PV951"; name = "PV951";
ir->get_key = get_key_pv951; ir->get_key = get_key_pv951;
ir_type = IR_TYPE_OTHER; ir_type = IR_TYPE_OTHER;
ir_codes = &IR_KEYTABLE(pv951); ir_codes = RC_MAP_PV951;
break; break;
case 0x18: case 0x18:
case 0x1f: case 0x1f:
...@@ -337,22 +337,22 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -337,22 +337,22 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
ir->get_key = get_key_haup; ir->get_key = get_key_haup;
ir_type = IR_TYPE_RC5; ir_type = IR_TYPE_RC5;
if (hauppauge == 1) { if (hauppauge == 1) {
ir_codes = &IR_KEYTABLE(hauppauge_new); ir_codes = RC_MAP_HAUPPAUGE_NEW;
} else { } else {
ir_codes = &IR_KEYTABLE(rc5_tv); ir_codes = RC_MAP_RC5_TV;
} }
break; break;
case 0x30: case 0x30:
name = "KNC One"; name = "KNC One";
ir->get_key = get_key_knc1; ir->get_key = get_key_knc1;
ir_type = IR_TYPE_OTHER; ir_type = IR_TYPE_OTHER;
ir_codes = &IR_KEYTABLE(empty); ir_codes = RC_MAP_EMPTY;
break; break;
case 0x6b: case 0x6b:
name = "FusionHDTV"; name = "FusionHDTV";
ir->get_key = get_key_fusionhdtv; ir->get_key = get_key_fusionhdtv;
ir_type = IR_TYPE_RC5; ir_type = IR_TYPE_RC5;
ir_codes = &IR_KEYTABLE(fusionhdtv_mce); ir_codes = RC_MAP_FUSIONHDTV_MCE;
break; break;
case 0x0b: case 0x0b:
case 0x47: case 0x47:
...@@ -365,9 +365,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -365,9 +365,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
ir_type = IR_TYPE_RC5; ir_type = IR_TYPE_RC5;
ir->get_key = get_key_haup_xvr; ir->get_key = get_key_haup_xvr;
if (hauppauge == 1) { if (hauppauge == 1) {
ir_codes = &IR_KEYTABLE(hauppauge_new); ir_codes = RC_MAP_HAUPPAUGE_NEW;
} else { } else {
ir_codes = &IR_KEYTABLE(rc5_tv); ir_codes = RC_MAP_RC5_TV;
} }
} else { } else {
/* Handled by saa7134-input */ /* Handled by saa7134-input */
...@@ -379,7 +379,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -379,7 +379,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
name = "AVerMedia Cardbus remote"; name = "AVerMedia Cardbus remote";
ir->get_key = get_key_avermedia_cardbus; ir->get_key = get_key_avermedia_cardbus;
ir_type = IR_TYPE_OTHER; ir_type = IR_TYPE_OTHER;
ir_codes = &IR_KEYTABLE(avermedia_cardbus); ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
break; break;
} }
...@@ -447,7 +447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -447,7 +447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
input_dev->name = ir->name; input_dev->name = ir->name;
input_dev->phys = ir->phys; input_dev->phys = ir->phys;
err = __ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME); err = ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME);
if (err) if (err)
goto err_out_free; goto err_out_free;
......
...@@ -193,7 +193,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) ...@@ -193,7 +193,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
/* Our default information for ir-kbd-i2c.c to use */ /* Our default information for ir-kbd-i2c.c to use */
switch (hw) { switch (hw) {
case IVTV_HW_I2C_IR_RX_AVER: case IVTV_HW_I2C_IR_RX_AVER:
init_data->ir_codes = &IR_KEYTABLE(avermedia_cardbus); init_data->ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
init_data->internal_get_key_func = init_data->internal_get_key_func =
IR_KBD_GET_KEY_AVERMEDIA_CARDBUS; IR_KBD_GET_KEY_AVERMEDIA_CARDBUS;
init_data->type = IR_TYPE_OTHER; 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,14 +202,14 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
case IVTV_HW_I2C_IR_RX_HAUP_EXT: case IVTV_HW_I2C_IR_RX_HAUP_EXT:
case IVTV_HW_I2C_IR_RX_HAUP_INT: case IVTV_HW_I2C_IR_RX_HAUP_INT:
/* Default to old black remote */ /* Default to old black remote */
init_data->ir_codes = &IR_KEYTABLE(rc5_tv); init_data->ir_codes = RC_MAP_RC5_TV;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP; init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
init_data->type = IR_TYPE_RC5; init_data->type = IR_TYPE_RC5;
init_data->name = itv->card_name; init_data->name = itv->card_name;
break; break;
case IVTV_HW_Z8F0811_IR_RX_HAUP: case IVTV_HW_Z8F0811_IR_RX_HAUP:
/* Default to grey remote */ /* Default to grey remote */
init_data->ir_codes = &IR_KEYTABLE(hauppauge_new); init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
init_data->type = IR_TYPE_RC5; init_data->type = IR_TYPE_RC5;
init_data->name = itv->card_name; init_data->name = itv->card_name;
......
This diff is collapsed.
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/kfifo.h> #include <linux/kfifo.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <media/rc-map.h>
extern int ir_core_debug; extern int ir_core_debug;
#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
...@@ -124,6 +125,7 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname)) ...@@ -124,6 +125,7 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname))
int ir_register_map(struct rc_keymap *map); int ir_register_map(struct rc_keymap *map);
void ir_unregister_map(struct rc_keymap *map); void ir_unregister_map(struct rc_keymap *map);
struct ir_scancode_table *get_rc_map(const char *name); struct ir_scancode_table *get_rc_map(const char *name);
void rc_map_init(void);
/* Routines from ir-keytable.c */ /* Routines from ir-keytable.c */
...@@ -141,15 +143,30 @@ static inline int ir_input_register(struct input_dev *dev, ...@@ -141,15 +143,30 @@ static inline int ir_input_register(struct input_dev *dev,
const struct ir_dev_props *props, const struct ir_dev_props *props,
const char *driver_name) { const char *driver_name) {
struct ir_scancode_table *ir_codes; struct ir_scancode_table *ir_codes;
struct ir_input_dev *ir_dev;
int rc;
if (!map_name)
return -EINVAL;
ir_codes = get_rc_map(map_name); ir_codes = get_rc_map(map_name);
if (!ir_codes) if (!ir_codes)
return -EINVAL; return -EINVAL;
return __ir_input_register(dev, ir_codes, props, driver_name); rc = __ir_input_register(dev, ir_codes, props, driver_name);
if (rc < 0)
return -EINVAL;
ir_dev = input_get_drvdata(dev);
if (!rc && ir_dev->props && ir_dev->props->change_protocol)
rc = ir_dev->props->change_protocol(ir_dev->props->priv,
ir_codes->ir_type);
return rc;
} }
void ir_input_unregister(struct input_dev *input_dev); void ir_input_unregister(struct input_dev *input_dev);
/* Routines from ir-sysfs.c */ /* Routines from ir-sysfs.c */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
struct IR_i2c; struct IR_i2c;
struct IR_i2c { struct IR_i2c {
struct ir_scancode_table *ir_codes; char *ir_codes;
struct i2c_client *c; struct i2c_client *c;
struct input_dev *input; struct input_dev *input;
...@@ -34,7 +34,7 @@ enum ir_kbd_get_key_fn { ...@@ -34,7 +34,7 @@ enum ir_kbd_get_key_fn {
/* Can be passed when instantiating an ir_video i2c device */ /* Can be passed when instantiating an ir_video i2c device */
struct IR_i2c_init_data { struct IR_i2c_init_data {
struct ir_scancode_table *ir_codes; char *ir_codes;
const char *name; const char *name;
u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */
/* /*
......
/*
* rc-map.h - define RC map names used by RC drivers
*
* Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <media/ir-core.h>
#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci"
#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp"
#define RC_MAP_ASUS_PC39 "rc-asus-pc39"
#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600"
#define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d"
#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus"
#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
#define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx"
#define RC_MAP_AVERMEDIA "rc-avermedia"
#define RC_MAP_AVERTV_303 "rc-avertv-303"
#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"
#define RC_MAP_BEHOLD "rc-behold"
#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"
#define RC_MAP_CINERGY_1400 "rc-cinergy-1400"
#define RC_MAP_CINERGY "rc-cinergy"
#define RC_MAP_DM1105_NEC "rc-dm1105-nec"
#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro"
#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t"
#define RC_MAP_EMPTY "rc-empty"
#define RC_MAP_EM_TERRATEC "rc-em-terratec"
#define RC_MAP_ENCORE_ENLTV2 "rc-encore-enltv2"
#define RC_MAP_ENCORE_ENLTV_FM53 "rc-encore-enltv-fm53"
#define RC_MAP_ENCORE_ENLTV "rc-encore-enltv"
#define RC_MAP_EVGA_INDTUBE "rc-evga-indtube"
#define RC_MAP_EZTV "rc-eztv"
#define RC_MAP_FLYDVB "rc-flydvb"
#define RC_MAP_FLYVIDEO "rc-flyvideo"
#define RC_MAP_FUSIONHDTV_MCE "rc-fusionhdtv-mce"
#define RC_MAP_GADMEI_RM008Z "rc-gadmei-rm008z"
#define RC_MAP_GENIUS_TVGO_A11MCE "rc-genius-tvgo-a11mce"
#define RC_MAP_GOTVIEW7135 "rc-gotview7135"
#define RC_MAP_HAUPPAUGE_NEW "rc-hauppauge-new"
#define RC_MAP_IODATA_BCTV7E "rc-iodata-bctv7e"
#define RC_MAP_KAIOMY "rc-kaiomy"
#define RC_MAP_KWORLD_315U "rc-kworld-315u"
#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"
#define RC_MAP_MANLI "rc-manli"
#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus"
#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere"
#define RC_MAP_NEBULA "rc-nebula"
#define RC_MAP_NEC_TERRATEC_CINERGY_XS "rc-nec-terratec-cinergy-xs"
#define RC_MAP_NORWOOD "rc-norwood"
#define RC_MAP_NPGTECH "rc-npgtech"
#define RC_MAP_PCTV_SEDNA "rc-pctv-sedna"
#define RC_MAP_PINNACLE_COLOR "rc-pinnacle-color"
#define RC_MAP_PINNACLE_GREY "rc-pinnacle-grey"
#define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd"
#define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new"
#define RC_MAP_PIXELVIEW "rc-pixelview"
#define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel"
#define RC_MAP_PROTEUS_2309 "rc-proteus-2309"
#define RC_MAP_PURPLETV "rc-purpletv"
#define RC_MAP_PV951 "rc-pv951"
#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new"
#define RC_MAP_RC5_TV "rc-rc5-tv"
#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
#define RC_MAP_TBS_NEC "rc-tbs-nec"
#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs"
#define RC_MAP_TEVII_NEC "rc-tevii-nec"
#define RC_MAP_TT_1500 "rc-tt-1500"
#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350"
#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
#define RC_MAP_WINFAST "rc-winfast"
#define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe"
/*
* Please, do not just append newer Remote Controller names at the end.
* The names should be ordered in alphabetical order
*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment