1688c73c6SMauro Carvalho Chehab // SPDX-License-Identifier: GPL-2.0+
2688c73c6SMauro Carvalho Chehab // kworld-plus-tv-analog.h - Keytable for kworld_plus_tv_analog 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 /* Kworld Plus TV Analog Lite PCI IR
1232590819SMauro Carvalho Chehab Mauro Carvalho Chehab <mchehab@kernel.org>
1332cf86f6SMauro Carvalho Chehab */
1432cf86f6SMauro Carvalho Chehab
152f4f58d6SMauro Carvalho Chehab static struct rc_map_table kworld_plus_tv_analog[] = {
1656c0893cSJarod Wilson { 0x0c, KEY_MEDIA }, /* Kworld key */
1732cf86f6SMauro Carvalho Chehab { 0x16, KEY_CLOSECD }, /* -> ) */
1832cf86f6SMauro Carvalho Chehab { 0x1d, KEY_POWER2 },
1932cf86f6SMauro Carvalho Chehab
20*1910ea42SBastien Nocera { 0x00, KEY_NUMERIC_1 },
21*1910ea42SBastien Nocera { 0x01, KEY_NUMERIC_2 },
22*1910ea42SBastien Nocera
23*1910ea42SBastien Nocera /* Two keys have the same code: 3 and left */
24*1910ea42SBastien Nocera { 0x02, KEY_NUMERIC_3 },
25*1910ea42SBastien Nocera
26*1910ea42SBastien Nocera /* Two keys have the same code: 4 and right */
27*1910ea42SBastien Nocera { 0x03, KEY_NUMERIC_4 },
28*1910ea42SBastien Nocera { 0x04, KEY_NUMERIC_5 },
29*1910ea42SBastien Nocera { 0x05, KEY_NUMERIC_6 },
30*1910ea42SBastien Nocera { 0x06, KEY_NUMERIC_7 },
31*1910ea42SBastien Nocera { 0x07, KEY_NUMERIC_8 },
32*1910ea42SBastien Nocera { 0x08, KEY_NUMERIC_9 },
33*1910ea42SBastien Nocera { 0x0a, KEY_NUMERIC_0 },
3432cf86f6SMauro Carvalho Chehab
3532cf86f6SMauro Carvalho Chehab { 0x09, KEY_AGAIN },
3632cf86f6SMauro Carvalho Chehab { 0x14, KEY_MUTE },
3732cf86f6SMauro Carvalho Chehab
3832cf86f6SMauro Carvalho Chehab { 0x20, KEY_UP },
3932cf86f6SMauro Carvalho Chehab { 0x21, KEY_DOWN },
4032cf86f6SMauro Carvalho Chehab { 0x0b, KEY_ENTER },
4132cf86f6SMauro Carvalho Chehab
4232cf86f6SMauro Carvalho Chehab { 0x10, KEY_CHANNELUP },
4332cf86f6SMauro Carvalho Chehab { 0x11, KEY_CHANNELDOWN },
4432cf86f6SMauro Carvalho Chehab
4532cf86f6SMauro Carvalho Chehab /* Couldn't map key left/key right since those
4632cf86f6SMauro Carvalho Chehab conflict with '3' and '4' scancodes
4732cf86f6SMauro Carvalho Chehab I dunno what the original driver does
4832cf86f6SMauro Carvalho Chehab */
4932cf86f6SMauro Carvalho Chehab
5032cf86f6SMauro Carvalho Chehab { 0x13, KEY_VOLUMEUP },
5132cf86f6SMauro Carvalho Chehab { 0x12, KEY_VOLUMEDOWN },
5232cf86f6SMauro Carvalho Chehab
5332cf86f6SMauro Carvalho Chehab /* The lower part of the IR
5432cf86f6SMauro Carvalho Chehab There are several duplicated keycodes there.
5532cf86f6SMauro Carvalho Chehab Most of them conflict with digits.
5632cf86f6SMauro Carvalho Chehab Add mappings just to the unused scancodes.
5732cf86f6SMauro Carvalho Chehab Somehow, the original driver has a way to know,
5832cf86f6SMauro Carvalho Chehab but this doesn't seem to be on some GPIO.
5932cf86f6SMauro Carvalho Chehab Also, it is not related to the time between keyup
6032cf86f6SMauro Carvalho Chehab and keydown.
6132cf86f6SMauro Carvalho Chehab */
6232cf86f6SMauro Carvalho Chehab { 0x19, KEY_TIME}, /* Timeshift */
6332cf86f6SMauro Carvalho Chehab { 0x1a, KEY_STOP},
6432cf86f6SMauro Carvalho Chehab { 0x1b, KEY_RECORD},
6532cf86f6SMauro Carvalho Chehab
6632cf86f6SMauro Carvalho Chehab { 0x22, KEY_TEXT},
6732cf86f6SMauro Carvalho Chehab
6832cf86f6SMauro Carvalho Chehab { 0x15, KEY_AUDIO}, /* ((*)) */
6932cf86f6SMauro Carvalho Chehab { 0x0f, KEY_ZOOM},
7032cf86f6SMauro Carvalho Chehab { 0x1c, KEY_CAMERA}, /* snapshot */
7132cf86f6SMauro Carvalho Chehab
7232cf86f6SMauro Carvalho Chehab { 0x18, KEY_RED}, /* B */
7332cf86f6SMauro Carvalho Chehab { 0x23, KEY_GREEN}, /* C */
7432cf86f6SMauro Carvalho Chehab };
7532cf86f6SMauro Carvalho Chehab
76d100e659SMauro Carvalho Chehab static struct rc_map_list kworld_plus_tv_analog_map = {
7732cf86f6SMauro Carvalho Chehab .map = {
7832cf86f6SMauro Carvalho Chehab .scan = kworld_plus_tv_analog,
7932cf86f6SMauro Carvalho Chehab .size = ARRAY_SIZE(kworld_plus_tv_analog),
806d741bfeSSean Young .rc_proto = RC_PROTO_UNKNOWN, /* Legacy IR type */
8132cf86f6SMauro Carvalho Chehab .name = RC_MAP_KWORLD_PLUS_TV_ANALOG,
8232cf86f6SMauro Carvalho Chehab }
8332cf86f6SMauro Carvalho Chehab };
8432cf86f6SMauro Carvalho Chehab
init_rc_map_kworld_plus_tv_analog(void)8532cf86f6SMauro Carvalho Chehab static int __init init_rc_map_kworld_plus_tv_analog(void)
8632cf86f6SMauro Carvalho Chehab {
87d100e659SMauro Carvalho Chehab return rc_map_register(&kworld_plus_tv_analog_map);
8832cf86f6SMauro Carvalho Chehab }
8932cf86f6SMauro Carvalho Chehab
exit_rc_map_kworld_plus_tv_analog(void)9032cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_kworld_plus_tv_analog(void)
9132cf86f6SMauro Carvalho Chehab {
92d100e659SMauro Carvalho Chehab rc_map_unregister(&kworld_plus_tv_analog_map);
9332cf86f6SMauro Carvalho Chehab }
9432cf86f6SMauro Carvalho Chehab
9532cf86f6SMauro Carvalho Chehab module_init(init_rc_map_kworld_plus_tv_analog)
9632cf86f6SMauro Carvalho Chehab module_exit(exit_rc_map_kworld_plus_tv_analog)
9732cf86f6SMauro Carvalho Chehab
9832cf86f6SMauro Carvalho Chehab MODULE_LICENSE("GPL");
9937e59f87SMauro Carvalho Chehab MODULE_AUTHOR("Mauro Carvalho Chehab");
100