diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-04-02 19:01:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:56:50 -0400 |
commit | 02858eedcb78a664215b918d98cdb753ce432ce6 (patch) | |
tree | dd212b7b2e63cd846a1c9cf0d9b751514648b130 /include/media | |
parent | b2245ba1644eb1eba400fd04c6e7bb3ab2d4a8fa (diff) |
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: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ir-core.h | 21 | ||||
-rw-r--r-- | include/media/ir-kbd-i2c.h | 4 | ||||
-rw-r--r-- | include/media/rc-map.h | 81 |
3 files changed, 102 insertions, 4 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 8e975f24dae1..e1772b8230c9 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kfifo.h> | 21 | #include <linux/kfifo.h> |
22 | #include <linux/time.h> | 22 | #include <linux/time.h> |
23 | #include <linux/timer.h> | 23 | #include <linux/timer.h> |
24 | #include <media/rc-map.h> | ||
24 | 25 | ||
25 | extern int ir_core_debug; | 26 | extern int ir_core_debug; |
26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | 27 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ |
@@ -124,6 +125,7 @@ EXPORT_SYMBOL_GPL(IR_KEYTABLE(tabname)) | |||
124 | int ir_register_map(struct rc_keymap *map); | 125 | int ir_register_map(struct rc_keymap *map); |
125 | void ir_unregister_map(struct rc_keymap *map); | 126 | void ir_unregister_map(struct rc_keymap *map); |
126 | struct ir_scancode_table *get_rc_map(const char *name); | 127 | struct ir_scancode_table *get_rc_map(const char *name); |
128 | void rc_map_init(void); | ||
127 | 129 | ||
128 | /* Routines from ir-keytable.c */ | 130 | /* Routines from ir-keytable.c */ |
129 | 131 | ||
@@ -141,15 +143,30 @@ static inline int ir_input_register(struct input_dev *dev, | |||
141 | const struct ir_dev_props *props, | 143 | const struct ir_dev_props *props, |
142 | const char *driver_name) { | 144 | const char *driver_name) { |
143 | struct ir_scancode_table *ir_codes; | 145 | struct ir_scancode_table *ir_codes; |
146 | struct ir_input_dev *ir_dev; | ||
147 | int rc; | ||
148 | |||
149 | if (!map_name) | ||
150 | return -EINVAL; | ||
144 | 151 | ||
145 | ir_codes = get_rc_map(map_name); | 152 | ir_codes = get_rc_map(map_name); |
146 | if (!ir_codes) | 153 | if (!ir_codes) |
147 | return -EINVAL; | 154 | return -EINVAL; |
148 | 155 | ||
149 | return __ir_input_register(dev, ir_codes, props, driver_name); | 156 | rc = __ir_input_register(dev, ir_codes, props, driver_name); |
157 | if (rc < 0) | ||
158 | return -EINVAL; | ||
159 | |||
160 | ir_dev = input_get_drvdata(dev); | ||
161 | |||
162 | if (!rc && ir_dev->props && ir_dev->props->change_protocol) | ||
163 | rc = ir_dev->props->change_protocol(ir_dev->props->priv, | ||
164 | ir_codes->ir_type); | ||
165 | |||
166 | return rc; | ||
150 | } | 167 | } |
151 | 168 | ||
152 | void ir_input_unregister(struct input_dev *input_dev); | 169 | void ir_input_unregister(struct input_dev *input_dev); |
153 | 170 | ||
154 | /* Routines from ir-sysfs.c */ | 171 | /* Routines from ir-sysfs.c */ |
155 | 172 | ||
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 9142936603cc..057ff64f349d 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -6,7 +6,7 @@ | |||
6 | struct IR_i2c; | 6 | struct IR_i2c; |
7 | 7 | ||
8 | struct IR_i2c { | 8 | struct IR_i2c { |
9 | struct ir_scancode_table *ir_codes; | 9 | char *ir_codes; |
10 | 10 | ||
11 | struct i2c_client *c; | 11 | struct i2c_client *c; |
12 | struct input_dev *input; | 12 | struct input_dev *input; |
@@ -34,7 +34,7 @@ enum ir_kbd_get_key_fn { | |||
34 | 34 | ||
35 | /* Can be passed when instantiating an ir_video i2c device */ | 35 | /* Can be passed when instantiating an ir_video i2c device */ |
36 | struct IR_i2c_init_data { | 36 | struct IR_i2c_init_data { |
37 | struct ir_scancode_table *ir_codes; | 37 | char *ir_codes; |
38 | const char *name; | 38 | const char *name; |
39 | u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ | 39 | u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ |
40 | /* | 40 | /* |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h new file mode 100644 index 000000000000..9ea0033fa3cc --- /dev/null +++ b/include/media/rc-map.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * rc-map.h - define RC map names used by RC drivers | ||
3 | * | ||
4 | * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <media/ir-core.h> | ||
13 | |||
14 | #define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" | ||
15 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" | ||
16 | #define RC_MAP_ASUS_PC39 "rc-asus-pc39" | ||
17 | #define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" | ||
18 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" | ||
19 | #define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" | ||
20 | #define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" | ||
21 | #define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx" | ||
22 | #define RC_MAP_AVERMEDIA "rc-avermedia" | ||
23 | #define RC_MAP_AVERTV_303 "rc-avertv-303" | ||
24 | #define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" | ||
25 | #define RC_MAP_BEHOLD "rc-behold" | ||
26 | #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" | ||
27 | #define RC_MAP_CINERGY_1400 "rc-cinergy-1400" | ||
28 | #define RC_MAP_CINERGY "rc-cinergy" | ||
29 | #define RC_MAP_DM1105_NEC "rc-dm1105-nec" | ||
30 | #define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" | ||
31 | #define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" | ||
32 | #define RC_MAP_EMPTY "rc-empty" | ||
33 | #define RC_MAP_EM_TERRATEC "rc-em-terratec" | ||
34 | #define RC_MAP_ENCORE_ENLTV2 "rc-encore-enltv2" | ||
35 | #define RC_MAP_ENCORE_ENLTV_FM53 "rc-encore-enltv-fm53" | ||
36 | #define RC_MAP_ENCORE_ENLTV "rc-encore-enltv" | ||
37 | #define RC_MAP_EVGA_INDTUBE "rc-evga-indtube" | ||
38 | #define RC_MAP_EZTV "rc-eztv" | ||
39 | #define RC_MAP_FLYDVB "rc-flydvb" | ||
40 | #define RC_MAP_FLYVIDEO "rc-flyvideo" | ||
41 | #define RC_MAP_FUSIONHDTV_MCE "rc-fusionhdtv-mce" | ||
42 | #define RC_MAP_GADMEI_RM008Z "rc-gadmei-rm008z" | ||
43 | #define RC_MAP_GENIUS_TVGO_A11MCE "rc-genius-tvgo-a11mce" | ||
44 | #define RC_MAP_GOTVIEW7135 "rc-gotview7135" | ||
45 | #define RC_MAP_HAUPPAUGE_NEW "rc-hauppauge-new" | ||
46 | #define RC_MAP_IODATA_BCTV7E "rc-iodata-bctv7e" | ||
47 | #define RC_MAP_KAIOMY "rc-kaiomy" | ||
48 | #define RC_MAP_KWORLD_315U "rc-kworld-315u" | ||
49 | #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" | ||
50 | #define RC_MAP_MANLI "rc-manli" | ||
51 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" | ||
52 | #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" | ||
53 | #define RC_MAP_NEBULA "rc-nebula" | ||
54 | #define RC_MAP_NEC_TERRATEC_CINERGY_XS "rc-nec-terratec-cinergy-xs" | ||
55 | #define RC_MAP_NORWOOD "rc-norwood" | ||
56 | #define RC_MAP_NPGTECH "rc-npgtech" | ||
57 | #define RC_MAP_PCTV_SEDNA "rc-pctv-sedna" | ||
58 | #define RC_MAP_PINNACLE_COLOR "rc-pinnacle-color" | ||
59 | #define RC_MAP_PINNACLE_GREY "rc-pinnacle-grey" | ||
60 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" | ||
61 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" | ||
62 | #define RC_MAP_PIXELVIEW "rc-pixelview" | ||
63 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" | ||
64 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" | ||
65 | #define RC_MAP_PURPLETV "rc-purpletv" | ||
66 | #define RC_MAP_PV951 "rc-pv951" | ||
67 | #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" | ||
68 | #define RC_MAP_RC5_TV "rc-rc5-tv" | ||
69 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" | ||
70 | #define RC_MAP_TBS_NEC "rc-tbs-nec" | ||
71 | #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" | ||
72 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" | ||
73 | #define RC_MAP_TT_1500 "rc-tt-1500" | ||
74 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" | ||
75 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | ||
76 | #define RC_MAP_WINFAST "rc-winfast" | ||
77 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" | ||
78 | /* | ||
79 | * Please, do not just append newer Remote Controller names at the end. | ||
80 | * The names should be ordered in alphabetical order | ||
81 | */ | ||