132cf86f6SMauro Carvalho Chehab /* rc5-imon-pad.c - Keytable for SoundGraph iMON PAD and Antec Veris
232cf86f6SMauro Carvalho Chehab  * RM-200 Remote Control
332cf86f6SMauro Carvalho Chehab  *
432cf86f6SMauro Carvalho Chehab  * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com>
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  * standard imon remote key table, which isn't really entirely
1632cf86f6SMauro Carvalho Chehab  * "standard", as different receivers decode the same key on the
1732cf86f6SMauro Carvalho Chehab  * same remote to different hex codes, and the silkscreened names
1832cf86f6SMauro Carvalho Chehab  * vary a bit between the SoundGraph and Antec remotes... ugh.
1932cf86f6SMauro Carvalho Chehab  */
2032cf86f6SMauro Carvalho Chehab static struct ir_scancode imon_pad[] = {
2132cf86f6SMauro Carvalho Chehab 	/* keys sorted mostly by frequency of use to optimize lookups */
2232cf86f6SMauro Carvalho Chehab 	{ 0x2a8195b7, KEY_REWIND },
2332cf86f6SMauro Carvalho Chehab 	{ 0x298315b7, KEY_REWIND },
2432cf86f6SMauro Carvalho Chehab 	{ 0x2b8115b7, KEY_FASTFORWARD },
2532cf86f6SMauro Carvalho Chehab 	{ 0x2b8315b7, KEY_FASTFORWARD },
2632cf86f6SMauro Carvalho Chehab 	{ 0x2b9115b7, KEY_PREVIOUS },
2732cf86f6SMauro Carvalho Chehab 	{ 0x298195b7, KEY_NEXT },
2832cf86f6SMauro Carvalho Chehab 
2932cf86f6SMauro Carvalho Chehab 	{ 0x2a8115b7, KEY_PLAY },
3032cf86f6SMauro Carvalho Chehab 	{ 0x2a8315b7, KEY_PLAY },
3132cf86f6SMauro Carvalho Chehab 	{ 0x2a9115b7, KEY_PAUSE },
3232cf86f6SMauro Carvalho Chehab 	{ 0x2b9715b7, KEY_STOP },
3332cf86f6SMauro Carvalho Chehab 	{ 0x298115b7, KEY_RECORD },
3432cf86f6SMauro Carvalho Chehab 
3532cf86f6SMauro Carvalho Chehab 	{ 0x01008000, KEY_UP },
3632cf86f6SMauro Carvalho Chehab 	{ 0x01007f00, KEY_DOWN },
3732cf86f6SMauro Carvalho Chehab 	{ 0x01000080, KEY_LEFT },
3832cf86f6SMauro Carvalho Chehab 	{ 0x0100007f, KEY_RIGHT },
3932cf86f6SMauro Carvalho Chehab 
4032cf86f6SMauro Carvalho Chehab 	{ 0x2aa515b7, KEY_UP },
4132cf86f6SMauro Carvalho Chehab 	{ 0x289515b7, KEY_DOWN },
4232cf86f6SMauro Carvalho Chehab 	{ 0x29a515b7, KEY_LEFT },
4332cf86f6SMauro Carvalho Chehab 	{ 0x2ba515b7, KEY_RIGHT },
4432cf86f6SMauro Carvalho Chehab 
4532cf86f6SMauro Carvalho Chehab 	{ 0x0200002c, KEY_SPACE }, /* Select/Space */
4632cf86f6SMauro Carvalho Chehab 	{ 0x2a9315b7, KEY_SPACE }, /* Select/Space */
4732cf86f6SMauro Carvalho Chehab 	{ 0x02000028, KEY_ENTER },
4832cf86f6SMauro Carvalho Chehab 	{ 0x28a195b7, KEY_ENTER },
4932cf86f6SMauro Carvalho Chehab 	{ 0x288195b7, KEY_EXIT },
5032cf86f6SMauro Carvalho Chehab 	{ 0x02000029, KEY_ESC },
5132cf86f6SMauro Carvalho Chehab 	{ 0x2bb715b7, KEY_ESC },
5232cf86f6SMauro Carvalho Chehab 	{ 0x0200002a, KEY_BACKSPACE },
5332cf86f6SMauro Carvalho Chehab 	{ 0x28a115b7, KEY_BACKSPACE },
5432cf86f6SMauro Carvalho Chehab 
5532cf86f6SMauro Carvalho Chehab 	{ 0x2b9595b7, KEY_MUTE },
5632cf86f6SMauro Carvalho Chehab 	{ 0x28a395b7, KEY_VOLUMEUP },
5732cf86f6SMauro Carvalho Chehab 	{ 0x28a595b7, KEY_VOLUMEDOWN },
5832cf86f6SMauro Carvalho Chehab 	{ 0x289395b7, KEY_CHANNELUP },
5932cf86f6SMauro Carvalho Chehab 	{ 0x288795b7, KEY_CHANNELDOWN },
6032cf86f6SMauro Carvalho Chehab 
6132cf86f6SMauro Carvalho Chehab 	{ 0x0200001e, KEY_NUMERIC_1 },
6232cf86f6SMauro Carvalho Chehab 	{ 0x0200001f, KEY_NUMERIC_2 },
6332cf86f6SMauro Carvalho Chehab 	{ 0x02000020, KEY_NUMERIC_3 },
6432cf86f6SMauro Carvalho Chehab 	{ 0x02000021, KEY_NUMERIC_4 },
6532cf86f6SMauro Carvalho Chehab 	{ 0x02000022, KEY_NUMERIC_5 },
6632cf86f6SMauro Carvalho Chehab 	{ 0x02000023, KEY_NUMERIC_6 },
6732cf86f6SMauro Carvalho Chehab 	{ 0x02000024, KEY_NUMERIC_7 },
6832cf86f6SMauro Carvalho Chehab 	{ 0x02000025, KEY_NUMERIC_8 },
6932cf86f6SMauro Carvalho Chehab 	{ 0x02000026, KEY_NUMERIC_9 },
7032cf86f6SMauro Carvalho Chehab 	{ 0x02000027, KEY_NUMERIC_0 },
7132cf86f6SMauro Carvalho Chehab 
7232cf86f6SMauro Carvalho Chehab 	{ 0x28b595b7, KEY_NUMERIC_1 },
7332cf86f6SMauro Carvalho Chehab 	{ 0x2bb195b7, KEY_NUMERIC_2 },
7432cf86f6SMauro Carvalho Chehab 	{ 0x28b195b7, KEY_NUMERIC_3 },
7532cf86f6SMauro Carvalho Chehab 	{ 0x2a8595b7, KEY_NUMERIC_4 },
7632cf86f6SMauro Carvalho Chehab 	{ 0x299595b7, KEY_NUMERIC_5 },
7732cf86f6SMauro Carvalho Chehab 	{ 0x2aa595b7, KEY_NUMERIC_6 },
7832cf86f6SMauro Carvalho Chehab 	{ 0x2b9395b7, KEY_NUMERIC_7 },
7932cf86f6SMauro Carvalho Chehab 	{ 0x2a8515b7, KEY_NUMERIC_8 },
8032cf86f6SMauro Carvalho Chehab 	{ 0x2aa115b7, KEY_NUMERIC_9 },
8132cf86f6SMauro Carvalho Chehab 	{ 0x2ba595b7, KEY_NUMERIC_0 },
8232cf86f6SMauro Carvalho Chehab 
8332cf86f6SMauro Carvalho Chehab 	{ 0x02200025, KEY_NUMERIC_STAR },
8432cf86f6SMauro Carvalho Chehab 	{ 0x28b515b7, KEY_NUMERIC_STAR },
8532cf86f6SMauro Carvalho Chehab 	{ 0x02200020, KEY_NUMERIC_POUND },
8632cf86f6SMauro Carvalho Chehab 	{ 0x29a115b7, KEY_NUMERIC_POUND },
8732cf86f6SMauro Carvalho Chehab 
8832cf86f6SMauro Carvalho Chehab 	{ 0x2b8515b7, KEY_VIDEO },
8932cf86f6SMauro Carvalho Chehab 	{ 0x299195b7, KEY_AUDIO },
9032cf86f6SMauro Carvalho Chehab 	{ 0x2ba115b7, KEY_CAMERA },
9132cf86f6SMauro Carvalho Chehab 	{ 0x28a515b7, KEY_TV },
9232cf86f6SMauro Carvalho Chehab 	{ 0x29a395b7, KEY_DVD },
9332cf86f6SMauro Carvalho Chehab 	{ 0x29a295b7, KEY_DVD },
9432cf86f6SMauro Carvalho Chehab 
9532cf86f6SMauro Carvalho Chehab 	/* the Menu key between DVD and Subtitle on the RM-200... */
9632cf86f6SMauro Carvalho Chehab 	{ 0x2ba385b7, KEY_MENU },
9732cf86f6SMauro Carvalho Chehab 	{ 0x2ba395b7, KEY_MENU },
9832cf86f6SMauro Carvalho Chehab 
9932cf86f6SMauro Carvalho Chehab 	{ 0x288515b7, KEY_BOOKMARKS },
10032cf86f6SMauro Carvalho Chehab 	{ 0x2ab715b7, KEY_MEDIA }, /* Thumbnail */
10132cf86f6SMauro Carvalho Chehab 	{ 0x298595b7, KEY_SUBTITLE },
10232cf86f6SMauro Carvalho Chehab 	{ 0x2b8595b7, KEY_LANGUAGE },
10332cf86f6SMauro Carvalho Chehab 
10432cf86f6SMauro Carvalho Chehab 	{ 0x29a595b7, KEY_ZOOM },
10532cf86f6SMauro Carvalho Chehab 	{ 0x2aa395b7, KEY_SCREEN }, /* FullScreen */
10632cf86f6SMauro Carvalho Chehab 
10732cf86f6SMauro Carvalho Chehab 	{ 0x299115b7, KEY_KEYBOARD },
10832cf86f6SMauro Carvalho Chehab 	{ 0x299135b7, KEY_KEYBOARD },
10932cf86f6SMauro Carvalho Chehab 
11032cf86f6SMauro Carvalho Chehab 	{ 0x01010000, BTN_LEFT },
11132cf86f6SMauro Carvalho Chehab 	{ 0x01020000, BTN_RIGHT },
11232cf86f6SMauro Carvalho Chehab 	{ 0x01010080, BTN_LEFT },
11332cf86f6SMauro Carvalho Chehab 	{ 0x01020080, BTN_RIGHT },
11432cf86f6SMauro Carvalho Chehab 	{ 0x688301b7, BTN_LEFT },
11532cf86f6SMauro Carvalho Chehab 	{ 0x688481b7, BTN_RIGHT },
11632cf86f6SMauro Carvalho Chehab 
11732cf86f6SMauro Carvalho Chehab 	{ 0x2a9395b7, KEY_CYCLEWINDOWS }, /* TaskSwitcher */
11832cf86f6SMauro Carvalho Chehab 	{ 0x2b8395b7, KEY_TIME }, /* Timer */
11932cf86f6SMauro Carvalho Chehab 
12032cf86f6SMauro Carvalho Chehab 	{ 0x289115b7, KEY_POWER },
12132cf86f6SMauro Carvalho Chehab 	{ 0x29b195b7, KEY_EJECTCD }, /* the one next to play */
12232cf86f6SMauro Carvalho Chehab 	{ 0x299395b7, KEY_EJECTCLOSECD }, /* eject (by TaskSw) */
12332cf86f6SMauro Carvalho Chehab 
12432cf86f6SMauro Carvalho Chehab 	{ 0x02800000, KEY_CONTEXT_MENU }, /* Left Menu */
12532cf86f6SMauro Carvalho Chehab 	{ 0x2b8195b7, KEY_CONTEXT_MENU }, /* Left Menu*/
12632cf86f6SMauro Carvalho Chehab 	{ 0x02000065, KEY_COMPOSE }, /* RightMenu */
12732cf86f6SMauro Carvalho Chehab 	{ 0x28b715b7, KEY_COMPOSE }, /* RightMenu */
12832cf86f6SMauro Carvalho Chehab 	{ 0x2ab195b7, KEY_PROG1 }, /* Go or MultiMon */
12932cf86f6SMauro Carvalho Chehab 	{ 0x29b715b7, KEY_DASHBOARD }, /* AppLauncher */
13032cf86f6SMauro Carvalho Chehab };
13132cf86f6SMauro Carvalho Chehab 
13232cf86f6SMauro Carvalho Chehab static struct rc_keymap imon_pad_map = {
13332cf86f6SMauro Carvalho Chehab 	.map = {
13432cf86f6SMauro Carvalho Chehab 		.scan    = imon_pad,
13532cf86f6SMauro Carvalho Chehab 		.size    = ARRAY_SIZE(imon_pad),
13632cf86f6SMauro Carvalho Chehab 		/* actual protocol details unknown, hardware decoder */
13752b66144SMauro Carvalho Chehab 		.rc_type = RC_TYPE_OTHER,
13832cf86f6SMauro Carvalho Chehab 		.name    = RC_MAP_IMON_PAD,
13932cf86f6SMauro Carvalho Chehab 	}
14032cf86f6SMauro Carvalho Chehab };
14132cf86f6SMauro Carvalho Chehab 
14232cf86f6SMauro Carvalho Chehab static int __init init_rc_map_imon_pad(void)
14332cf86f6SMauro Carvalho Chehab {
14432cf86f6SMauro Carvalho Chehab 	return ir_register_map(&imon_pad_map);
14532cf86f6SMauro Carvalho Chehab }
14632cf86f6SMauro Carvalho Chehab 
14732cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_imon_pad(void)
14832cf86f6SMauro Carvalho Chehab {
14932cf86f6SMauro Carvalho Chehab 	ir_unregister_map(&imon_pad_map);
15032cf86f6SMauro Carvalho Chehab }
15132cf86f6SMauro Carvalho Chehab 
15232cf86f6SMauro Carvalho Chehab module_init(init_rc_map_imon_pad)
15332cf86f6SMauro Carvalho Chehab module_exit(exit_rc_map_imon_pad)
15432cf86f6SMauro Carvalho Chehab 
15532cf86f6SMauro Carvalho Chehab MODULE_LICENSE("GPL");
15632cf86f6SMauro Carvalho Chehab MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
157