xref: /linux/drivers/media/rc/keymaps/rc-avermedia-m135a.c (revision 444cc20b3d6141a5fa9a9774a6b710e16af6110d)
132cf86f6SMauro Carvalho Chehab /* avermedia-m135a.c - Keytable for Avermedia M135A Remote Controllers
232cf86f6SMauro Carvalho Chehab  *
332cf86f6SMauro Carvalho Chehab  * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
432cf86f6SMauro Carvalho Chehab  * Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
532cf86f6SMauro Carvalho Chehab  *
632cf86f6SMauro Carvalho Chehab  * This program is free software; you can redistribute it and/or modify
732cf86f6SMauro Carvalho Chehab  * it under the terms of the GNU General Public License as published by
832cf86f6SMauro Carvalho Chehab  * the Free Software Foundation; either version 2 of the License, or
932cf86f6SMauro Carvalho Chehab  * (at your option) any later version.
1032cf86f6SMauro Carvalho Chehab  */
1132cf86f6SMauro Carvalho Chehab 
1232cf86f6SMauro Carvalho Chehab #include <media/rc-map.h>
1332cf86f6SMauro Carvalho Chehab 
1432cf86f6SMauro Carvalho Chehab /*
1532cf86f6SMauro Carvalho Chehab  * Avermedia M135A with RM-JX and RM-K6 remote controls
1632cf86f6SMauro Carvalho Chehab  *
1732cf86f6SMauro Carvalho Chehab  * On Avermedia M135A with IR model RM-JX, the same codes exist on both
1832cf86f6SMauro Carvalho Chehab  * Positivo (BR) and original IR, initial version and remote control codes
1932cf86f6SMauro Carvalho Chehab  * added by Mauro Carvalho Chehab <mchehab@infradead.org>
2032cf86f6SMauro Carvalho Chehab  *
2132cf86f6SMauro Carvalho Chehab  * Positivo also ships Avermedia M135A with model RM-K6, extra control
2232cf86f6SMauro Carvalho Chehab  * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
2332cf86f6SMauro Carvalho Chehab  */
2432cf86f6SMauro Carvalho Chehab 
252f4f58d6SMauro Carvalho Chehab static struct rc_map_table avermedia_m135a[] = {
2632cf86f6SMauro Carvalho Chehab 	/* RM-JX */
2732cf86f6SMauro Carvalho Chehab 	{ 0x0200, KEY_POWER2 },
2832cf86f6SMauro Carvalho Chehab 	{ 0x022e, KEY_DOT },		/* '.' */
2932cf86f6SMauro Carvalho Chehab 	{ 0x0201, KEY_MODE },		/* TV/FM or SOURCE */
3032cf86f6SMauro Carvalho Chehab 
3132cf86f6SMauro Carvalho Chehab 	{ 0x0205, KEY_1 },
3232cf86f6SMauro Carvalho Chehab 	{ 0x0206, KEY_2 },
3332cf86f6SMauro Carvalho Chehab 	{ 0x0207, KEY_3 },
3432cf86f6SMauro Carvalho Chehab 	{ 0x0209, KEY_4 },
3532cf86f6SMauro Carvalho Chehab 	{ 0x020a, KEY_5 },
3632cf86f6SMauro Carvalho Chehab 	{ 0x020b, KEY_6 },
3732cf86f6SMauro Carvalho Chehab 	{ 0x020d, KEY_7 },
3832cf86f6SMauro Carvalho Chehab 	{ 0x020e, KEY_8 },
3932cf86f6SMauro Carvalho Chehab 	{ 0x020f, KEY_9 },
4032cf86f6SMauro Carvalho Chehab 	{ 0x0211, KEY_0 },
4132cf86f6SMauro Carvalho Chehab 
4232cf86f6SMauro Carvalho Chehab 	{ 0x0213, KEY_RIGHT },		/* -> or L */
4332cf86f6SMauro Carvalho Chehab 	{ 0x0212, KEY_LEFT },		/* <- or R */
4432cf86f6SMauro Carvalho Chehab 
4532cf86f6SMauro Carvalho Chehab 	{ 0x0217, KEY_SLEEP },		/* Capturar Imagem or Snapshot */
4632cf86f6SMauro Carvalho Chehab 	{ 0x0210, KEY_SHUFFLE },	/* Amostra or 16 chan prev */
4732cf86f6SMauro Carvalho Chehab 
4832cf86f6SMauro Carvalho Chehab 	{ 0x0303, KEY_CHANNELUP },
4932cf86f6SMauro Carvalho Chehab 	{ 0x0302, KEY_CHANNELDOWN },
5032cf86f6SMauro Carvalho Chehab 	{ 0x021f, KEY_VOLUMEUP },
5132cf86f6SMauro Carvalho Chehab 	{ 0x021e, KEY_VOLUMEDOWN },
5232cf86f6SMauro Carvalho Chehab 	{ 0x020c, KEY_ENTER },		/* Full Screen */
5332cf86f6SMauro Carvalho Chehab 
5432cf86f6SMauro Carvalho Chehab 	{ 0x0214, KEY_MUTE },
5532cf86f6SMauro Carvalho Chehab 	{ 0x0208, KEY_AUDIO },
5632cf86f6SMauro Carvalho Chehab 
5732cf86f6SMauro Carvalho Chehab 	{ 0x0203, KEY_TEXT },		/* Teletext */
5832cf86f6SMauro Carvalho Chehab 	{ 0x0204, KEY_EPG },
5932cf86f6SMauro Carvalho Chehab 	{ 0x022b, KEY_TV2 },		/* TV2 or PIP */
6032cf86f6SMauro Carvalho Chehab 
6132cf86f6SMauro Carvalho Chehab 	{ 0x021d, KEY_RED },
6232cf86f6SMauro Carvalho Chehab 	{ 0x021c, KEY_YELLOW },
6332cf86f6SMauro Carvalho Chehab 	{ 0x0301, KEY_GREEN },
6432cf86f6SMauro Carvalho Chehab 	{ 0x0300, KEY_BLUE },
6532cf86f6SMauro Carvalho Chehab 
6632cf86f6SMauro Carvalho Chehab 	{ 0x021a, KEY_PLAYPAUSE },
6732cf86f6SMauro Carvalho Chehab 	{ 0x0219, KEY_RECORD },
6832cf86f6SMauro Carvalho Chehab 	{ 0x0218, KEY_PLAY },
6932cf86f6SMauro Carvalho Chehab 	{ 0x021b, KEY_STOP },
7032cf86f6SMauro Carvalho Chehab 
7132cf86f6SMauro Carvalho Chehab 	/* RM-K6 */
7232cf86f6SMauro Carvalho Chehab 	{ 0x0401, KEY_POWER2 },
7332cf86f6SMauro Carvalho Chehab 	{ 0x0406, KEY_MUTE },
7432cf86f6SMauro Carvalho Chehab 	{ 0x0408, KEY_MODE },     /* TV/FM */
7532cf86f6SMauro Carvalho Chehab 
7632cf86f6SMauro Carvalho Chehab 	{ 0x0409, KEY_1 },
7732cf86f6SMauro Carvalho Chehab 	{ 0x040a, KEY_2 },
7832cf86f6SMauro Carvalho Chehab 	{ 0x040b, KEY_3 },
7932cf86f6SMauro Carvalho Chehab 	{ 0x040c, KEY_4 },
8032cf86f6SMauro Carvalho Chehab 	{ 0x040d, KEY_5 },
8132cf86f6SMauro Carvalho Chehab 	{ 0x040e, KEY_6 },
8232cf86f6SMauro Carvalho Chehab 	{ 0x040f, KEY_7 },
8332cf86f6SMauro Carvalho Chehab 	{ 0x0410, KEY_8 },
8432cf86f6SMauro Carvalho Chehab 	{ 0x0411, KEY_9 },
8532cf86f6SMauro Carvalho Chehab 	{ 0x044c, KEY_DOT },      /* '.' */
8632cf86f6SMauro Carvalho Chehab 	{ 0x0412, KEY_0 },
8732cf86f6SMauro Carvalho Chehab 	{ 0x0407, KEY_REFRESH },  /* Refresh/Reload */
8832cf86f6SMauro Carvalho Chehab 
8932cf86f6SMauro Carvalho Chehab 	{ 0x0413, KEY_AUDIO },
9032cf86f6SMauro Carvalho Chehab 	{ 0x0440, KEY_SCREEN },   /* Full Screen toggle */
9132cf86f6SMauro Carvalho Chehab 	{ 0x0441, KEY_HOME },
9232cf86f6SMauro Carvalho Chehab 	{ 0x0442, KEY_BACK },
9332cf86f6SMauro Carvalho Chehab 	{ 0x0447, KEY_UP },
9432cf86f6SMauro Carvalho Chehab 	{ 0x0448, KEY_DOWN },
9532cf86f6SMauro Carvalho Chehab 	{ 0x0449, KEY_LEFT },
9632cf86f6SMauro Carvalho Chehab 	{ 0x044a, KEY_RIGHT },
9732cf86f6SMauro Carvalho Chehab 	{ 0x044b, KEY_OK },
9832cf86f6SMauro Carvalho Chehab 	{ 0x0404, KEY_VOLUMEUP },
9932cf86f6SMauro Carvalho Chehab 	{ 0x0405, KEY_VOLUMEDOWN },
10032cf86f6SMauro Carvalho Chehab 	{ 0x0402, KEY_CHANNELUP },
10132cf86f6SMauro Carvalho Chehab 	{ 0x0403, KEY_CHANNELDOWN },
10232cf86f6SMauro Carvalho Chehab 
10332cf86f6SMauro Carvalho Chehab 	{ 0x0443, KEY_RED },
10432cf86f6SMauro Carvalho Chehab 	{ 0x0444, KEY_GREEN },
10532cf86f6SMauro Carvalho Chehab 	{ 0x0445, KEY_YELLOW },
10632cf86f6SMauro Carvalho Chehab 	{ 0x0446, KEY_BLUE },
10732cf86f6SMauro Carvalho Chehab 
10832cf86f6SMauro Carvalho Chehab 	{ 0x0414, KEY_TEXT },
10932cf86f6SMauro Carvalho Chehab 	{ 0x0415, KEY_EPG },
11032cf86f6SMauro Carvalho Chehab 	{ 0x041a, KEY_TV2 },      /* PIP */
111*444cc20bSMauro Carvalho Chehab 	{ 0x041b, KEY_CAMERA },      /* Snapshot */
11232cf86f6SMauro Carvalho Chehab 
11332cf86f6SMauro Carvalho Chehab 	{ 0x0417, KEY_RECORD },
11432cf86f6SMauro Carvalho Chehab 	{ 0x0416, KEY_PLAYPAUSE },
11532cf86f6SMauro Carvalho Chehab 	{ 0x0418, KEY_STOP },
11632cf86f6SMauro Carvalho Chehab 	{ 0x0419, KEY_PAUSE },
11732cf86f6SMauro Carvalho Chehab 
11832cf86f6SMauro Carvalho Chehab 	{ 0x041f, KEY_PREVIOUS },
11932cf86f6SMauro Carvalho Chehab 	{ 0x041c, KEY_REWIND },
12032cf86f6SMauro Carvalho Chehab 	{ 0x041d, KEY_FORWARD },
12132cf86f6SMauro Carvalho Chehab 	{ 0x041e, KEY_NEXT },
12232cf86f6SMauro Carvalho Chehab };
12332cf86f6SMauro Carvalho Chehab 
124d100e659SMauro Carvalho Chehab static struct rc_map_list avermedia_m135a_map = {
12532cf86f6SMauro Carvalho Chehab 	.map = {
12632cf86f6SMauro Carvalho Chehab 		.scan    = avermedia_m135a,
12732cf86f6SMauro Carvalho Chehab 		.size    = ARRAY_SIZE(avermedia_m135a),
12852b66144SMauro Carvalho Chehab 		.rc_type = RC_TYPE_NEC,
12932cf86f6SMauro Carvalho Chehab 		.name    = RC_MAP_AVERMEDIA_M135A,
13032cf86f6SMauro Carvalho Chehab 	}
13132cf86f6SMauro Carvalho Chehab };
13232cf86f6SMauro Carvalho Chehab 
13332cf86f6SMauro Carvalho Chehab static int __init init_rc_map_avermedia_m135a(void)
13432cf86f6SMauro Carvalho Chehab {
135d100e659SMauro Carvalho Chehab 	return rc_map_register(&avermedia_m135a_map);
13632cf86f6SMauro Carvalho Chehab }
13732cf86f6SMauro Carvalho Chehab 
13832cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_avermedia_m135a(void)
13932cf86f6SMauro Carvalho Chehab {
140d100e659SMauro Carvalho Chehab 	rc_map_unregister(&avermedia_m135a_map);
14132cf86f6SMauro Carvalho Chehab }
14232cf86f6SMauro Carvalho Chehab 
14332cf86f6SMauro Carvalho Chehab module_init(init_rc_map_avermedia_m135a)
14432cf86f6SMauro Carvalho Chehab module_exit(exit_rc_map_avermedia_m135a)
14532cf86f6SMauro Carvalho Chehab 
14632cf86f6SMauro Carvalho Chehab MODULE_LICENSE("GPL");
14732cf86f6SMauro Carvalho Chehab MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
148