]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/media/rc/keymaps/rc-tivo.c
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / drivers / media / rc / keymaps / rc-tivo.c
CommitLineData
d0ff2371
JW
1/* rc-tivo.c - Keytable for TiVo remotes
2 *
3 * Copyright (c) 2011 by Jarod Wilson <jarod@redhat.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#include <media/rc-map.h>
7a707b89 12#include <linux/module.h>
d0ff2371
JW
13
14/*
15 * Initial mapping is for the TiVo remote included in the Nero LiquidTV bundle,
16 * which also ships with a TiVo-branded IR transceiver, supported by the mceusb
17 * driver. Note that the remote uses an NEC-ish protocol, but instead of having
6eae57e9 18 * a command/not_command pair, it has a vendor ID of 0x3085, but some keys, the
d0ff2371
JW
19 * NEC extended checksums do pass, so the table presently has the intended
20 * values and the checksum-passed versions for those keys.
21 */
22static struct rc_map_table tivo[] = {
6eae57e9
SY
23 { 0x3085f009, KEY_MEDIA }, /* TiVo Button */
24 { 0x3085e010, KEY_POWER2 }, /* TV Power */
25 { 0x3085e011, KEY_TV }, /* Live TV/Swap */
26 { 0x3085c034, KEY_VIDEO_NEXT }, /* TV Input */
27 { 0x3085e013, KEY_INFO },
28 { 0x3085a05f, KEY_CYCLEWINDOWS }, /* Window */
d0ff2371 29 { 0x0085305f, KEY_CYCLEWINDOWS },
6eae57e9 30 { 0x3085c036, KEY_EPG }, /* Guide */
d0ff2371 31
6eae57e9
SY
32 { 0x3085e014, KEY_UP },
33 { 0x3085e016, KEY_DOWN },
34 { 0x3085e017, KEY_LEFT },
35 { 0x3085e015, KEY_RIGHT },
d0ff2371 36
6eae57e9
SY
37 { 0x3085e018, KEY_SCROLLDOWN }, /* Red Thumbs Down */
38 { 0x3085e019, KEY_SELECT },
39 { 0x3085e01a, KEY_SCROLLUP }, /* Green Thumbs Up */
d0ff2371 40
6eae57e9
SY
41 { 0x3085e01c, KEY_VOLUMEUP },
42 { 0x3085e01d, KEY_VOLUMEDOWN },
43 { 0x3085e01b, KEY_MUTE },
44 { 0x3085d020, KEY_RECORD },
45 { 0x3085e01e, KEY_CHANNELUP },
46 { 0x3085e01f, KEY_CHANNELDOWN },
d0ff2371
JW
47 { 0x0085301f, KEY_CHANNELDOWN },
48
6eae57e9
SY
49 { 0x3085d021, KEY_PLAY },
50 { 0x3085d023, KEY_PAUSE },
51 { 0x3085d025, KEY_SLOW },
52 { 0x3085d022, KEY_REWIND },
53 { 0x3085d024, KEY_FASTFORWARD },
54 { 0x3085d026, KEY_PREVIOUS },
55 { 0x3085d027, KEY_NEXT }, /* ->| */
d0ff2371 56
6eae57e9
SY
57 { 0x3085b044, KEY_ZOOM }, /* Aspect */
58 { 0x3085b048, KEY_STOP },
59 { 0x3085b04a, KEY_DVD }, /* DVD Menu */
d0ff2371 60
6eae57e9
SY
61 { 0x3085d028, KEY_NUMERIC_1 },
62 { 0x3085d029, KEY_NUMERIC_2 },
63 { 0x3085d02a, KEY_NUMERIC_3 },
64 { 0x3085d02b, KEY_NUMERIC_4 },
65 { 0x3085d02c, KEY_NUMERIC_5 },
66 { 0x3085d02d, KEY_NUMERIC_6 },
67 { 0x3085d02e, KEY_NUMERIC_7 },
68 { 0x3085d02f, KEY_NUMERIC_8 },
d0ff2371 69 { 0x0085302f, KEY_NUMERIC_8 },
6eae57e9
SY
70 { 0x3085c030, KEY_NUMERIC_9 },
71 { 0x3085c031, KEY_NUMERIC_0 },
72 { 0x3085c033, KEY_ENTER },
73 { 0x3085c032, KEY_CLEAR },
d0ff2371
JW
74};
75
76static struct rc_map_list tivo_map = {
77 .map = {
78 .scan = tivo,
79 .size = ARRAY_SIZE(tivo),
80 .rc_type = RC_TYPE_NEC,
81 .name = RC_MAP_TIVO,
82 }
83};
84
85static int __init init_rc_map_tivo(void)
86{
87 return rc_map_register(&tivo_map);
88}
89
90static void __exit exit_rc_map_tivo(void)
91{
92 rc_map_unregister(&tivo_map);
93}
94
95module_init(init_rc_map_tivo)
96module_exit(exit_rc_map_tivo)
97
98MODULE_LICENSE("GPL");
99MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");