162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
262306a36Sopenharmony_ci/* rc5-imon-mce.c - Keytable for Windows Media Center RC-6 remotes for use
362306a36Sopenharmony_ci * with the SoundGraph iMON/Antec Veris hardware IR decoder
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <media/rc-map.h>
962306a36Sopenharmony_ci#include <linux/module.h>
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/* mce-mode imon mce remote key table */
1262306a36Sopenharmony_cistatic struct rc_map_table imon_mce[] = {
1362306a36Sopenharmony_ci	/* keys sorted mostly by frequency of use to optimize lookups */
1462306a36Sopenharmony_ci	{ 0x800ff415, KEY_REWIND },
1562306a36Sopenharmony_ci	{ 0x800ff414, KEY_FASTFORWARD },
1662306a36Sopenharmony_ci	{ 0x800ff41b, KEY_PREVIOUS },
1762306a36Sopenharmony_ci	{ 0x800ff41a, KEY_NEXT },
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci	{ 0x800ff416, KEY_PLAY },
2062306a36Sopenharmony_ci	{ 0x800ff418, KEY_PAUSE },
2162306a36Sopenharmony_ci	{ 0x800ff419, KEY_STOP },
2262306a36Sopenharmony_ci	{ 0x800ff417, KEY_RECORD },
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	{ 0x02000052, KEY_UP },
2562306a36Sopenharmony_ci	{ 0x02000051, KEY_DOWN },
2662306a36Sopenharmony_ci	{ 0x02000050, KEY_LEFT },
2762306a36Sopenharmony_ci	{ 0x0200004f, KEY_RIGHT },
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci	{ 0x800ff41e, KEY_UP },
3062306a36Sopenharmony_ci	{ 0x800ff41f, KEY_DOWN },
3162306a36Sopenharmony_ci	{ 0x800ff420, KEY_LEFT },
3262306a36Sopenharmony_ci	{ 0x800ff421, KEY_RIGHT },
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci	/* 0x800ff40b also KEY_NUMERIC_POUND on some receivers */
3562306a36Sopenharmony_ci	{ 0x800ff40b, KEY_ENTER },
3662306a36Sopenharmony_ci	{ 0x02000028, KEY_ENTER },
3762306a36Sopenharmony_ci/* the OK and Enter buttons decode to the same value on some remotes
3862306a36Sopenharmony_ci	{ 0x02000028, KEY_OK }, */
3962306a36Sopenharmony_ci	{ 0x800ff422, KEY_OK },
4062306a36Sopenharmony_ci	{ 0x0200002a, KEY_EXIT },
4162306a36Sopenharmony_ci	{ 0x800ff423, KEY_EXIT },
4262306a36Sopenharmony_ci	{ 0x02000029, KEY_DELETE },
4362306a36Sopenharmony_ci	/* 0x800ff40a also KEY_NUMERIC_STAR on some receivers */
4462306a36Sopenharmony_ci	{ 0x800ff40a, KEY_DELETE },
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci	{ 0x800ff40e, KEY_MUTE },
4762306a36Sopenharmony_ci	{ 0x800ff410, KEY_VOLUMEUP },
4862306a36Sopenharmony_ci	{ 0x800ff411, KEY_VOLUMEDOWN },
4962306a36Sopenharmony_ci	{ 0x800ff412, KEY_CHANNELUP },
5062306a36Sopenharmony_ci	{ 0x800ff413, KEY_CHANNELDOWN },
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci	{ 0x0200001e, KEY_NUMERIC_1 },
5362306a36Sopenharmony_ci	{ 0x0200001f, KEY_NUMERIC_2 },
5462306a36Sopenharmony_ci	{ 0x02000020, KEY_NUMERIC_3 },
5562306a36Sopenharmony_ci	{ 0x02000021, KEY_NUMERIC_4 },
5662306a36Sopenharmony_ci	{ 0x02000022, KEY_NUMERIC_5 },
5762306a36Sopenharmony_ci	{ 0x02000023, KEY_NUMERIC_6 },
5862306a36Sopenharmony_ci	{ 0x02000024, KEY_NUMERIC_7 },
5962306a36Sopenharmony_ci	{ 0x02000025, KEY_NUMERIC_8 },
6062306a36Sopenharmony_ci	{ 0x02000026, KEY_NUMERIC_9 },
6162306a36Sopenharmony_ci	{ 0x02000027, KEY_NUMERIC_0 },
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci	{ 0x800ff401, KEY_NUMERIC_1 },
6462306a36Sopenharmony_ci	{ 0x800ff402, KEY_NUMERIC_2 },
6562306a36Sopenharmony_ci	{ 0x800ff403, KEY_NUMERIC_3 },
6662306a36Sopenharmony_ci	{ 0x800ff404, KEY_NUMERIC_4 },
6762306a36Sopenharmony_ci	{ 0x800ff405, KEY_NUMERIC_5 },
6862306a36Sopenharmony_ci	{ 0x800ff406, KEY_NUMERIC_6 },
6962306a36Sopenharmony_ci	{ 0x800ff407, KEY_NUMERIC_7 },
7062306a36Sopenharmony_ci	{ 0x800ff408, KEY_NUMERIC_8 },
7162306a36Sopenharmony_ci	{ 0x800ff409, KEY_NUMERIC_9 },
7262306a36Sopenharmony_ci	{ 0x800ff400, KEY_NUMERIC_0 },
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci	{ 0x02200025, KEY_NUMERIC_STAR },
7562306a36Sopenharmony_ci	{ 0x02200020, KEY_NUMERIC_POUND },
7662306a36Sopenharmony_ci	/* 0x800ff41d also KEY_BLUE on some receivers */
7762306a36Sopenharmony_ci	{ 0x800ff41d, KEY_NUMERIC_STAR },
7862306a36Sopenharmony_ci	/* 0x800ff41c also KEY_PREVIOUS on some receivers */
7962306a36Sopenharmony_ci	{ 0x800ff41c, KEY_NUMERIC_POUND },
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci	{ 0x800ff446, KEY_TV },
8262306a36Sopenharmony_ci	{ 0x800ff447, KEY_AUDIO }, /* My Music */
8362306a36Sopenharmony_ci	{ 0x800ff448, KEY_PVR }, /* RecordedTV */
8462306a36Sopenharmony_ci	{ 0x800ff449, KEY_CAMERA },
8562306a36Sopenharmony_ci	{ 0x800ff44a, KEY_VIDEO },
8662306a36Sopenharmony_ci	/* 0x800ff424 also KEY_MENU on some receivers */
8762306a36Sopenharmony_ci	{ 0x800ff424, KEY_DVD },
8862306a36Sopenharmony_ci	/* 0x800ff425 also KEY_GREEN on some receivers */
8962306a36Sopenharmony_ci	{ 0x800ff425, KEY_TUNER }, /* LiveTV */
9062306a36Sopenharmony_ci	{ 0x800ff450, KEY_RADIO },
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci	{ 0x800ff44c, KEY_LANGUAGE },
9362306a36Sopenharmony_ci	{ 0x800ff427, KEY_ZOOM }, /* Aspect */
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci	{ 0x800ff45b, KEY_RED },
9662306a36Sopenharmony_ci	{ 0x800ff45c, KEY_GREEN },
9762306a36Sopenharmony_ci	{ 0x800ff45d, KEY_YELLOW },
9862306a36Sopenharmony_ci	{ 0x800ff45e, KEY_BLUE },
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci	{ 0x800ff466, KEY_RED },
10162306a36Sopenharmony_ci	/* { 0x800ff425, KEY_GREEN }, */
10262306a36Sopenharmony_ci	{ 0x800ff468, KEY_YELLOW },
10362306a36Sopenharmony_ci	/* { 0x800ff41d, KEY_BLUE }, */
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci	{ 0x800ff40f, KEY_INFO },
10662306a36Sopenharmony_ci	{ 0x800ff426, KEY_EPG }, /* Guide */
10762306a36Sopenharmony_ci	{ 0x800ff45a, KEY_SUBTITLE }, /* Caption/Teletext */
10862306a36Sopenharmony_ci	{ 0x800ff44d, KEY_TITLE },
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci	{ 0x800ff40c, KEY_POWER },
11162306a36Sopenharmony_ci	{ 0x800ff40d, KEY_MEDIA }, /* Windows MCE button */
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci};
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_cistatic struct rc_map_list imon_mce_map = {
11662306a36Sopenharmony_ci	.map = {
11762306a36Sopenharmony_ci		.scan     = imon_mce,
11862306a36Sopenharmony_ci		.size     = ARRAY_SIZE(imon_mce),
11962306a36Sopenharmony_ci		/* its RC6, but w/a hardware decoder */
12062306a36Sopenharmony_ci		.rc_proto = RC_PROTO_RC6_MCE,
12162306a36Sopenharmony_ci		.name     = RC_MAP_IMON_MCE,
12262306a36Sopenharmony_ci	}
12362306a36Sopenharmony_ci};
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_cistatic int __init init_rc_map_imon_mce(void)
12662306a36Sopenharmony_ci{
12762306a36Sopenharmony_ci	return rc_map_register(&imon_mce_map);
12862306a36Sopenharmony_ci}
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_cistatic void __exit exit_rc_map_imon_mce(void)
13162306a36Sopenharmony_ci{
13262306a36Sopenharmony_ci	rc_map_unregister(&imon_mce_map);
13362306a36Sopenharmony_ci}
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_cimodule_init(init_rc_map_imon_mce)
13662306a36Sopenharmony_cimodule_exit(exit_rc_map_imon_mce)
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ciMODULE_LICENSE("GPL");
13962306a36Sopenharmony_ciMODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
140