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