Skip to content

Commit

Permalink
V4L/DVB: ir: use IR_KEYTABLE where an IR table is needed
Browse files Browse the repository at this point in the history
Replaces most of the occurences of IR keytables on V4L drivers by a macro
that evaluates to provide the name of the exported symbol.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed May 19, 2010
1 parent 165344b commit d705d2a
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dm1105/dm1105.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
{
struct input_dev *input_dev;
struct ir_scancode_table *ir_codes = &ir_codes_dm1105_nec_table;
struct ir_scancode_table *ir_codes = &IR_KEYTABLE(dm1105_nec);
u64 ir_type = IR_TYPE_OTHER;
int err = -ENOMEM;

Expand Down
6 changes: 3 additions & 3 deletions drivers/media/dvb/ttpci/budget-ci.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
case 0x1011:
case 0x1012:
/* The hauppauge keymap is a superset of these remotes */
ir_codes = &ir_codes_hauppauge_new_table;
ir_codes = &IR_KEYTABLE(hauppauge_new);

if (rc5_device < 0)
budget_ci->ir.rc5_device = 0x1f;
Expand All @@ -241,11 +241,11 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
case 0x1017:
case 0x101a:
/* for the Technotrend 1500 bundled remote */
ir_codes = &ir_codes_tt_1500_table;
ir_codes = &IR_KEYTABLE(tt_1500);
break;
default:
/* unknown remote */
ir_codes = &ir_codes_budget_ci_old_table;
ir_codes = &IR_KEYTABLE(budget_ci_old);
break;
}

Expand Down
24 changes: 12 additions & 12 deletions drivers/media/video/bt8xx/bttv-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,78 +266,78 @@ int bttv_input_init(struct bttv *btv)
case BTTV_BOARD_AVERMEDIA:
case BTTV_BOARD_AVPHONE98:
case BTTV_BOARD_AVERMEDIA98:
ir_codes = &ir_codes_avermedia_table;
ir_codes = &IR_KEYTABLE(avermedia);
ir->mask_keycode = 0xf88000;
ir->mask_keydown = 0x010000;
ir->polling = 50; // ms
break;

case BTTV_BOARD_AVDVBT_761:
case BTTV_BOARD_AVDVBT_771:
ir_codes = &ir_codes_avermedia_dvbt_table;
ir_codes = &IR_KEYTABLE(avermedia_dvbt);
ir->mask_keycode = 0x0f00c0;
ir->mask_keydown = 0x000020;
ir->polling = 50; // ms
break;

case BTTV_BOARD_PXELVWPLTVPAK:
ir_codes = &ir_codes_pixelview_table;
ir_codes = &IR_KEYTABLE(pixelview);
ir->mask_keycode = 0x003e00;
ir->mask_keyup = 0x010000;
ir->polling = 50; // ms
break;
case BTTV_BOARD_PV_M4900:
case BTTV_BOARD_PV_BT878P_9B:
case BTTV_BOARD_PV_BT878P_PLUS:
ir_codes = &ir_codes_pixelview_table;
ir_codes = &IR_KEYTABLE(pixelview);
ir->mask_keycode = 0x001f00;
ir->mask_keyup = 0x008000;
ir->polling = 50; // ms
break;

