1// SPDX-License-Identifier: GPL-2.0+
2//
3// Copyright (C) 2021 Christian Hewitt <christianshewitt@gmail.com>
4
5#include <media/rc-map.h>
6#include <linux/module.h>
7
8//
9// Keytable for the Mecool Kiii Pro remote control
10//
11
12static struct rc_map_table mecool_kiii_pro[] = {
13	{ 0x59, KEY_POWER },
14
15	{ 0x52, KEY_1 },
16	{ 0x50, KEY_2 },
17	{ 0x10, KEY_3 },
18	{ 0x56, KEY_4 },
19	{ 0x54, KEY_5 },
20	{ 0x14, KEY_6 },
21	{ 0x4e, KEY_7 },
22	{ 0x4c, KEY_8 },
23	{ 0x0c, KEY_9 },
24	{ 0x02, KEY_INFO },
25	{ 0x0f, KEY_0 },
26	{ 0x51, KEY_DELETE },
27	{ 0x1f, KEY_FAVORITES},
28	{ 0x09, KEY_SUBTITLE },
29	{ 0x01, KEY_LANGUAGE }, // AUDIO
30
31	{ 0x42, KEY_RED },
32	{ 0x40, KEY_GREEN },
33	{ 0x00, KEY_YELLOW},
34	{ 0x03, KEY_BLUE }, // RADIO
35
36	{ 0x0d, KEY_HOME },
37	{ 0x4d, KEY_EPG },
38	{ 0x45, KEY_MENU },
39	{ 0x05, KEY_EXIT },
40
41	{ 0x5a, KEY_LEFT },
42	{ 0x1b, KEY_RIGHT },
43	{ 0x06, KEY_UP },
44	{ 0x16, KEY_DOWN },
45	{ 0x1a, KEY_OK },
46
47	{ 0x13, KEY_VOLUMEUP },
48	{ 0x17, KEY_VOLUMEDOWN },
49	{ 0x19, KEY_MUTE },
50	{ 0x12, KEY_CONTEXT_MENU }, // MOUSE
51	{ 0x55, KEY_CHANNELUP }, // PAGE_UP
52	{ 0x15, KEY_CHANNELDOWN }, // PAGE_DOWN
53
54	{ 0x4a, KEY_REWIND },
55	{ 0x48, KEY_FORWARD },
56	{ 0x46, KEY_PLAYPAUSE },
57	{ 0x44, KEY_STOP },
58
59	{ 0x08, KEY_PREVIOUSSONG},
60	{ 0x0b, KEY_NEXTSONG},
61	{ 0x04, KEY_PVR },
62	{ 0x64, KEY_RECORD },
63};
64
65static struct rc_map_list mecool_kiii_pro_map = {
66	.map = {
67		.scan     = mecool_kiii_pro,
68		.size     = ARRAY_SIZE(mecool_kiii_pro),
69		.rc_proto = RC_PROTO_NEC,
70		.name     = RC_MAP_MECOOL_KIII_PRO,
71	}
72};
73
74static int __init init_rc_map_mecool_kiii_pro(void)
75{
76	return rc_map_register(&mecool_kiii_pro_map);
77}
78
79static void __exit exit_rc_map_mecool_kiii_pro(void)
80{
81	rc_map_unregister(&mecool_kiii_pro_map);
82}
83
84module_init(init_rc_map_mecool_kiii_pro)
85module_exit(exit_rc_map_mecool_kiii_pro)
86
87MODULE_LICENSE("GPL");
88MODULE_AUTHOR("Christian Hewitt <christianshewitt@gmail.com");
89MODULE_DESCRIPTION("Mecool Kiii Pro remote controller keytable");
90