diff options
author | Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 2010-05-10 14:43:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:22:09 -0400 |
commit | 63fc31e8d0757574edb03ed73986be56e70a75c1 (patch) | |
tree | d4ca989adb46637c5accfba8cb648ec492bd93dc | |
parent | 7e2d9820c37525da2469147eec897488ec141bcf (diff) |
V4L/DVB: saa7134: add RM-K6 remote control support for Avermedia M135A
This change adds support for one more remote control type for Avermedia
M135A (model RM-K6), shipped with Positivo machines.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/IR/keymaps/Makefile | 2 | ||||
-rw-r--r-- | drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c | 90 | ||||
-rw-r--r-- | drivers/media/IR/keymaps/rc-avermedia-m135a.c | 147 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 2 | ||||
-rw-r--r-- | include/media/rc-map.h | 2 |
5 files changed, 150 insertions, 93 deletions
diff --git a/drivers/media/IR/keymaps/Makefile b/drivers/media/IR/keymaps/Makefile index 585f75c3f376..aea649fbcf5a 100644 --- a/drivers/media/IR/keymaps/Makefile +++ b/drivers/media/IR/keymaps/Makefile | |||
@@ -6,7 +6,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ | |||
6 | rc-avermedia.o \ | 6 | rc-avermedia.o \ |
7 | rc-avermedia-cardbus.o \ | 7 | rc-avermedia-cardbus.o \ |
8 | rc-avermedia-dvbt.o \ | 8 | rc-avermedia-dvbt.o \ |
9 | rc-avermedia-m135a-rm-jx.o \ | 9 | rc-avermedia-m135a.o \ |
10 | rc-avermedia-m733a-rm-k6.o \ | 10 | rc-avermedia-m733a-rm-k6.o \ |
11 | rc-avertv-303.o \ | 11 | rc-avertv-303.o \ |
12 | rc-behold.o \ | 12 | rc-behold.o \ |
diff --git a/drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c b/drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c deleted file mode 100644 index 101e7ea85941..000000000000 --- a/drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* avermedia-m135a-rm-jx.h - Keytable for avermedia_m135a_rm_jx Remote Controller | ||
2 | * | ||
3 | * keymap imported from ir-keymaps.c | ||
4 | * | ||
5 | * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <media/rc-map.h> | ||
14 | |||
15 | /* | ||
16 | * Avermedia M135A with IR model RM-JX | ||
17 | * The same codes exist on both Positivo (BR) and original IR | ||
18 | * Mauro Carvalho Chehab <mchehab@infradead.org> | ||
19 | */ | ||
20 | |||
21 | static struct ir_scancode avermedia_m135a_rm_jx[] = { | ||
22 | { 0x0200, KEY_POWER2 }, | ||
23 | { 0x022e, KEY_DOT }, /* '.' */ | ||
24 | { 0x0201, KEY_MODE }, /* TV/FM or SOURCE */ | ||
25 | |||
26 | { 0x0205, KEY_1 }, | ||
27 | { 0x0206, KEY_2 }, | ||
28 | { 0x0207, KEY_3 }, | ||
29 | { 0x0209, KEY_4 }, | ||
30 | { 0x020a, KEY_5 }, | ||
31 | { 0x020b, KEY_6 }, | ||
32 | { 0x020d, KEY_7 }, | ||
33 | { 0x020e, KEY_8 }, | ||
34 | { 0x020f, KEY_9 }, | ||
35 | { 0x0211, KEY_0 }, | ||
36 | |||
37 | { 0x0213, KEY_RIGHT }, /* -> or L */ | ||
38 | { 0x0212, KEY_LEFT }, /* <- or R */ | ||
39 | |||
40 | { 0x0217, KEY_SLEEP }, /* Capturar Imagem or Snapshot */ | ||
41 | { 0x0210, KEY_SHUFFLE }, /* Amostra or 16 chan prev */ | ||
42 | |||
43 | { 0x0303, KEY_CHANNELUP }, | ||
44 | { 0x0302, KEY_CHANNELDOWN }, | ||
45 | { 0x021f, KEY_VOLUMEUP }, | ||
46 | { 0x021e, KEY_VOLUMEDOWN }, | ||
47 | { 0x020c, KEY_ENTER }, /* Full Screen */ | ||
48 | |||
49 | { 0x0214, KEY_MUTE }, | ||
50 | { 0x0208, KEY_AUDIO }, | ||
51 | |||
52 | { 0x0203, KEY_TEXT }, /* Teletext */ | ||
53 | { 0x0204, KEY_EPG }, | ||
54 | { 0x022b, KEY_TV2 }, /* TV2 or PIP */ | ||
55 | |||
56 | { 0x021d, KEY_RED }, | ||
57 | { 0x021c, KEY_YELLOW }, | ||
58 | { 0x0301, KEY_GREEN }, | ||
59 | { 0x0300, KEY_BLUE }, | ||
60 | |||
61 | { 0x021a, KEY_PLAYPAUSE }, | ||
62 | { 0x0219, KEY_RECORD }, | ||
63 | { 0x0218, KEY_PLAY }, | ||
64 | { 0x021b, KEY_STOP }, | ||
65 | }; | ||
66 | |||
67 | static struct rc_keymap avermedia_m135a_rm_jx_map = { | ||
68 | .map = { | ||
69 | .scan = avermedia_m135a_rm_jx, | ||
70 | .size = ARRAY_SIZE(avermedia_m135a_rm_jx), | ||
71 | .ir_type = IR_TYPE_NEC, | ||
72 | .name = RC_MAP_AVERMEDIA_M135A_RM_JX, | ||
73 | } | ||
74 | }; | ||
75 | |||
76 | static int __init init_rc_map_avermedia_m135a_rm_jx(void) | ||
77 | { | ||
78 | return ir_register_map(&avermedia_m135a_rm_jx_map); | ||
79 | } | ||
80 | |||
81 | static void __exit exit_rc_map_avermedia_m135a_rm_jx(void) | ||
82 | { | ||
83 | ir_unregister_map(&avermedia_m135a_rm_jx_map); | ||
84 | } | ||
85 | |||
86 | module_init(init_rc_map_avermedia_m135a_rm_jx) | ||
87 | module_exit(exit_rc_map_avermedia_m135a_rm_jx) | ||
88 | |||
89 | MODULE_LICENSE("GPL"); | ||
90 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); | ||
diff --git a/drivers/media/IR/keymaps/rc-avermedia-m135a.c b/drivers/media/IR/keymaps/rc-avermedia-m135a.c new file mode 100644 index 000000000000..e4471fb2ad1e --- /dev/null +++ b/drivers/media/IR/keymaps/rc-avermedia-m135a.c | |||
@@ -0,0 +1,147 @@ | |||
1 | /* avermedia-m135a.c - Keytable for Avermedia M135A Remote Controllers | ||
2 | * | ||
3 | * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
4 | * Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br> | ||
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/rc-map.h> | ||
13 | |||
14 | /* | ||
15 | * Avermedia M135A with RM-JX and RM-K6 remote controls | ||
16 | * | ||
17 | * On Avermedia M135A with IR model RM-JX, the same codes exist on both | ||
18 | * Positivo (BR) and original IR, initial version and remote control codes | ||
19 | * added by Mauro Carvalho Chehab <mchehab@infradead.org> | ||
20 | * | ||
21 | * Positivo also ships Avermedia M135A with model RM-K6, extra control | ||
22 | * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br> | ||
23 | */ | ||
24 | |||
25 | static struct ir_scancode avermedia_m135a[] = { | ||
26 | /* RM-JX */ | ||
27 | { 0x0200, KEY_POWER2 }, | ||
28 | { 0x022e, KEY_DOT }, /* '.' */ | ||
29 | { 0x0201, KEY_MODE }, /* TV/FM or SOURCE */ | ||
30 | |||
31 | { 0x0205, KEY_1 }, | ||
32 | { 0x0206, KEY_2 }, | ||
33 | { 0x0207, KEY_3 }, | ||
34 | { 0x0209, KEY_4 }, | ||
35 | { 0x020a, KEY_5 }, | ||
36 | { 0x020b, KEY_6 }, | ||
37 | { 0x020d, KEY_7 }, | ||
38 | { 0x020e, KEY_8 }, | ||
39 | { 0x020f, KEY_9 }, | ||
40 | { 0x0211, KEY_0 }, | ||
41 | |||
42 | { 0x0213, KEY_RIGHT }, /* -> or L */ | ||
43 | { 0x0212, KEY_LEFT }, /* <- or R */ | ||
44 | |||
45 | { 0x0217, KEY_SLEEP }, /* Capturar Imagem or Snapshot */ | ||
46 | { 0x0210, KEY_SHUFFLE }, /* Amostra or 16 chan prev */ | ||
47 | |||
48 | { 0x0303, KEY_CHANNELUP }, | ||
49 | { 0x0302, KEY_CHANNELDOWN }, | ||
50 | { 0x021f, KEY_VOLUMEUP }, | ||
51 | { 0x021e, KEY_VOLUMEDOWN }, | ||
52 | { 0x020c, KEY_ENTER }, /* Full Screen */ | ||
53 | |||
54 | { 0x0214, KEY_MUTE }, | ||
55 | { 0x0208, KEY_AUDIO }, | ||
56 | |||
57 | { 0x0203, KEY_TEXT }, /* Teletext */ | ||
58 | { 0x0204, KEY_EPG }, | ||
59 | { 0x022b, KEY_TV2 }, /* TV2 or PIP */ | ||
60 | |||
61 | { 0x021d, KEY_RED }, | ||
62 | { 0x021c, KEY_YELLOW }, | ||
63 | { 0x0301, KEY_GREEN }, | ||
64 | { 0x0300, KEY_BLUE }, | ||
65 | |||
66 | { 0x021a, KEY_PLAYPAUSE }, | ||
67 | { 0x0219, KEY_RECORD }, | ||
68 | { 0x0218, KEY_PLAY }, | ||
69 | { 0x021b, KEY_STOP }, | ||
70 | |||
71 | /* RM-K6 */ | ||
72 | { 0x0401, KEY_POWER2 }, | ||
73 | { 0x0406, KEY_MUTE }, | ||
74 | { 0x0408, KEY_MODE }, /* TV/FM */ | ||
75 | |||
76 | { 0x0409, KEY_1 }, | ||
77 | { 0x040a, KEY_2 }, | ||
78 | { 0x040b, KEY_3 }, | ||
79 | { 0x040c, KEY_4 }, | ||
80 | { 0x040d, KEY_5 }, | ||
81 | { 0x040e, KEY_6 }, | ||
82 | { 0x040f, KEY_7 }, | ||
83 | { 0x0410, KEY_8 }, | ||
84 | { 0x0411, KEY_9 }, | ||
85 | { 0x044c, KEY_DOT }, /* '.' */ | ||
86 | { 0x0412, KEY_0 }, | ||
87 | { 0x0407, KEY_REFRESH }, /* Refresh/Reload */ | ||
88 | |||
89 | { 0x0413, KEY_AUDIO }, | ||
90 | { 0x0440, KEY_SCREEN }, /* Full Screen toggle */ | ||
91 | { 0x0441, KEY_HOME }, | ||
92 | { 0x0442, KEY_BACK }, | ||
93 | { 0x0447, KEY_UP }, | ||
94 | { 0x0448, KEY_DOWN }, | ||
95 | { 0x0449, KEY_LEFT }, | ||
96 | { 0x044a, KEY_RIGHT }, | ||
97 | { 0x044b, KEY_OK }, | ||
98 | { 0x0404, KEY_VOLUMEUP }, | ||
99 | { 0x0405, KEY_VOLUMEDOWN }, | ||
100 | { 0x0402, KEY_CHANNELUP }, | ||
101 | { 0x0403, KEY_CHANNELDOWN }, | ||
102 | |||
103 | { 0x0443, KEY_RED }, | ||
104 | { 0x0444, KEY_GREEN }, | ||
105 | { 0x0445, KEY_YELLOW }, | ||
106 | { 0x0446, KEY_BLUE }, | ||
107 | |||
108 | { 0x0414, KEY_TEXT }, | ||
109 | { 0x0415, KEY_EPG }, | ||
110 | { 0x041a, KEY_TV2 }, /* PIP */ | ||
111 | { 0x041b, KEY_MHP }, /* Snapshot */ | ||
112 | |||
113 | { 0x0417, KEY_RECORD }, | ||
114 | { 0x0416, KEY_PLAYPAUSE }, | ||
115 | { 0x0418, KEY_STOP }, | ||
116 | { 0x0419, KEY_PAUSE }, | ||
117 | |||
118 | { 0x041f, KEY_PREVIOUS }, | ||
119 | { 0x041c, KEY_REWIND }, | ||
120 | { 0x041d, KEY_FORWARD }, | ||
121 | { 0x041e, KEY_NEXT }, | ||
122 | }; | ||
123 | |||
124 | static struct rc_keymap avermedia_m135a_map = { | ||
125 | .map = { | ||
126 | .scan = avermedia_m135a, | ||
127 | .size = ARRAY_SIZE(avermedia_m135a), | ||
128 | .ir_type = IR_TYPE_NEC, | ||
129 | .name = RC_MAP_AVERMEDIA_M135A, | ||
130 | } | ||
131 | }; | ||
132 | |||
133 | static int __init init_rc_map_avermedia_m135a(void) | ||
134 | { | ||
135 | return ir_register_map(&avermedia_m135a_map); | ||
136 | } | ||
137 | |||
138 | static void __exit exit_rc_map_avermedia_m135a(void) | ||
139 | { | ||
140 | ir_unregister_map(&avermedia_m135a_map); | ||
141 | } | ||
142 | |||
143 | module_init(init_rc_map_avermedia_m135a) | ||
144 | module_exit(exit_rc_map_avermedia_m135a) | ||
145 | |||
146 | MODULE_LICENSE("GPL"); | ||
147 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); | ||
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index f9ed8048894d..b36960dd7319 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -657,7 +657,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
657 | saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); | 657 | saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); |
658 | break; | 658 | break; |
659 | case SAA7134_BOARD_AVERMEDIA_M135A: | 659 | case SAA7134_BOARD_AVERMEDIA_M135A: |
660 | ir_codes = RC_MAP_AVERMEDIA_M135A_RM_JX; | 660 | ir_codes = RC_MAP_AVERMEDIA_M135A; |
661 | mask_keydown = 0x0040000; /* Enable GPIO18 line on both edges */ | 661 | mask_keydown = 0x0040000; /* Enable GPIO18 line on both edges */ |
662 | mask_keyup = 0x0040000; | 662 | mask_keyup = 0x0040000; |
663 | mask_keycode = 0xffff; | 663 | mask_keycode = 0xffff; |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 6f1f9f76674e..c78e99a435b6 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -55,7 +55,7 @@ void rc_map_init(void); | |||
55 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" | 55 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" |
56 | #define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" | 56 | #define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" |
57 | #define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" | 57 | #define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" |
58 | #define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx" | 58 | #define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a" |
59 | #define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6" | 59 | #define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6" |
60 | #define RC_MAP_AVERMEDIA "rc-avermedia" | 60 | #define RC_MAP_AVERMEDIA "rc-avermedia" |
61 | #define RC_MAP_AVERTV_303 "rc-avertv-303" | 61 | #define RC_MAP_AVERTV_303 "rc-avertv-303" |