1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0+
2*4882a593Smuzhiyun // kworld-plus-tv-analog.h - Keytable for kworld_plus_tv_analog Remote Controller
3*4882a593Smuzhiyun //
4*4882a593Smuzhiyun // keymap imported from ir-keymaps.c
5*4882a593Smuzhiyun //
6*4882a593Smuzhiyun // Copyright (c) 2010 by Mauro Carvalho Chehab
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun #include <media/rc-map.h>
9*4882a593Smuzhiyun #include <linux/module.h>
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun /* Kworld Plus TV Analog Lite PCI IR
12*4882a593Smuzhiyun Mauro Carvalho Chehab <mchehab@kernel.org>
13*4882a593Smuzhiyun */
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun static struct rc_map_table kworld_plus_tv_analog[] = {
16*4882a593Smuzhiyun { 0x0c, KEY_MEDIA }, /* Kworld key */
17*4882a593Smuzhiyun { 0x16, KEY_CLOSECD }, /* -> ) */
18*4882a593Smuzhiyun { 0x1d, KEY_POWER2 },
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun { 0x00, KEY_NUMERIC_1 },
21*4882a593Smuzhiyun { 0x01, KEY_NUMERIC_2 },
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun /* Two keys have the same code: 3 and left */
24*4882a593Smuzhiyun { 0x02, KEY_NUMERIC_3 },
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun /* Two keys have the same code: 4 and right */
27*4882a593Smuzhiyun { 0x03, KEY_NUMERIC_4 },
28*4882a593Smuzhiyun { 0x04, KEY_NUMERIC_5 },
29*4882a593Smuzhiyun { 0x05, KEY_NUMERIC_6 },
30*4882a593Smuzhiyun { 0x06, KEY_NUMERIC_7 },
31*4882a593Smuzhiyun { 0x07, KEY_NUMERIC_8 },
32*4882a593Smuzhiyun { 0x08, KEY_NUMERIC_9 },
33*4882a593Smuzhiyun { 0x0a, KEY_NUMERIC_0 },
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun { 0x09, KEY_AGAIN },
36*4882a593Smuzhiyun { 0x14, KEY_MUTE },
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun { 0x20, KEY_UP },
39*4882a593Smuzhiyun { 0x21, KEY_DOWN },
40*4882a593Smuzhiyun { 0x0b, KEY_ENTER },
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun { 0x10, KEY_CHANNELUP },
43*4882a593Smuzhiyun { 0x11, KEY_CHANNELDOWN },
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun /* Couldn't map key left/key right since those
46*4882a593Smuzhiyun conflict with '3' and '4' scancodes
47*4882a593Smuzhiyun I dunno what the original driver does
48*4882a593Smuzhiyun */
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun { 0x13, KEY_VOLUMEUP },
51*4882a593Smuzhiyun { 0x12, KEY_VOLUMEDOWN },
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun /* The lower part of the IR
54*4882a593Smuzhiyun There are several duplicated keycodes there.
55*4882a593Smuzhiyun Most of them conflict with digits.
56*4882a593Smuzhiyun Add mappings just to the unused scancodes.
57*4882a593Smuzhiyun Somehow, the original driver has a way to know,
58*4882a593Smuzhiyun but this doesn't seem to be on some GPIO.
59*4882a593Smuzhiyun Also, it is not related to the time between keyup
60*4882a593Smuzhiyun and keydown.
61*4882a593Smuzhiyun */
62*4882a593Smuzhiyun { 0x19, KEY_TIME}, /* Timeshift */
63*4882a593Smuzhiyun { 0x1a, KEY_STOP},
64*4882a593Smuzhiyun { 0x1b, KEY_RECORD},
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun { 0x22, KEY_TEXT},
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun { 0x15, KEY_AUDIO}, /* ((*)) */
69*4882a593Smuzhiyun { 0x0f, KEY_ZOOM},
70*4882a593Smuzhiyun { 0x1c, KEY_CAMERA}, /* snapshot */
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun { 0x18, KEY_RED}, /* B */
73*4882a593Smuzhiyun { 0x23, KEY_GREEN}, /* C */
74*4882a593Smuzhiyun };
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun static struct rc_map_list kworld_plus_tv_analog_map = {
77*4882a593Smuzhiyun .map = {
78*4882a593Smuzhiyun .scan = kworld_plus_tv_analog,
79*4882a593Smuzhiyun .size = ARRAY_SIZE(kworld_plus_tv_analog),
80*4882a593Smuzhiyun .rc_proto = RC_PROTO_UNKNOWN, /* Legacy IR type */
81*4882a593Smuzhiyun .name = RC_MAP_KWORLD_PLUS_TV_ANALOG,
82*4882a593Smuzhiyun }
83*4882a593Smuzhiyun };
84*4882a593Smuzhiyun
init_rc_map_kworld_plus_tv_analog(void)85*4882a593Smuzhiyun static int __init init_rc_map_kworld_plus_tv_analog(void)
86*4882a593Smuzhiyun {
87*4882a593Smuzhiyun return rc_map_register(&kworld_plus_tv_analog_map);
88*4882a593Smuzhiyun }
89*4882a593Smuzhiyun
exit_rc_map_kworld_plus_tv_analog(void)90*4882a593Smuzhiyun static void __exit exit_rc_map_kworld_plus_tv_analog(void)
91*4882a593Smuzhiyun {
92*4882a593Smuzhiyun rc_map_unregister(&kworld_plus_tv_analog_map);
93*4882a593Smuzhiyun }
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun module_init(init_rc_map_kworld_plus_tv_analog)
96*4882a593Smuzhiyun module_exit(exit_rc_map_kworld_plus_tv_analog)
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun MODULE_LICENSE("GPL");
99*4882a593Smuzhiyun MODULE_AUTHOR("Mauro Carvalho Chehab");
100