xref: /openbmc/linux/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c (revision 7a707b89202f905bd9f9fbde326933c59a81214c)
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>
14*7a707b89SPaul Gortmaker #include <linux/module.h>
1532cf86f6SMauro Carvalho Chehab 
1632cf86f6SMauro Carvalho Chehab /* Kworld Plus TV Analog Lite PCI IR
1732cf86f6SMauro Carvalho Chehab    Mauro Carvalho Chehab <mchehab@infradead.org>
1832cf86f6SMauro Carvalho Chehab  */
1932cf86f6SMauro Carvalho Chehab 
202f4f58d6SMauro Carvalho Chehab static struct rc_map_table kworld_plus_tv_analog[] = {
2156c0893cSJarod Wilson 	{ 0x0c, KEY_MEDIA },		/* Kworld key */
2232cf86f6SMauro Carvalho Chehab 	{ 0x16, KEY_CLOSECD },		/* -> ) */
2332cf86f6SMauro Carvalho Chehab 	{ 0x1d, KEY_POWER2 },
2432cf86f6SMauro Carvalho Chehab 
2532cf86f6SMauro Carvalho Chehab 	{ 0x00, KEY_1 },
2632cf86f6SMauro Carvalho Chehab 	{ 0x01, KEY_2 },
2732cf86f6SMauro Carvalho Chehab 	{ 0x02, KEY_3 },		/* Two keys have the same code: 3 and left */
2832cf86f6SMauro Carvalho Chehab 	{ 0x03, KEY_4 },		/* Two keys have the same code: 3 and right */
2932cf86f6SMauro Carvalho Chehab 	{ 0x04, KEY_5 },
3032cf86f6SMauro Carvalho Chehab 	{ 0x05, KEY_6 },
3132cf86f6SMauro Carvalho Chehab 	{ 0x06, KEY_7 },
3232cf86f6SMauro Carvalho Chehab 	{ 0x07, KEY_8 },
3332cf86f6SMauro Carvalho Chehab 	{ 0x08, KEY_9 },
3432cf86f6SMauro Carvalho Chehab 	{ 0x0a, KEY_0 },
3532cf86f6SMauro Carvalho Chehab 
3632cf86f6SMauro Carvalho Chehab 	{ 0x09, KEY_AGAIN },
3732cf86f6SMauro Carvalho Chehab 	{ 0x14, KEY_MUTE },
3832cf86f6SMauro Carvalho Chehab 
3932cf86f6SMauro Carvalho Chehab 	{ 0x20, KEY_UP },
4032cf86f6SMauro Carvalho Chehab 	{ 0x21, KEY_DOWN },
4132cf86f6SMauro Carvalho Chehab 	{ 0x0b, KEY_ENTER },
4232cf86f6SMauro Carvalho Chehab 
4332cf86f6SMauro Carvalho Chehab 	{ 0x10, KEY_CHANNELUP },
4432cf86f6SMauro Carvalho Chehab 	{ 0x11, KEY_CHANNELDOWN },
4532cf86f6SMauro Carvalho Chehab 
4632cf86f6SMauro Carvalho Chehab 	/* Couldn't map key left/key right since those
4732cf86f6SMauro Carvalho Chehab 	   conflict with '3' and '4' scancodes
4832cf86f6SMauro Carvalho Chehab 	   I dunno what the original driver does
4932cf86f6SMauro Carvalho Chehab 	 */
5032cf86f6SMauro Carvalho Chehab 
5132cf86f6SMauro Carvalho Chehab 	{ 0x13, KEY_VOLUMEUP },
5232cf86f6SMauro Carvalho Chehab 	{ 0x12, KEY_VOLUMEDOWN },
5332cf86f6SMauro Carvalho Chehab 
5432cf86f6SMauro Carvalho Chehab 	/* The lower part of the IR
5532cf86f6SMauro Carvalho Chehab 	   There are several duplicated keycodes there.
5632cf86f6SMauro Carvalho Chehab 	   Most of them conflict with digits.
5732cf86f6SMauro Carvalho Chehab 	   Add mappings just to the unused scancodes.
5832cf86f6SMauro Carvalho Chehab 	   Somehow, the original driver has a way to know,
5932cf86f6SMauro Carvalho Chehab 	   but this doesn't seem to be on some GPIO.
6032cf86f6SMauro Carvalho Chehab 	   Also, it is not related to the time between keyup
6132cf86f6SMauro Carvalho Chehab 	   and keydown.
6232cf86f6SMauro Carvalho Chehab 	 */
6332cf86f6SMauro Carvalho Chehab 	{ 0x19, KEY_TIME},		/* Timeshift */
6432cf86f6SMauro Carvalho Chehab 	{ 0x1a, KEY_STOP},
6532cf86f6SMauro Carvalho Chehab 	{ 0x1b, KEY_RECORD},
6632cf86f6SMauro Carvalho Chehab 
6732cf86f6SMauro Carvalho Chehab 	{ 0x22, KEY_TEXT},
6832cf86f6SMauro Carvalho Chehab 
6932cf86f6SMauro Carvalho Chehab 	{ 0x15, KEY_AUDIO},		/* ((*)) */
7032cf86f6SMauro Carvalho Chehab 	{ 0x0f, KEY_ZOOM},
7132cf86f6SMauro Carvalho Chehab 	{ 0x1c, KEY_CAMERA},		/* snapshot */
7232cf86f6SMauro Carvalho Chehab 
7332cf86f6SMauro Carvalho Chehab 	{ 0x18, KEY_RED},		/* B */
7432cf86f6SMauro Carvalho Chehab 	{ 0x23, KEY_GREEN},		/* C */
7532cf86f6SMauro Carvalho Chehab };
7632cf86f6SMauro Carvalho Chehab 
77d100e659SMauro Carvalho Chehab static struct rc_map_list kworld_plus_tv_analog_map = {
7832cf86f6SMauro Carvalho Chehab 	.map = {
7932cf86f6SMauro Carvalho Chehab 		.scan    = kworld_plus_tv_analog,
8032cf86f6SMauro Carvalho Chehab 		.size    = ARRAY_SIZE(kworld_plus_tv_analog),
8152b66144SMauro Carvalho Chehab 		.rc_type = RC_TYPE_UNKNOWN,	/* Legacy IR type */
8232cf86f6SMauro Carvalho Chehab 		.name    = RC_MAP_KWORLD_PLUS_TV_ANALOG,
8332cf86f6SMauro Carvalho Chehab 	}
8432cf86f6SMauro Carvalho Chehab };
8532cf86f6SMauro Carvalho Chehab 
8632cf86f6SMauro Carvalho Chehab static int __init init_rc_map_kworld_plus_tv_analog(void)
8732cf86f6SMauro Carvalho Chehab {
88d100e659SMauro Carvalho Chehab 	return rc_map_register(&kworld_plus_tv_analog_map);
8932cf86f6SMauro Carvalho Chehab }
9032cf86f6SMauro Carvalho Chehab 
9132cf86f6SMauro Carvalho Chehab static void __exit exit_rc_map_kworld_plus_tv_analog(void)
9232cf86f6SMauro Carvalho Chehab {
93d100e659SMauro Carvalho Chehab 	rc_map_unregister(&kworld_plus_tv_analog_map);
9432cf86f6SMauro Carvalho Chehab }
9532cf86f6SMauro Carvalho Chehab 
9632cf86f6SMauro Carvalho Chehab module_init(init_rc_map_kworld_plus_tv_analog)
9732cf86f6SMauro Carvalho Chehab module_exit(exit_rc_map_kworld_plus_tv_analog)
9832cf86f6SMauro Carvalho Chehab 
9932cf86f6SMauro Carvalho Chehab MODULE_LICENSE("GPL");
10032cf86f6SMauro Carvalho Chehab MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
101