xref: /linux/drivers/media/rc/keymaps/rc-avermedia-m135a.c (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1688c73c6SMauro Carvalho Chehab // SPDX-License-Identifier: GPL-2.0+
2688c73c6SMauro Carvalho Chehab // avermedia-m135a.c - Keytable for Avermedia M135A Remote Controllers
3688c73c6SMauro Carvalho Chehab //
4688c73c6SMauro Carvalho Chehab // Copyright (c) 2010 by Mauro Carvalho Chehab
5688c73c6SMauro Carvalho Chehab // Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
632cf86f6SMauro Carvalho Chehab 
732cf86f6SMauro Carvalho Chehab #include <media/rc-map.h>
87a707b89SPaul Gortmaker #include <linux/module.h>
932cf86f6SMauro Carvalho Chehab 
1032cf86f6SMauro Carvalho Chehab /*
1132cf86f6SMauro Carvalho Chehab  * Avermedia M135A with RM-JX and RM-K6 remote controls
1232cf86f6SMauro Carvalho Chehab  *
1332cf86f6SMauro Carvalho Chehab  * On Avermedia M135A with IR model RM-JX, the same codes exist on both
1432cf86f6SMauro Carvalho Chehab  * Positivo (BR) and original IR, initial version and remote control codes
1532590819SMauro Carvalho Chehab  * added by Mauro Carvalho Chehab <mchehab@kernel.org>
1632cf86f6SMauro Carvalho Chehab  *
1732cf86f6SMauro Carvalho Chehab  * Positivo also ships Avermedia M135A with model RM-K6, extra control
1832cf86f6SMauro Carvalho Chehab  * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
1932cf86f6SMauro Carvalho Chehab  */
2032cf86f6SMauro Carvalho Chehab 
212f4f58d6SMauro Carvalho Chehab static struct rc_map_table avermedia_m135a[] = {
2232cf86f6SMauro Carvalho Chehab 	/* RM-JX */
2332cf86f6SMauro Carvalho Chehab 	{ 0x0200, KEY_POWER2 },
2432cf86f6SMauro Carvalho Chehab 	{ 0x022e, KEY_DOT },		/* '.' */
2532cf86f6SMauro Carvalho Chehab 	{ 0x0201, KEY_MODE },		/* TV/FM or SOURCE */
2632cf86f6SMauro Carvalho Chehab 
271910ea42SBastien Nocera 	{ 0x0205, KEY_NUMERIC_1 },
281910ea42SBastien Nocera 	{ 0x0206, KEY_NUMERIC_2 },
291910ea42SBastien Nocera 	{ 0x0207, KEY_NUMERIC_3 },
301910ea42SBastien Nocera 	{ 0x0209, KEY_NUMERIC_4 },
311910ea42SBastien Nocera 	{ 0x020a, KEY_NUMERIC_5 },
321910ea42SBastien Nocera 	{ 0x020b, KEY_NUMERIC_6 },
331910ea42SBastien Nocera 	{ 0x020d, KEY_NUMERIC_7 },
341910ea42SBastien Nocera 	{ 0x020e, KEY_NUMERIC_8 },
351910ea42SBastien Nocera 	{ 0x020f, KEY_NUMERIC_9 },
361910ea42SBastien Nocera 	{ 0x0211, KEY_NUMERIC_0 },
3732cf86f6SMauro Carvalho Chehab 
3832cf86f6SMauro Carvalho Chehab 	{ 0x0213, KEY_RIGHT },		/* -> or L */
3932cf86f6SMauro Carvalho Chehab 	{ 0x0212, KEY_LEFT },		/* <- or R */
4032cf86f6SMauro Carvalho Chehab 
41efdc16adSSean Young 	{ 0x0215, KEY_MENU },
42efdc16adSSean Young 	{ 0x0217, KEY_CAMERA },		/* Capturar Imagem or Snapshot */
4332cf86f6SMauro Carvalho Chehab 	{ 0x0210, KEY_SHUFFLE },	/* Amostra or 16 chan prev */
4432cf86f6SMauro Carvalho Chehab 
4532cf86f6SMauro Carvalho Chehab 	{ 0x0303, KEY_CHANNELUP },
4632cf86f6SMauro Carvalho Chehab 	{ 0x0302, KEY_CHANNELDOWN },
4732cf86f6SMauro Carvalho Chehab 	{ 0x021f, KEY_VOLUMEUP },
4832cf86f6SMauro Carvalho Chehab 	{ 0x021e, KEY_VOLUMEDOWN },
4932cf86f6SMauro Carvalho Chehab 	{ 0x020c, KEY_ENTER },		/* Full Screen */
5032cf86f6SMauro Carvalho Chehab 
5132cf86f6SMauro Carvalho Chehab 	{ 0x0214, KEY_MUTE },
5232cf86f6SMauro Carvalho Chehab 	{ 0x0208, KEY_AUDIO },
5332cf86f6SMauro Carvalho Chehab 
5432cf86f6SMauro Carvalho Chehab 	{ 0x0203, KEY_TEXT },		/* Teletext */
5532cf86f6SMauro Carvalho Chehab 	{ 0x0204, KEY_EPG },
5632cf86f6SMauro Carvalho Chehab 	{ 0x022b, KEY_TV2 },		/* TV2 or PIP */
5732cf86f6SMauro Carvalho Chehab 
5832cf86f6SMauro Carvalho Chehab 	{ 0x021d, KEY_RED },
5932cf86f6SMauro Carvalho Chehab 	{ 0x021c, KEY_YELLOW },
6032cf86f6SMauro Carvalho Chehab 	{ 0x0301, KEY_GREEN },
6132cf86f6SMauro Carvalho Chehab 	{ 0x0300, KEY_BLUE },
6232cf86f6SMauro Carvalho Chehab 
6332cf86f6SMauro Carvalho Chehab 	{ 0x021a, KEY_PLAYPAUSE },
6432cf86f6SMauro Carvalho Chehab 	{ 0x0219, KEY_RECORD },
6532cf86f6SMauro Carvalho Chehab 	{ 0x0218, KEY_PLAY },
6632cf86f6SMauro Carvalho Chehab 	{ 0x021b, KEY_STOP },
6732cf86f6SMauro Carvalho Chehab 
6832cf86f6SMauro Carvalho Chehab 	/* RM-K6 */
6932cf86f6SMauro Carvalho Chehab 	{ 0x0401, KEY_POWER2 },
7032cf86f6SMauro Carvalho Chehab 	{ 0x0406, KEY_MUTE },
7132cf86f6SMauro Carvalho Chehab 	{ 0x0408, KEY_MODE },     /* TV/FM */
7232cf86f6SMauro Carvalho Chehab 
731910ea42SBastien Nocera 	{ 0x0409, KEY_NUMERIC_1 },
741910ea42SBastien Nocera 	{ 0x040a, KEY_NUMERIC_2 },
751910ea42SBastien Nocera 	{ 0x040b, KEY_NUMERIC_3 },
761910ea42SBastien Nocera 	{ 0x040c, KEY_NUMERIC_4 },
771910ea42SBastien Nocera 	{ 0x040d, KEY_NUMERIC_5 },
781910ea42SBastien Nocera 	{ 0x040e, KEY_NUMERIC_6 },
791910ea42SBastien Nocera 	{ 0x040f, KEY_NUMERIC_7 },
801910ea42SBastien Nocera 	{ 0x0410, KEY_NUMERIC_8 },
811910ea42SBastien Nocera 	{ 0x0411, KEY_NUMERIC_9 },
8232cf86f6SMauro Carvalho Chehab 	{ 0x044c, KEY_DOT },      /* '.' */
831910ea42SBastien Nocera 	{ 0x0412, KEY_NUMERIC_0 },
8432cf86f6SMauro Carvalho Chehab 	{ 0x0407, KEY_REFRESH },  /* Refresh/Reload */
8532cf86f6SMauro Carvalho Chehab 
8632cf86f6SMauro Carvalho Chehab 	{ 0x0413, KEY_AUDIO },
8732cf86f6SMauro Carvalho Chehab 	{ 0x0440, KEY_SCREEN },   /* Full Screen toggle */
8832cf86f6SMauro Carvalho Chehab 	{ 0x0441, KEY_HOME },
8932cf86f6SMauro Carvalho Chehab 	{ 0x0442, KEY_BACK },
9032cf86f6SMauro Carvalho Chehab 	{ 0x0447, KEY_UP },
9132cf86f6SMauro Carvalho Chehab 	{ 0x0448, KEY_DOWN },
9232cf86f6SMauro Carvalho Chehab 	{ 0x0449, KEY_LEFT },
9332cf86f6SMauro Carvalho Chehab 	{ 0x044a, KEY_RIGHT },
9432cf86f6SMauro Carvalho Chehab 	{ 0x044b, KEY_OK },
9532cf86f6SMauro Carvalho Chehab 	{ 0x0404, KEY_VOLUMEUP },
9632cf86f6SMauro Carvalho Chehab 	{ 0x0405, KEY_VOLUMEDOWN },
9732cf86f6SMauro Carvalho Chehab 	{ 0x0402, KEY_CHANNELUP },
9832cf86f6SMauro Carvalho Chehab 	{ 0x0403, KEY_CHANNELDOWN },
9932cf86f6SMauro Carvalho Chehab 
10032cf86f6SMauro Carvalho Chehab 	{ 0x0443, KEY_RED },
10132cf86f6SMauro Carvalho Chehab 	{ 0x0444, KEY_GREEN },
10232cf86f6SMauro Carvalho Chehab 	{ 0x0445, KEY_YELLOW },
10332cf86f6SMauro Carvalho Chehab 	{ 0x0446, KEY_BLUE },
10432cf86f6SMauro Carvalho Chehab 
10532cf86f6SMauro Carvalho Chehab 	{ 0x0414, KEY_TEXT },
10632cf86f6SMauro Carvalho Chehab 	{ 0x0415, KEY_EPG },
10732cf86f6SMauro Carvalho Chehab 	{ 0x041a, KEY_TV2 },      /* PIP */
108444cc20bSMauro Carvalho Chehab 	{ 0x041b, KEY_CAMERA },      /* Snapshot */
10932cf86f6SMauro Carvalho Chehab 
11032cf86f6SMauro Carvalho Chehab 	{ 0x0417, KEY_RECORD },
11132cf86f6SMauro Carvalho Chehab 	{ 0x0416, KEY_PLAYPAUSE },
11232cf86f6SMauro Carvalho Chehab 	{ 0x0418, KEY_STOP },
11332cf86f6SMauro Carvalho Chehab 	{ 0x0419, KEY_PAUSE },
11432cf86f6SMauro Carvalho Chehab 
11532cf86f6SMauro Carvalho Chehab 	{ 0x041f, KEY_PREVIOUS },
11632cf86f6SMauro Carvalho Chehab 	{ 0x041c, KEY_REWIND },
11732cf86f6SMauro Carvalho Chehab 	{ 0x041d, KEY_FORWARD },
11832cf86f6SMauro Carvalho Chehab 	{ 0x041e, KEY_NEXT },
11932cf86f6SMauro Carvalho Chehab };
12032cf86f6SMauro Carvalho Chehab 
121d100e659SMauro Carvalho Chehab static struct rc_map_list avermedia_m135a_map = {
12232cf86f6SMauro Carvalho Chehab 	.map = {
12332cf86f6SMauro Carvalho Chehab 		.scan     = avermedia_m135a,
12432cf86f6SMauro Carvalho Chehab 		.size     = ARRAY_SIZE(avermedia_m135a),
1256d741bfeSSean Young 		.rc_proto = RC_PROTO_NEC,
12632cf86f6SMauro Carvalho Chehab 		.name     = RC_MAP_AVERMEDIA_M135A,
12732cf86f6SMauro Carvalho Chehab 	}
12832cf86f6SMauro Carvalho Chehab };
12932cf86f6SMauro Carvalho Chehab 
init_rc_map_avermedia_m135a(void)13032cf86f6SMauro Carvalho Chehab static int __init init_rc_map_avermedia_m135a(void)
13132cf86f6SMauro Carvalho Chehab {
132d100e659SMauro Carvalho Chehab 	return rc_map_register(&avermedia_m135a_map);
13332cf86f6SMauro Carvalho Chehab }
13432cf86f6SMauro Carvalho Chehab 
exit_rc_map_avermedia_m135a(void)13532cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_avermedia_m135a(void)
13632cf86f6SMauro Carvalho Chehab {
137d100e659SMauro Carvalho Chehab 	rc_map_unregister(&avermedia_m135a_map);
13832cf86f6SMauro Carvalho Chehab }
13932cf86f6SMauro Carvalho Chehab 
14032cf86f6SMauro Carvalho Chehab module_init(init_rc_map_avermedia_m135a)
14132cf86f6SMauro Carvalho Chehab module_exit(exit_rc_map_avermedia_m135a)
14232cf86f6SMauro Carvalho Chehab 
14332cf86f6SMauro Carvalho Chehab MODULE_LICENSE("GPL");
14437e59f87SMauro Carvalho Chehab MODULE_AUTHOR("Mauro Carvalho Chehab");
145*462e108bSHans Verkuil MODULE_DESCRIPTION("Avermedia M135A with RM-JX and RM-K6 remote controller keytable");
146