diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-04-02 03:23:38 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 17:56:47 +0200 |
commit | dce4a3e3b228fd31bcfd2d84e673bc08b553e6cc (patch) | |
tree | 2719bc5db9684b07e05b433a45cc03517ed2b9d8 /include/media/ir-common.h | |
parent | V4L/DVB: rename all *_rc_keys to ir_codes_*_nec_table (diff) | |
download | linux-dce4a3e3b228fd31bcfd2d84e673bc08b553e6cc.tar.xz linux-dce4a3e3b228fd31bcfd2d84e673bc08b553e6cc.zip |
V4L/DVB: ir-common: Use macros to define the keytables
The usage of macros ensures that the proper namespace is being used
by all tables. It also makes easier to associate a keytable with
the name used inside the drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | include/media/ir-common.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 2e275154aef3..e8a64761df56 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h @@ -107,11 +107,23 @@ void ir_rc5_timer_keyup(unsigned long data); /* scancode->keycode map tables from ir-keymaps.c */ #define IR_KEYTABLE(a) \ -(ir_codes_ ## a ## _table) +ir_codes_ ## a ## _table #define DECLARE_IR_KEYTABLE(a) \ extern struct ir_scancode_table IR_KEYTABLE(a) +#define DEFINE_IR_KEYTABLE(tabname, type) \ +struct ir_scancode_table IR_KEYTABLE(tabname) = { \ + .scan = tabname, \ + .size = ARRAY_SIZE(tabname), \ + .ir_type = type, \ + .name = #tabname, \ +}; \ +EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname)) + +#define DEFINE_LEGACY_IR_KEYTABLE(tabname) \ + DEFINE_IR_KEYTABLE(tabname, IR_TYPE_UNKNOWN) + DECLARE_IR_KEYTABLE(adstech_dvb_t_pci); DECLARE_IR_KEYTABLE(apac_viewcomp); DECLARE_IR_KEYTABLE(asus_pc39); |