xref: /openbmc/linux/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c (revision 2f4f58d689dd71dea67407b74405a3c43e797cb1)
132cf86f6SMauro Carvalho Chehab /* kworld-plus-tv-analog.h - Keytable for kworld_plus_tv_analog Remote Controller
232cf86f6SMauro Carvalho Chehab  *
332cf86f6SMauro Carvalho Chehab  * keymap imported from ir-keymaps.c
432cf86f6SMauro Carvalho Chehab  *
532cf86f6SMauro Carvalho Chehab  * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
632cf86f6SMauro Carvalho Chehab  *
732cf86f6SMauro Carvalho Chehab  * This program is free software; you can redistribute it and/or modify
832cf86f6SMauro Carvalho Chehab  * it under the terms of the GNU General Public License as published by
932cf86f6SMauro Carvalho Chehab  * the Free Software Foundation; either version 2 of the License, or
1032cf86f6SMauro Carvalho Chehab  * (at your option) any later version.
1132cf86f6SMauro Carvalho Chehab  */
1232cf86f6SMauro Carvalho Chehab 
1332cf86f6SMauro Carvalho Chehab #include <media/rc-map.h>
1432cf86f6SMauro Carvalho Chehab 
1532cf86f6SMauro Carvalho Chehab /* Kworld Plus TV Analog Lite PCI IR
1632cf86f6SMauro Carvalho Chehab    Mauro Carvalho Chehab <mchehab@infradead.org>
1732cf86f6SMauro Carvalho Chehab  */
1832cf86f6SMauro Carvalho Chehab 
19*2f4f58d6SMauro Carvalho Chehab static struct rc_map_table kworld_plus_tv_analog[] = {
2032cf86f6SMauro Carvalho Chehab 	{ 0x0c, KEY_PROG1 },		/* Kworld key */
2132cf86f6SMauro Carvalho Chehab 	{ 0x16, KEY_CLOSECD },		/* -> ) */
2232cf86f6SMauro Carvalho Chehab 	{ 0x1d, KEY_POWER2 },
2332cf86f6SMauro Carvalho Chehab 
2432cf86f6SMauro Carvalho Chehab 	{ 0x00, KEY_1 },
2532cf86f6SMauro Carvalho Chehab 	{ 0x01, KEY_2 },
2632cf86f6SMauro Carvalho Chehab 	{ 0x02, KEY_3 },		/* Two keys have the same code: 3 and left */
2732cf86f6SMauro Carvalho Chehab 	{ 0x03, KEY_4 },		/* Two keys have the same code: 3 and right */
2832cf86f6SMauro Carvalho Chehab 	{ 0x04, KEY_5 },
2932cf86f6SMauro Carvalho Chehab 	{ 0x05, KEY_6 },
3032cf86f6SMauro Carvalho Chehab 	{ 0x06, KEY_7 },
3132cf86f6SMauro Carvalho Chehab 	{ 0x07, KEY_8 },
3232cf86f6SMauro Carvalho Chehab 	{ 0x08, KEY_9 },
3332cf86f6SMauro Carvalho Chehab 	{ 0x0a, KEY_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 
7632cf86f6SMauro Carvalho Chehab static struct rc_keymap 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),
8052b66144SMauro Carvalho Chehab 		.rc_type = RC_TYPE_UNKNOWN,	/* Legacy IR type */
8132cf86f6SMauro Carvalho Chehab 		.name    = RC_MAP_KWORLD_PLUS_TV_ANALOG,
8232cf86f6SMauro Carvalho Chehab 	}
8332cf86f6SMauro Carvalho Chehab };
8432cf86f6SMauro Carvalho Chehab 
8532cf86f6SMauro Carvalho Chehab static int __init init_rc_map_kworld_plus_tv_analog(void)
8632cf86f6SMauro Carvalho Chehab {
8732cf86f6SMauro Carvalho Chehab 	return ir_register_map(&kworld_plus_tv_analog_map);
8832cf86f6SMauro Carvalho Chehab }
8932cf86f6SMauro Carvalho Chehab 
9032cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_kworld_plus_tv_analog(void)
9132cf86f6SMauro Carvalho Chehab {
9232cf86f6SMauro Carvalho Chehab 	ir_unregister_map(&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");
9932cf86f6SMauro Carvalho Chehab MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
100