1 /* msi-tvanywhere-plus.h - Keytable for msi_tvanywhere_plus Remote Controller
2  *
3  * keymap imported from ir-keymaps.c
4  *
5  * Copyright (c) 2010 by Mauro Carvalho Chehab
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 #include <linux/module.h>
15 
16 /*
17   Keycodes for remote on the MSI TV@nywhere Plus. The controller IC on the card
18   is marked "KS003". The controller is I2C at address 0x30, but does not seem
19   to respond to probes until a read is performed from a valid device.
20   I don't know why...
21 
22   Note: This remote may be of similar or identical design to the
23   Pixelview remote (?).  The raw codes and duplicate button codes
24   appear to be the same.
25 
26   Henry Wong <henry@stuffedcow.net>
27   Some changes to formatting and keycodes by Mark Schultz <n9xmj@yahoo.com>
28 */
29 
30 static struct rc_map_table msi_tvanywhere_plus[] = {
31 
32 /*  ---- Remote Button Layout ----
33 
34     POWER   SOURCE  SCAN    MUTE
35     TV/FM   1       2       3
36     |>      4       5       6
37     <|      7       8       9
38     ^^UP    0       +       RECALL
39     vvDN    RECORD  STOP    PLAY
40 
41 	MINIMIZE          ZOOM
42 
43 		  CH+
44       VOL-                   VOL+
45 		  CH-
46 
47 	SNAPSHOT           MTS
48 
49      <<      FUNC    >>     RESET
50 */
51 
52 	{ 0x01, KEY_1 },		/* 1 */
53 	{ 0x0b, KEY_2 },		/* 2 */
54 	{ 0x1b, KEY_3 },		/* 3 */
55 	{ 0x05, KEY_4 },		/* 4 */
56 	{ 0x09, KEY_5 },		/* 5 */
57 	{ 0x15, KEY_6 },		/* 6 */
58 	{ 0x06, KEY_7 },		/* 7 */
59 	{ 0x0a, KEY_8 },		/* 8 */
60 	{ 0x12, KEY_9 },		/* 9 */
61 	{ 0x02, KEY_0 },		/* 0 */
62 	{ 0x10, KEY_KPPLUS },		/* + */
63 	{ 0x13, KEY_AGAIN },		/* Recall */
64 
65 	{ 0x1e, KEY_POWER },		/* Power */
66 	{ 0x07, KEY_VIDEO },		/* Source */
67 	{ 0x1c, KEY_SEARCH },		/* Scan */
68 	{ 0x18, KEY_MUTE },		/* Mute */
69 
70 	{ 0x03, KEY_RADIO },		/* TV/FM */
71 	/* The next four keys are duplicates that appear to send the
72 	   same IR code as Ch+, Ch-, >>, and << .  The raw code assigned
73 	   to them is the actual code + 0x20 - they will never be
74 	   detected as such unless some way is discovered to distinguish
75 	   these buttons from those that have the same code. */
76 	{ 0x3f, KEY_RIGHT },		/* |> and Ch+ */
77 	{ 0x37, KEY_LEFT },		/* <| and Ch- */
78 	{ 0x2c, KEY_UP },		/* ^^Up and >> */
79 	{ 0x24, KEY_DOWN },		/* vvDn and << */
80 
81 	{ 0x00, KEY_RECORD },		/* Record */
82 	{ 0x08, KEY_STOP },		/* Stop */
83 	{ 0x11, KEY_PLAY },		/* Play */
84 
85 	{ 0x0f, KEY_CLOSE },		/* Minimize */
86 	{ 0x19, KEY_ZOOM },		/* Zoom */
87 	{ 0x1a, KEY_CAMERA },		/* Snapshot */
88 	{ 0x0d, KEY_LANGUAGE },		/* MTS */
89 
90 	{ 0x14, KEY_VOLUMEDOWN },	/* Vol- */
91 	{ 0x16, KEY_VOLUMEUP },		/* Vol+ */
92 	{ 0x17, KEY_CHANNELDOWN },	/* Ch- */
93 	{ 0x1f, KEY_CHANNELUP },	/* Ch+ */
94 
95 	{ 0x04, KEY_REWIND },		/* << */
96 	{ 0x0e, KEY_MENU },		/* Function */
97 	{ 0x0c, KEY_FASTFORWARD },	/* >> */
98 	{ 0x1d, KEY_RESTART },		/* Reset */
99 };
100 
101 static struct rc_map_list msi_tvanywhere_plus_map = {
102 	.map = {
103 		.scan    = msi_tvanywhere_plus,
104 		.size    = ARRAY_SIZE(msi_tvanywhere_plus),
105 		.rc_type = RC_TYPE_UNKNOWN,	/* Legacy IR type */
106 		.name    = RC_MAP_MSI_TVANYWHERE_PLUS,
107 	}
108 };
109 
110 static int __init init_rc_map_msi_tvanywhere_plus(void)
111 {
112 	return rc_map_register(&msi_tvanywhere_plus_map);
113 }
114 
115 static void __exit exit_rc_map_msi_tvanywhere_plus(void)
116 {
117 	rc_map_unregister(&msi_tvanywhere_plus_map);
118 }
119 
120 module_init(init_rc_map_msi_tvanywhere_plus)
121 module_exit(exit_rc_map_msi_tvanywhere_plus)
122 
123 MODULE_LICENSE("GPL");
124 MODULE_AUTHOR("Mauro Carvalho Chehab");
125