xref: /openbmc/linux/drivers/media/rc/keymaps/rc-tivo.c (revision c5f14af0)
1d0ff2371SJarod Wilson /* rc-tivo.c - Keytable for TiVo remotes
2d0ff2371SJarod Wilson  *
3d0ff2371SJarod Wilson  * Copyright (c) 2011 by Jarod Wilson <jarod@redhat.com>
4d0ff2371SJarod Wilson  *
5d0ff2371SJarod Wilson  * This program is free software; you can redistribute it and/or modify
6d0ff2371SJarod Wilson  * it under the terms of the GNU General Public License as published by
7d0ff2371SJarod Wilson  * the Free Software Foundation; either version 2 of the License, or
8d0ff2371SJarod Wilson  * (at your option) any later version.
9d0ff2371SJarod Wilson  */
10d0ff2371SJarod Wilson 
11d0ff2371SJarod Wilson #include <media/rc-map.h>
127a707b89SPaul Gortmaker #include <linux/module.h>
13d0ff2371SJarod Wilson 
14d0ff2371SJarod Wilson /*
15d0ff2371SJarod Wilson  * Initial mapping is for the TiVo remote included in the Nero LiquidTV bundle,
16d0ff2371SJarod Wilson  * which also ships with a TiVo-branded IR transceiver, supported by the mceusb
17d0ff2371SJarod Wilson  * driver. Note that the remote uses an NEC-ish protocol, but instead of having
186eae57e9SSean Young  * a command/not_command pair, it has a vendor ID of 0x3085, but some keys, the
19d0ff2371SJarod Wilson  * NEC extended checksums do pass, so the table presently has the intended
20d0ff2371SJarod Wilson  * values and the checksum-passed versions for those keys.
21d0ff2371SJarod Wilson  */
22d0ff2371SJarod Wilson static struct rc_map_table tivo[] = {
236eae57e9SSean Young 	{ 0x3085f009, KEY_MEDIA },	/* TiVo Button */
246eae57e9SSean Young 	{ 0x3085e010, KEY_POWER2 },	/* TV Power */
256eae57e9SSean Young 	{ 0x3085e011, KEY_TV },		/* Live TV/Swap */
266eae57e9SSean Young 	{ 0x3085c034, KEY_VIDEO_NEXT },	/* TV Input */
276eae57e9SSean Young 	{ 0x3085e013, KEY_INFO },
286eae57e9SSean Young 	{ 0x3085a05f, KEY_CYCLEWINDOWS }, /* Window */
29d0ff2371SJarod Wilson 	{ 0x0085305f, KEY_CYCLEWINDOWS },
306eae57e9SSean Young 	{ 0x3085c036, KEY_EPG },	/* Guide */
31d0ff2371SJarod Wilson 
326eae57e9SSean Young 	{ 0x3085e014, KEY_UP },
336eae57e9SSean Young 	{ 0x3085e016, KEY_DOWN },
346eae57e9SSean Young 	{ 0x3085e017, KEY_LEFT },
356eae57e9SSean Young 	{ 0x3085e015, KEY_RIGHT },
36d0ff2371SJarod Wilson 
376eae57e9SSean Young 	{ 0x3085e018, KEY_SCROLLDOWN },	/* Red Thumbs Down */
386eae57e9SSean Young 	{ 0x3085e019, KEY_SELECT },
396eae57e9SSean Young 	{ 0x3085e01a, KEY_SCROLLUP },	/* Green Thumbs Up */
40d0ff2371SJarod Wilson 
416eae57e9SSean Young 	{ 0x3085e01c, KEY_VOLUMEUP },
426eae57e9SSean Young 	{ 0x3085e01d, KEY_VOLUMEDOWN },
436eae57e9SSean Young 	{ 0x3085e01b, KEY_MUTE },
446eae57e9SSean Young 	{ 0x3085d020, KEY_RECORD },
456eae57e9SSean Young 	{ 0x3085e01e, KEY_CHANNELUP },
466eae57e9SSean Young 	{ 0x3085e01f, KEY_CHANNELDOWN },
47d0ff2371SJarod Wilson 	{ 0x0085301f, KEY_CHANNELDOWN },
48d0ff2371SJarod Wilson 
496eae57e9SSean Young 	{ 0x3085d021, KEY_PLAY },
506eae57e9SSean Young 	{ 0x3085d023, KEY_PAUSE },
516eae57e9SSean Young 	{ 0x3085d025, KEY_SLOW },
526eae57e9SSean Young 	{ 0x3085d022, KEY_REWIND },
536eae57e9SSean Young 	{ 0x3085d024, KEY_FASTFORWARD },
546eae57e9SSean Young 	{ 0x3085d026, KEY_PREVIOUS },
556eae57e9SSean Young 	{ 0x3085d027, KEY_NEXT },	/* ->| */
56d0ff2371SJarod Wilson 
576eae57e9SSean Young 	{ 0x3085b044, KEY_ZOOM },	/* Aspect */
586eae57e9SSean Young 	{ 0x3085b048, KEY_STOP },
596eae57e9SSean Young 	{ 0x3085b04a, KEY_DVD },	/* DVD Menu */
60d0ff2371SJarod Wilson 
616eae57e9SSean Young 	{ 0x3085d028, KEY_NUMERIC_1 },
626eae57e9SSean Young 	{ 0x3085d029, KEY_NUMERIC_2 },
636eae57e9SSean Young 	{ 0x3085d02a, KEY_NUMERIC_3 },
646eae57e9SSean Young 	{ 0x3085d02b, KEY_NUMERIC_4 },
656eae57e9SSean Young 	{ 0x3085d02c, KEY_NUMERIC_5 },
666eae57e9SSean Young 	{ 0x3085d02d, KEY_NUMERIC_6 },
676eae57e9SSean Young 	{ 0x3085d02e, KEY_NUMERIC_7 },
686eae57e9SSean Young 	{ 0x3085d02f, KEY_NUMERIC_8 },
69d0ff2371SJarod Wilson 	{ 0x0085302f, KEY_NUMERIC_8 },
706eae57e9SSean Young 	{ 0x3085c030, KEY_NUMERIC_9 },
716eae57e9SSean Young 	{ 0x3085c031, KEY_NUMERIC_0 },
726eae57e9SSean Young 	{ 0x3085c033, KEY_ENTER },
736eae57e9SSean Young 	{ 0x3085c032, KEY_CLEAR },
74d0ff2371SJarod Wilson };
75d0ff2371SJarod Wilson 
76d0ff2371SJarod Wilson static struct rc_map_list tivo_map = {
77d0ff2371SJarod Wilson 	.map = {
78d0ff2371SJarod Wilson 		.scan     = tivo,
79d0ff2371SJarod Wilson 		.size     = ARRAY_SIZE(tivo),
80c5f14af0SSean Young 		.rc_proto = RC_PROTO_NEC32,
81d0ff2371SJarod Wilson 		.name     = RC_MAP_TIVO,
82d0ff2371SJarod Wilson 	}
83d0ff2371SJarod Wilson };
84d0ff2371SJarod Wilson 
85d0ff2371SJarod Wilson static int __init init_rc_map_tivo(void)
86d0ff2371SJarod Wilson {
87d0ff2371SJarod Wilson 	return rc_map_register(&tivo_map);
88d0ff2371SJarod Wilson }
89d0ff2371SJarod Wilson 
90d0ff2371SJarod Wilson static void __exit exit_rc_map_tivo(void)
91d0ff2371SJarod Wilson {
92d0ff2371SJarod Wilson 	rc_map_unregister(&tivo_map);
93d0ff2371SJarod Wilson }
94d0ff2371SJarod Wilson 
95d0ff2371SJarod Wilson module_init(init_rc_map_tivo)
96d0ff2371SJarod Wilson module_exit(exit_rc_map_tivo)
97d0ff2371SJarod Wilson 
98d0ff2371SJarod Wilson MODULE_LICENSE("GPL");
99d0ff2371SJarod Wilson MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
100