diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2011-08-06 17:18:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-22 09:53:18 -0400 |
commit | 175fcecf79b4698c7beea5810326dba66a56ea39 (patch) | |
tree | c58058cd95a0f783340505262c3fce94a5984ec1 /drivers/media | |
parent | 0224e0401f0b18e1f5fce010558b12fc24257e37 (diff) |
[media] ati_remote: add keymap for Medion X10 RF remote
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/rc/ati_remote.c | 17 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/Makefile | 1 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-medion-x10.c | 116 |
3 files changed, 127 insertions, 7 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 92f2b1bcef4a..94d241d37619 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c | |||
@@ -151,11 +151,11 @@ MODULE_PARM_DESC(mouse, "Enable mouse device, default = yes"); | |||
151 | #define err(format, arg...) printk(KERN_ERR format , ## arg) | 151 | #define err(format, arg...) printk(KERN_ERR format , ## arg) |
152 | 152 | ||
153 | static struct usb_device_id ati_remote_table[] = { | 153 | static struct usb_device_id ati_remote_table[] = { |
154 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID) }, | 154 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, |
155 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID) }, | 155 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, |
156 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID) }, | 156 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, |
157 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID) }, | 157 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, |
158 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID) }, | 158 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_MEDION_X10 }, |
159 | {} /* Terminating entry */ | 159 | {} /* Terminating entry */ |
160 | }; | 160 | }; |
161 | 161 | ||
@@ -714,8 +714,6 @@ static void ati_remote_rc_init(struct ati_remote *ati_remote) | |||
714 | 714 | ||
715 | usb_to_input_id(ati_remote->udev, &rdev->input_id); | 715 | usb_to_input_id(ati_remote->udev, &rdev->input_id); |
716 | rdev->dev.parent = &ati_remote->interface->dev; | 716 | rdev->dev.parent = &ati_remote->interface->dev; |
717 | |||
718 | rdev->map_name = RC_MAP_ATI_X10; | ||
719 | } | 717 | } |
720 | 718 | ||
721 | static int ati_remote_initialize(struct ati_remote *ati_remote) | 719 | static int ati_remote_initialize(struct ati_remote *ati_remote) |
@@ -827,6 +825,11 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de | |||
827 | snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name), | 825 | snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name), |
828 | "%s mouse", ati_remote->rc_name); | 826 | "%s mouse", ati_remote->rc_name); |
829 | 827 | ||
828 | if (id->driver_info) | ||
829 | rc_dev->map_name = (const char *)id->driver_info; | ||
830 | else | ||
831 | rc_dev->map_name = RC_MAP_ATI_X10; | ||
832 | |||
830 | ati_remote_rc_init(ati_remote); | 833 | ati_remote_rc_init(ati_remote); |
831 | mutex_init(&ati_remote->open_mutex); | 834 | mutex_init(&ati_remote->open_mutex); |
832 | 835 | ||
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 8dd9fdf45c29..2b97b4327ab2 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile | |||
@@ -48,6 +48,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ | |||
48 | rc-lirc.o \ | 48 | rc-lirc.o \ |
49 | rc-lme2510.o \ | 49 | rc-lme2510.o \ |
50 | rc-manli.o \ | 50 | rc-manli.o \ |
51 | rc-medion-x10.o \ | ||
51 | rc-msi-digivox-ii.o \ | 52 | rc-msi-digivox-ii.o \ |
52 | rc-msi-digivox-iii.o \ | 53 | rc-msi-digivox-iii.o \ |
53 | rc-msi-tvanywhere.o \ | 54 | rc-msi-tvanywhere.o \ |
diff --git a/drivers/media/rc/keymaps/rc-medion-x10.c b/drivers/media/rc/keymaps/rc-medion-x10.c new file mode 100644 index 000000000000..5fc57468daf4 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-medion-x10.c | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * Medion X10 RF remote keytable | ||
3 | * | ||
4 | * Copyright (C) 2011 Anssi Hannula <anssi.hannula@?ki.fi> | ||
5 | * | ||
6 | * This file is based on a keytable provided by | ||
7 | * Jan Losinski <losinski@wh2.tu-dresden.de> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
22 | */ | ||
23 | |||
24 | #include <media/rc-map.h> | ||
25 | |||
26 | static struct rc_map_table medion_x10[] = { | ||
27 | { 0xf12c, KEY_TV }, /* TV */ | ||
28 | { 0xf22d, KEY_VCR }, /* VCR */ | ||
29 | { 0xc904, KEY_DVD }, /* DVD */ | ||
30 | { 0xcb06, KEY_AUDIO }, /* MUSIC */ | ||
31 | |||
32 | { 0xf32e, KEY_RADIO }, /* RADIO */ | ||
33 | { 0xca05, KEY_DIRECTORY }, /* PHOTO */ | ||
34 | { 0xf42f, KEY_INFO }, /* TV-PREVIEW */ | ||
35 | { 0xf530, KEY_LIST }, /* CHANNEL-LST */ | ||
36 | |||
37 | { 0xe01b, KEY_SETUP }, /* SETUP */ | ||
38 | { 0xf631, KEY_VIDEO }, /* VIDEO DESKTOP */ | ||
39 | |||
40 | { 0xcd08, KEY_VOLUMEDOWN }, /* VOL - */ | ||
41 | { 0xce09, KEY_VOLUMEUP }, /* VOL + */ | ||
42 | { 0xd00b, KEY_CHANNELUP }, /* CHAN + */ | ||
43 | { 0xd10c, KEY_CHANNELDOWN }, /* CHAN - */ | ||
44 | { 0xc500, KEY_MUTE }, /* MUTE */ | ||
45 | |||
46 | { 0xf732, KEY_RED }, /* red */ | ||
47 | { 0xf833, KEY_GREEN }, /* green */ | ||
48 | { 0xf934, KEY_YELLOW }, /* yellow */ | ||
49 | { 0xfa35, KEY_BLUE }, /* blue */ | ||
50 | { 0xdb16, KEY_TEXT }, /* TXT */ | ||
51 | |||
52 | { 0xd20d, KEY_1 }, | ||
53 | { 0xd30e, KEY_2 }, | ||
54 | { 0xd40f, KEY_3 }, | ||
55 | { 0xd510, KEY_4 }, | ||
56 | { 0xd611, KEY_5 }, | ||
57 | { 0xd712, KEY_6 }, | ||
58 | { 0xd813, KEY_7 }, | ||
59 | { 0xd914, KEY_8 }, | ||
60 | { 0xda15, KEY_9 }, | ||
61 | { 0xdc17, KEY_0 }, | ||
62 | { 0xe11c, KEY_SEARCH }, /* TV/RAD, CH SRC */ | ||
63 | { 0xe520, KEY_DELETE }, /* DELETE */ | ||
64 | |||
65 | { 0xfb36, KEY_KEYBOARD }, /* RENAME */ | ||
66 | { 0xdd18, KEY_SCREEN }, /* SNAPSHOT */ | ||
67 | |||
68 | { 0xdf1a, KEY_UP }, /* up */ | ||
69 | { 0xe722, KEY_DOWN }, /* down */ | ||
70 | { 0xe21d, KEY_LEFT }, /* left */ | ||
71 | { 0xe41f, KEY_RIGHT }, /* right */ | ||
72 | { 0xe31e, KEY_OK }, /* OK */ | ||
73 | |||
74 | { 0xfc37, KEY_SELECT }, /* ACQUIRE IMAGE */ | ||
75 | { 0xfd38, KEY_EDIT }, /* EDIT IMAGE */ | ||
76 | |||
77 | { 0xe924, KEY_REWIND }, /* rewind (<<) */ | ||
78 | { 0xea25, KEY_PLAY }, /* play ( >) */ | ||
79 | { 0xeb26, KEY_FORWARD }, /* forward (>>) */ | ||
80 | { 0xec27, KEY_RECORD }, /* record ( o) */ | ||
81 | { 0xed28, KEY_STOP }, /* stop ([]) */ | ||
82 | { 0xee29, KEY_PAUSE }, /* pause ('') */ | ||
83 | |||
84 | { 0xe621, KEY_PREVIOUS }, /* prev */ | ||
85 | { 0xfe39, KEY_SWITCHVIDEOMODE }, /* F SCR */ | ||
86 | { 0xe823, KEY_NEXT }, /* next */ | ||
87 | { 0xde19, KEY_MENU }, /* MENU */ | ||
88 | { 0xff3a, KEY_LANGUAGE }, /* AUDIO */ | ||
89 | |||
90 | { 0xc702, KEY_POWER }, /* POWER */ | ||
91 | }; | ||
92 | |||
93 | static struct rc_map_list medion_x10_map = { | ||
94 | .map = { | ||
95 | .scan = medion_x10, | ||
96 | .size = ARRAY_SIZE(medion_x10), | ||
97 | .rc_type = RC_TYPE_OTHER, | ||
98 | .name = RC_MAP_MEDION_X10, | ||
99 | } | ||
100 | }; | ||
101 | |||
102 | static int __init init_rc_map_medion_x10(void) | ||
103 | { | ||
104 | return rc_map_register(&medion_x10_map); | ||
105 | } | ||
106 | |||
107 | static void __exit exit_rc_map_medion_x10(void) | ||
108 | { | ||
109 | rc_map_unregister(&medion_x10_map); | ||
110 | } | ||
111 | |||
112 | module_init(init_rc_map_medion_x10) | ||
113 | module_exit(exit_rc_map_medion_x10) | ||
114 | |||
115 | MODULE_LICENSE("GPL"); | ||
116 | MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>"); | ||