Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43858
b: refs/heads/master
c: 4c2ae84
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Kosina authored and Greg Kroah-Hartman committed Dec 8, 2006
1 parent 54eeebb commit 8f7d367
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa8de2f038baec993f07ef66fb3e94481d1ec22b
refs/heads/master: 4c2ae844b5ef85fd4b571c9c91ac48afa6ef2dfc
12 changes: 3 additions & 9 deletions trunk/drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ static struct hidinput_key_translation powerbook_iso_keyboard[] = {
{ }
};


static int usbhid_pb_fnmode = 1;
module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
MODULE_PARM_DESC(pb_fnmode,
"Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");

static struct hidinput_key_translation *find_translation(struct hidinput_key_translation *table, u16 from)
{
struct hidinput_key_translation *trans;
Expand All @@ -160,7 +154,7 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
return 1;
}

if (usbhid_pb_fnmode) {
if (hid->pb_fnmode) {
int do_translate;

trans = find_translation(powerbook_fn_keys, usage->code);
Expand All @@ -169,8 +163,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
do_translate = 1;
else if (trans->flags & POWERBOOK_FLAG_FKEY)
do_translate =
(usbhid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
(usbhid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
(hid->pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
(hid->pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
else
do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);

Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/usb/input/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ static unsigned int hid_mousepoll_interval;
module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
MODULE_PARM_DESC(mousepoll, "Polling interval of mice");

static int usbhid_pb_fnmode = 1;
module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
MODULE_PARM_DESC(pb_fnmode,
"Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");

/*
* Input submission and I/O error handler.
*/
Expand Down Expand Up @@ -1232,6 +1237,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
hid->hiddev_hid_event = hiddev_hid_event;
hid->hiddev_report_event = hiddev_report_event;
#endif
#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
hid->pb_fnmode = usbhid_pb_fnmode;
#endif

return hid;

Expand Down
30 changes: 0 additions & 30 deletions trunk/drivers/usb/input/hid-input.c

This file was deleted.

1 change: 1 addition & 0 deletions trunk/include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ struct hid_device { /* device report descriptor */
struct hid_usage *, __s32);
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
unsigned int pb_fnmode;
unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
#endif
Expand Down

0 comments on commit 8f7d367

Please sign in to comment.