aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2006-12-08 12:41:22 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-08 13:43:19 -0500
commit4c2ae844b5ef85fd4b571c9c91ac48afa6ef2dfc (patch)
tree814a010b2a4f23de93600b2783a8286201e1d1fb
parentaa8de2f038baec993f07ef66fb3e94481d1ec22b (diff)
[PATCH] Generic HID layer - pb_fnmode
pb_fnmode parameter has to be passed to usbhid, both for compatibility reasons and also because it logically belongs there. Also removes empty hid-input.c file in drivers/usb/input. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/hid/hid-input.c12
-rw-r--r--drivers/usb/input/hid-core.c8
-rw-r--r--drivers/usb/input/hid-input.c30
-rw-r--r--include/linux/hid.h1
4 files changed, 12 insertions, 39 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index e542ef971c46..14cdf09316ce 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -128,12 +128,6 @@ static struct hidinput_key_translation powerbook_iso_keyboard[] = {
128 { } 128 { }
129}; 129};
130 130
131
132static int usbhid_pb_fnmode = 1;
133module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
134MODULE_PARM_DESC(pb_fnmode,
135 "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");
136
137static struct hidinput_key_translation *find_translation(struct hidinput_key_translation *table, u16 from) 131static struct hidinput_key_translation *find_translation(struct hidinput_key_translation *table, u16 from)
138{ 132{
139 struct hidinput_key_translation *trans; 133 struct hidinput_key_translation *trans;
@@ -160,7 +154,7 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
160 return 1; 154 return 1;
161 } 155 }
162 156
163 if (usbhid_pb_fnmode) { 157 if (hid->pb_fnmode) {
164 int do_translate; 158 int do_translate;
165 159
166 trans = find_translation(powerbook_fn_keys, usage->code); 160 trans = find_translation(powerbook_fn_keys, usage->code);
@@ -169,8 +163,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
169 do_translate = 1; 163 do_translate = 1;
170 else if (trans->flags & POWERBOOK_FLAG_FKEY) 164 else if (trans->flags & POWERBOOK_FLAG_FKEY)
171 do_translate = 165 do_translate =
172 (usbhid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || 166 (hid->pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
173 (usbhid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); 167 (hid->pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
174 else 168 else
175 do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); 169 do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);
176 170
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index a20ff61624b1..89fa6885709b 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -56,6 +56,11 @@ static unsigned int hid_mousepoll_interval;
56module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); 56module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
57MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); 57MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
58 58
59static int usbhid_pb_fnmode = 1;
60module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
61MODULE_PARM_DESC(pb_fnmode,
62 "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");
63
59/* 64/*
60 * Input submission and I/O error handler. 65 * Input submission and I/O error handler.
61 */ 66 */
@@ -1232,6 +1237,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1232 hid->hiddev_hid_event = hiddev_hid_event; 1237 hid->hiddev_hid_event = hiddev_hid_event;
1233 hid->hiddev_report_event = hiddev_report_event; 1238 hid->hiddev_report_event = hiddev_report_event;
1234#endif 1239#endif
1240#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
1241 hid->pb_fnmode = usbhid_pb_fnmode;
1242#endif
1235 1243
1236 return hid; 1244 return hid;
1237 1245
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
deleted file mode 100644
index 8756eb3263de..000000000000
--- a/drivers/usb/input/hid-input.c
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * $Id: hid-input.c,v 1.2 2002/04/23 00:59:25 rdamazio Exp $
3 *
4 * Copyright (c) 2000-2001 Vojtech Pavlik
5 *
6 * USB HID to Linux Input mapping
7 *
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 * Should you need to contact me, the author, you can do so either by
26 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
27 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
28 */
29
30
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 342b4e639acb..770120add15a 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -438,6 +438,7 @@ struct hid_device { /* device report descriptor */
438 struct hid_usage *, __s32); 438 struct hid_usage *, __s32);
439 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 439 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
440#ifdef CONFIG_USB_HIDINPUT_POWERBOOK 440#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
441 unsigned int pb_fnmode;
441 unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; 442 unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
442 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; 443 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
443#endif 444#endif