case BTTV_BOARD_WINFAST2000:
ir_codes = &ir_codes_winfast_table;
ir_codes = &IR_KEYTABLE(winfast);
ir->mask_keycode = 0x1f8;
break;
case BTTV_BOARD_MAGICTVIEW061:
case BTTV_BOARD_MAGICTVIEW063:
ir_codes = &ir_codes_winfast_table;
ir_codes = &IR_KEYTABLE(winfast);
ir->mask_keycode = 0x0008e000;
ir->mask_keydown = 0x00200000;
break;
case BTTV_BOARD_APAC_VIEWCOMP:
ir_codes = &ir_codes_apac_viewcomp_table;
ir_codes = &IR_KEYTABLE(apac_viewcomp);
ir->mask_keycode = 0x001f00;
ir->mask_keyup = 0x008000;
ir->polling = 50; // ms
break;
case BTTV_BOARD_ASKEY_CPH03X:
case BTTV_BOARD_CONCEPTRONIC_CTVFMI2:
case BTTV_BOARD_CONTVFMI:
ir_codes = &ir_codes_pixelview_table;
ir_codes = &IR_KEYTABLE(pixelview);
ir->mask_keycode = 0x001F00;
ir->mask_keyup = 0x006000;
ir->polling = 50; // ms
break;
case BTTV_BOARD_NEBULA_DIGITV:
ir_codes = &ir_codes_nebula_table;
ir_codes = &IR_KEYTABLE(nebula);
btv->custom_irq = bttv_rc5_irq;
ir->rc5_gpio = 1;
break;
case BTTV_BOARD_MACHTV_MAGICTV:
ir_codes = &ir_codes_apac_viewcomp_table;
ir_codes = &IR_KEYTABLE(apac_viewcomp);
ir->mask_keycode = 0x001F00;
ir->mask_keyup = 0x004000;
ir->polling = 50; /* ms */
break;
case BTTV_BOARD_KOZUMI_KTV_01C:
ir_codes = &ir_codes_pctv_sedna_table;
ir_codes = &IR_KEYTABLE(pctv_sedna);
ir->mask_keycode = 0x001f00;
ir->mask_keyup = 0x006000;
ir->polling = 50; /* ms */
break;
case BTTV_BOARD_ENLTV_FM_2:
ir_codes = &ir_codes_encore_enltv2_table;
ir_codes = &IR_KEYTABLE(encore_enltv2);
ir->mask_keycode = 0x00fd00;
ir->mask_keyup = 0x000080;
ir->polling = 1; /* ms */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx18/cx18-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
switch (hw) {
case CX18_HW_Z8F0811_IR_RX_HAUP:
init_data->ir_codes = &ir_codes_hauppauge_new_table;
init_data->ir_codes = &IR_KEYTABLE(hauppauge_new);
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
init_data->type = IR_TYPE_RC5;
init_data->name = cx->card_name;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx23885/cx23885-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
case CX23885_BOARD_HAUPPAUGE_HVR1850:
case CX23885_BOARD_HAUPPAUGE_HVR1290:
/* Parameters for the grey Hauppauge remote for the HVR-1850 */
ir_codes = &ir_codes_hauppauge_new_table;
ir_codes = &IR_KEYTABLE(hauppauge_new);
ir_type = IR_TYPE_RC5;
ir_addr = 0x1e; /* RC-5 system bits emitted by the remote */
ir_start = RC5_START_BITS_NORMAL; /* A basic RC-5 remote */
Expand Down
38 changes: 19 additions & 19 deletions drivers/media/video/cx88/cx88-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_KWORLD_DVB_T:
case CX88_BOARD_KWORLD_DVB_T_CX22702:
ir_codes = &ir_codes_dntv_live_dvb_t_table;
ir_codes = &IR_KEYTABLE(dntv_live_dvb_t);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x60;
ir->polling = 50; /* ms */
break;
case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
ir_codes = &ir_codes_cinergy_1400_table;
ir_codes = &IR_KEYTABLE(cinergy_1400);
ir_type = IR_TYPE_PD;
ir->sampling = 0xeb04; /* address */
break;
Expand All @@ -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_HD5500:
case CX88_BOARD_HAUPPAUGE_IRONLY:
ir_codes = &ir_codes_hauppauge_new_table;
ir_codes = &IR_KEYTABLE(hauppauge_new);
ir_type = IR_TYPE_RC5;
ir->sampling = 1;
break;
case CX88_BOARD_WINFAST_DTV2000H:
case CX88_BOARD_WINFAST_DTV2000H_J:
case CX88_BOARD_WINFAST_DTV1800H:
ir_codes = &ir_codes_winfast_table;
ir_codes = &IR_KEYTABLE(winfast);
ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0x8f8;
ir->mask_keyup = 0x100;
Expand All @@ -299,59 +299,59 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
case CX88_BOARD_WINFAST2000XP_EXPERT:
case CX88_BOARD_WINFAST_DTV1000:
case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
ir_codes = &ir_codes_winfast_table;
ir_codes = &IR_KEYTABLE(winfast);
ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0x8f8;
ir->mask_keyup = 0x100;
ir->polling = 1; /* ms */
break;
case CX88_BOARD_IODATA_GVBCTV7E:
ir_codes = &ir_codes_iodata_bctv7e_table;
ir_codes = &IR_KEYTABLE(iodata_bctv7e);
ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0xfd;
ir->mask_keydown = 0x02;
ir->polling = 5; /* ms */
break;
case CX88_BOARD_PROLINK_PLAYTVPVR:
case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO:
ir_codes = &ir_codes_pixelview_table;
ir_codes = &IR_KEYTABLE(pixelview);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x80;
ir->polling = 1; /* ms */
break;
case CX88_BOARD_PROLINK_PV_8000GT:
case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
ir_codes = &ir_codes_pixelview_new_table;
ir_codes = &IR_KEYTABLE(pixelview_new);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x3f;
ir->mask_keyup = 0x80;
ir->polling = 1; /* ms */
break;
case CX88_BOARD_KWORLD_LTV883:
ir_codes = &ir_codes_pixelview_table;
ir_codes = &IR_KEYTABLE(pixelview);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x60;
ir->polling = 1; /* ms */
break;
case CX88_BOARD_ADSTECH_DVB_T_PCI:
ir_codes = &ir_codes_adstech_dvb_t_pci_table;
ir_codes = &IR_KEYTABLE(adstech_dvb_t_pci);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0xbf;
ir->mask_keyup = 0x40;
ir->polling = 50; /* ms */
break;
case CX88_BOARD_MSI_TVANYWHERE_MASTER:
ir_codes = &ir_codes_msi_tvanywhere_table;
ir_codes = &IR_KEYTABLE(msi_tvanywhere);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x40;
ir->polling = 1; /* ms */
break;
case CX88_BOARD_AVERTV_303:
case CX88_BOARD_AVERTV_STUDIO_303:
ir_codes = &ir_codes_avertv_303_table;
ir_codes = &IR_KEYTABLE(avertv_303);
ir->gpio_addr = MO_GP2_IO;
ir->mask_keycode = 0xfb;
ir->mask_keydown = 0x02;
Expand All @@ -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_7301:
case CX88_BOARD_PROF_6200:
ir_codes = &ir_codes_tbs_nec_table;
ir_codes = &IR_KEYTABLE(tbs_nec);
ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */
break;
case CX88_BOARD_TEVII_S460:
case CX88_BOARD_TEVII_S420:
ir_codes = &ir_codes_tevii_nec_table;
ir_codes = &IR_KEYTABLE(tevii_nec);
ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */
break;
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
ir_codes = &ir_codes_dntv_live_dvbt_pro_table;
ir_codes = &IR_KEYTABLE(dntv_live_dvbt_pro);
ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */
break;
case CX88_BOARD_NORWOOD_MICRO:
ir_codes = &ir_codes_norwood_table;
ir_codes = &IR_KEYTABLE(norwood);
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x0e;
ir->mask_keyup = 0x80;
ir->polling = 50; /* ms */
break;
case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
ir_codes = &ir_codes_npgtech_table;
ir_codes = &IR_KEYTABLE(npgtech);
ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0xfa;
ir->polling = 50; /* ms */
break;
case CX88_BOARD_PINNACLE_PCTV_HD_800i:
ir_codes = &ir_codes_pinnacle_pctv_hd_table;
ir_codes = &IR_KEYTABLE(pinnacle_pctv_hd);
ir_type = IR_TYPE_RC5;
ir->sampling = 1;
break;
case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
ir_codes = &ir_codes_powercolor_real_angel_table;
ir_codes = &IR_KEYTABLE(powercolor_real_angel);
ir->gpio_addr = MO_GP2_IO;
ir->mask_keycode = 0x7e;
ir->polling = 100; /* ms */
Expand Down
Loading

0 comments on commit d705d2a

Please sign in to comment.