xref: /linux/drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1688c73c6SMauro Carvalho Chehab // SPDX-License-Identifier: GPL-2.0+
2688c73c6SMauro Carvalho Chehab // msi-tvanywhere-plus.h - Keytable for msi_tvanywhere_plus Remote Controller
3688c73c6SMauro Carvalho Chehab //
4688c73c6SMauro Carvalho Chehab // keymap imported from ir-keymaps.c
5688c73c6SMauro Carvalho Chehab //
6688c73c6SMauro Carvalho Chehab // Copyright (c) 2010 by Mauro Carvalho Chehab
732cf86f6SMauro Carvalho Chehab 
832cf86f6SMauro Carvalho Chehab #include <media/rc-map.h>
97a707b89SPaul Gortmaker #include <linux/module.h>
1032cf86f6SMauro Carvalho Chehab 
1132cf86f6SMauro Carvalho Chehab /*
1232cf86f6SMauro Carvalho Chehab   Keycodes for remote on the MSI TV@nywhere Plus. The controller IC on the card
1332cf86f6SMauro Carvalho Chehab   is marked "KS003". The controller is I2C at address 0x30, but does not seem
1432cf86f6SMauro Carvalho Chehab   to respond to probes until a read is performed from a valid device.
1532cf86f6SMauro Carvalho Chehab   I don't know why...
1632cf86f6SMauro Carvalho Chehab 
1732cf86f6SMauro Carvalho Chehab   Note: This remote may be of similar or identical design to the
1832cf86f6SMauro Carvalho Chehab   Pixelview remote (?).  The raw codes and duplicate button codes
1932cf86f6SMauro Carvalho Chehab   appear to be the same.
2032cf86f6SMauro Carvalho Chehab 
2132cf86f6SMauro Carvalho Chehab   Henry Wong <henry@stuffedcow.net>
2232cf86f6SMauro Carvalho Chehab   Some changes to formatting and keycodes by Mark Schultz <n9xmj@yahoo.com>
2332cf86f6SMauro Carvalho Chehab */
2432cf86f6SMauro Carvalho Chehab 
252f4f58d6SMauro Carvalho Chehab static struct rc_map_table msi_tvanywhere_plus[] = {
2632cf86f6SMauro Carvalho Chehab 
2732cf86f6SMauro Carvalho Chehab /*  ---- Remote Button Layout ----
2832cf86f6SMauro Carvalho Chehab 
2932cf86f6SMauro Carvalho Chehab     POWER   SOURCE  SCAN    MUTE
3032cf86f6SMauro Carvalho Chehab     TV/FM   1       2       3
3132cf86f6SMauro Carvalho Chehab     |>      4       5       6
3232cf86f6SMauro Carvalho Chehab     <|      7       8       9
3332cf86f6SMauro Carvalho Chehab     ^^UP    0       +       RECALL
3432cf86f6SMauro Carvalho Chehab     vvDN    RECORD  STOP    PLAY
3532cf86f6SMauro Carvalho Chehab 
3632cf86f6SMauro Carvalho Chehab 	MINIMIZE          ZOOM
3732cf86f6SMauro Carvalho Chehab 
3832cf86f6SMauro Carvalho Chehab 		  CH+
3932cf86f6SMauro Carvalho Chehab       VOL-                   VOL+
4032cf86f6SMauro Carvalho Chehab 		  CH-
4132cf86f6SMauro Carvalho Chehab 
4232cf86f6SMauro Carvalho Chehab 	SNAPSHOT           MTS
4332cf86f6SMauro Carvalho Chehab 
4432cf86f6SMauro Carvalho Chehab      <<      FUNC    >>     RESET
4532cf86f6SMauro Carvalho Chehab */
4632cf86f6SMauro Carvalho Chehab 
471910ea42SBastien Nocera 	{ 0x01, KEY_NUMERIC_1 },	/* 1 */
481910ea42SBastien Nocera 	{ 0x0b, KEY_NUMERIC_2 },	/* 2 */
491910ea42SBastien Nocera 	{ 0x1b, KEY_NUMERIC_3 },	/* 3 */
501910ea42SBastien Nocera 	{ 0x05, KEY_NUMERIC_4 },	/* 4 */
511910ea42SBastien Nocera 	{ 0x09, KEY_NUMERIC_5 },	/* 5 */
521910ea42SBastien Nocera 	{ 0x15, KEY_NUMERIC_6 },	/* 6 */
531910ea42SBastien Nocera 	{ 0x06, KEY_NUMERIC_7 },	/* 7 */
541910ea42SBastien Nocera 	{ 0x0a, KEY_NUMERIC_8 },	/* 8 */
551910ea42SBastien Nocera 	{ 0x12, KEY_NUMERIC_9 },	/* 9 */
561910ea42SBastien Nocera 	{ 0x02, KEY_NUMERIC_0 },	/* 0 */
5732cf86f6SMauro Carvalho Chehab 	{ 0x10, KEY_KPPLUS },		/* + */
5832cf86f6SMauro Carvalho Chehab 	{ 0x13, KEY_AGAIN },		/* Recall */
5932cf86f6SMauro Carvalho Chehab 
6032cf86f6SMauro Carvalho Chehab 	{ 0x1e, KEY_POWER },		/* Power */
616f9e46b4SMauro Carvalho Chehab 	{ 0x07, KEY_VIDEO },		/* Source */
6232cf86f6SMauro Carvalho Chehab 	{ 0x1c, KEY_SEARCH },		/* Scan */
6332cf86f6SMauro Carvalho Chehab 	{ 0x18, KEY_MUTE },		/* Mute */
6432cf86f6SMauro Carvalho Chehab 
6532cf86f6SMauro Carvalho Chehab 	{ 0x03, KEY_RADIO },		/* TV/FM */
6632cf86f6SMauro Carvalho Chehab 	/* The next four keys are duplicates that appear to send the
6732cf86f6SMauro Carvalho Chehab 	   same IR code as Ch+, Ch-, >>, and << .  The raw code assigned
6832cf86f6SMauro Carvalho Chehab 	   to them is the actual code + 0x20 - they will never be
6932cf86f6SMauro Carvalho Chehab 	   detected as such unless some way is discovered to distinguish
7032cf86f6SMauro Carvalho Chehab 	   these buttons from those that have the same code. */
7132cf86f6SMauro Carvalho Chehab 	{ 0x3f, KEY_RIGHT },		/* |> and Ch+ */
7232cf86f6SMauro Carvalho Chehab 	{ 0x37, KEY_LEFT },		/* <| and Ch- */
7332cf86f6SMauro Carvalho Chehab 	{ 0x2c, KEY_UP },		/* ^^Up and >> */
7432cf86f6SMauro Carvalho Chehab 	{ 0x24, KEY_DOWN },		/* vvDn and << */
7532cf86f6SMauro Carvalho Chehab 
7632cf86f6SMauro Carvalho Chehab 	{ 0x00, KEY_RECORD },		/* Record */
7732cf86f6SMauro Carvalho Chehab 	{ 0x08, KEY_STOP },		/* Stop */
7832cf86f6SMauro Carvalho Chehab 	{ 0x11, KEY_PLAY },		/* Play */
7932cf86f6SMauro Carvalho Chehab 
8032cf86f6SMauro Carvalho Chehab 	{ 0x0f, KEY_CLOSE },		/* Minimize */
8132cf86f6SMauro Carvalho Chehab 	{ 0x19, KEY_ZOOM },		/* Zoom */
8232cf86f6SMauro Carvalho Chehab 	{ 0x1a, KEY_CAMERA },		/* Snapshot */
8332cf86f6SMauro Carvalho Chehab 	{ 0x0d, KEY_LANGUAGE },		/* MTS */
8432cf86f6SMauro Carvalho Chehab 
8532cf86f6SMauro Carvalho Chehab 	{ 0x14, KEY_VOLUMEDOWN },	/* Vol- */
8632cf86f6SMauro Carvalho Chehab 	{ 0x16, KEY_VOLUMEUP },		/* Vol+ */
8732cf86f6SMauro Carvalho Chehab 	{ 0x17, KEY_CHANNELDOWN },	/* Ch- */
8832cf86f6SMauro Carvalho Chehab 	{ 0x1f, KEY_CHANNELUP },	/* Ch+ */
8932cf86f6SMauro Carvalho Chehab 
9032cf86f6SMauro Carvalho Chehab 	{ 0x04, KEY_REWIND },		/* << */
9132cf86f6SMauro Carvalho Chehab 	{ 0x0e, KEY_MENU },		/* Function */
9232cf86f6SMauro Carvalho Chehab 	{ 0x0c, KEY_FASTFORWARD },	/* >> */
9332cf86f6SMauro Carvalho Chehab 	{ 0x1d, KEY_RESTART },		/* Reset */
9432cf86f6SMauro Carvalho Chehab };
9532cf86f6SMauro Carvalho Chehab 
96d100e659SMauro Carvalho Chehab static struct rc_map_list msi_tvanywhere_plus_map = {
9732cf86f6SMauro Carvalho Chehab 	.map = {
9832cf86f6SMauro Carvalho Chehab 		.scan     = msi_tvanywhere_plus,
9932cf86f6SMauro Carvalho Chehab 		.size     = ARRAY_SIZE(msi_tvanywhere_plus),
1006d741bfeSSean Young 		.rc_proto = RC_PROTO_UNKNOWN,	/* Legacy IR type */
10132cf86f6SMauro Carvalho Chehab 		.name     = RC_MAP_MSI_TVANYWHERE_PLUS,
10232cf86f6SMauro Carvalho Chehab 	}
10332cf86f6SMauro Carvalho Chehab };
10432cf86f6SMauro Carvalho Chehab 
init_rc_map_msi_tvanywhere_plus(void)10532cf86f6SMauro Carvalho Chehab static int __init init_rc_map_msi_tvanywhere_plus(void)
10632cf86f6SMauro Carvalho Chehab {
107d100e659SMauro Carvalho Chehab 	return rc_map_register(&msi_tvanywhere_plus_map);
10832cf86f6SMauro Carvalho Chehab }
10932cf86f6SMauro Carvalho Chehab 
exit_rc_map_msi_tvanywhere_plus(void)11032cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_msi_tvanywhere_plus(void)
11132cf86f6SMauro Carvalho Chehab {
112d100e659SMauro Carvalho Chehab 	rc_map_unregister(&msi_tvanywhere_plus_map);
11332cf86f6SMauro Carvalho Chehab }
11432cf86f6SMauro Carvalho Chehab 
11532cf86f6SMauro Carvalho Chehab module_init(init_rc_map_msi_tvanywhere_plus)
11632cf86f6SMauro Carvalho Chehab module_exit(exit_rc_map_msi_tvanywhere_plus)
11732cf86f6SMauro Carvalho Chehab 
11832cf86f6SMauro Carvalho Chehab MODULE_LICENSE("GPL");
11937e59f87SMauro Carvalho Chehab MODULE_AUTHOR("Mauro Carvalho Chehab");
120*462e108bSHans Verkuil MODULE_DESCRIPTION("MSI TV@nywhere Plus remote controller keytable");
121