diff for duplicates of <200601132358.33861.dtor_core@ameritech.net> diff --git a/a/1.txt b/N1/1.txt index 17c5fcd..2d2767e 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,32 +1,22 @@ On Friday 13 January 2006 17:02, Michael Hanselmann wrote: -> -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0case 0x003: map_key_clear(KEY_FN);=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0=A0break; +> - case 0x003: map_key_clear(KEY_FN); break; > +#ifdef CONFIG_USB_HIDINPUT_POWERBOOK -> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0/* The fn key on Apple PowerBooks */ -> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0case 0x0003: { -> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0struct hidinput_key_translatio= -n *trans; +> + /* The fn key on Apple PowerBooks */ +> + case 0x0003: { +> + struct hidinput_key_translation *trans; > + -> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0map_key_clear(KEY_FN); -> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0set_bit(KEY_NUMLOCK, input->ke= -ybit); +> + map_key_clear(KEY_FN); +> + set_bit(KEY_NUMLOCK, input->keybit); > + One little thing - I think that we should report FN key even if PowerBook -support is disabled. Can I solicit input on the patch below (I also rearran= -ged -teh code slightly)?=20 +support is disabled. Can I solicit input on the patch below (I also rearranged +teh code slightly)? -=2D-=20 +-- Dmitry -=46rom: Michael Hanselmann <linux-kernel@hansmi.ch> +From: Michael Hanselmann <linux-kernel@hansmi.ch> Input: HID - add support for fn key on Apple PowerBooks @@ -39,26 +29,22 @@ Acked-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru> -=2D-- +--- drivers/usb/input/Kconfig | 10 ++ drivers/usb/input/hid-core.c | 8 ++ - drivers/usb/input/hid-input.c | 166 +++++++++++++++++++++++++++++++++++++= -++++- + drivers/usb/input/hid-input.c | 166 +++++++++++++++++++++++++++++++++++++++++- drivers/usb/input/hid.h | 31 ++++--- 4 files changed, 201 insertions(+), 14 deletions(-) Index: work/drivers/usb/input/hid-core.c -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -=2D-- work.orig/drivers/usb/input/hid-core.c +=================================================================== +--- work.orig/drivers/usb/input/hid-core.c +++ work/drivers/usb/input/hid-core.c @@ -1585,6 +1585,14 @@ static const struct hid_blacklist { -=20 - { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION= - }, -=20 + + { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, + + { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, @@ -69,29 +55,27 @@ Index: work/drivers/usb/input/hid-core.c + { 0, 0 } }; -=20 + Index: work/drivers/usb/input/hid.h -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -=2D-- work.orig/drivers/usb/input/hid.h +=================================================================== +--- work.orig/drivers/usb/input/hid.h +++ work/drivers/usb/input/hid.h @@ -235,18 +235,20 @@ struct hid_item { * HID device quirks. */ -=20 -=2D#define HID_QUIRK_INVERT 0x001 -=2D#define HID_QUIRK_NOTOUCH 0x002 -=2D#define HID_QUIRK_IGNORE 0x004 -=2D#define HID_QUIRK_NOGET 0x008 -=2D#define HID_QUIRK_HIDDEV 0x010 -=2D#define HID_QUIRK_BADPAD 0x020 -=2D#define HID_QUIRK_MULTI_INPUT 0x040 -=2D#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x080 -=2D#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100 -=2D#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200 -=2D#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400 -=2D#define HID_QUIRK_CYMOTION 0x800 + +-#define HID_QUIRK_INVERT 0x001 +-#define HID_QUIRK_NOTOUCH 0x002 +-#define HID_QUIRK_IGNORE 0x004 +-#define HID_QUIRK_NOGET 0x008 +-#define HID_QUIRK_HIDDEV 0x010 +-#define HID_QUIRK_BADPAD 0x020 +-#define HID_QUIRK_MULTI_INPUT 0x040 +-#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x080 +-#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100 +-#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200 +-#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400 +-#define HID_QUIRK_CYMOTION 0x800 +#define HID_QUIRK_INVERT 0x00000001 +#define HID_QUIRK_NOTOUCH 0x00000002 +#define HID_QUIRK_IGNORE 0x00000004 @@ -106,12 +90,11 @@ Index: work/drivers/usb/input/hid.h +#define HID_QUIRK_CYMOTION 0x00000800 +#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 +#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 -=20 + /* * This is the global environment of the parser. This information is @@ -432,6 +434,11 @@ struct hid_device { /* device repo - void (*ff_exit)(struct hid_device*); /* Called= - by hid_exit_ff(hid) */ + void (*ff_exit)(struct hid_device*); /* Called by hid_exit_ff(hid) */ int (*ff_event)(struct hid_device *hid, struct input_dev *input, unsigned int type, unsigned int code, int value); + @@ -120,18 +103,16 @@ Index: work/drivers/usb/input/hid.h + unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; +#endif }; -=20 + #define HID_GLOBAL_STACK_SIZE 4 Index: work/drivers/usb/input/hid-input.c -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -=2D-- work.orig/drivers/usb/input/hid-input.c +=================================================================== +--- work.orig/drivers/usb/input/hid-input.c +++ work/drivers/usb/input/hid-input.c @@ -73,6 +73,160 @@ static const struct { #define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0) #define map_ff_effect(c) do { set_bit(c, input->ffbit); } while (0) -=20 + +#ifdef CONFIG_USB_HIDINPUT_POWERBOOK + +struct hidinput_key_translation { @@ -142,7 +123,7 @@ Index: work/drivers/usb/input/hid-input.c + +#define POWERBOOK_FLAG_FKEY 0x01 + -+static struct hidinput_key_translation powerbook_fn_keys[] =3D { ++static struct hidinput_key_translation powerbook_fn_keys[] = { + { KEY_BACKSPACE, KEY_DELETE }, + { KEY_F1, KEY_BRIGHTNESSDOWN, POWERBOOK_FLAG_FKEY }, + { KEY_F2, KEY_BRIGHTNESSUP, POWERBOOK_FLAG_FKEY }, @@ -161,7 +142,7 @@ Index: work/drivers/usb/input/hid-input.c + { } +}; + -+static struct hidinput_key_translation powerbook_numlock_keys[] =3D { ++static struct hidinput_key_translation powerbook_numlock_keys[] = { + { KEY_J, KEY_KP1 }, + { KEY_K, KEY_KP2 }, + { KEY_L, KEY_KP3 }, @@ -184,34 +165,31 @@ Index: work/drivers/usb/input/hid-input.c + { } +}; + -+static int usbhid_pb_fnmode =3D 1; ++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 =3D disabled, 1 =3D fkeyslast, 2 =3D fke= -ysfirst)"); ++ "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); + -+static struct hidinput_key_translation *find_translation(struct hidinput_k= -ey_translation *table, u16 from) ++static struct hidinput_key_translation *find_translation(struct hidinput_key_translation *table, u16 from) +{ + struct hidinput_key_translation *trans; + + /* Look for the translation */ -+ for (trans =3D table; trans->from; trans++) -+ if (trans->from =3D=3D from) ++ for (trans = table; trans->from; trans++) ++ if (trans->from == from) + return trans; + + return NULL; +} + -+static int hidinput_pb_event(struct hid_device *hid, struct input_dev *inp= -ut, ++static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, + struct hid_usage *usage, __s32 value) +{ + struct hidinput_key_translation *trans; + -+ if (usage->code =3D=3D KEY_FN) { -+ if (value) hid->quirks |=3D HID_QUIRK_POWERBOOK_FN_ON; -+ else hid->quirks &=3D ~HID_QUIRK_POWERBOOK_FN_ON; ++ if (usage->code == KEY_FN) { ++ if (value) hid->quirks |= HID_QUIRK_POWERBOOK_FN_ON; ++ else hid->quirks &= ~HID_QUIRK_POWERBOOK_FN_ON; + + input_event(input, usage->type, usage->code, value); + @@ -221,18 +199,16 @@ ut, + if (usbhid_pb_fnmode) { + int do_translate; + -+ trans =3D find_translation(powerbook_fn_keys, usage->code); ++ trans = find_translation(powerbook_fn_keys, usage->code); + if (trans) { + if (test_bit(usage->code, hid->pb_pressed_fn)) -+ do_translate =3D 1; ++ do_translate = 1; + else if (trans->flags & POWERBOOK_FLAG_FKEY) -+ do_translate =3D -+ (usbhid_pb_fnmode =3D=3D 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_= -ON)) || -+ (usbhid_pb_fnmode =3D=3D 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_= -ON)); ++ do_translate = ++ (usbhid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || ++ (usbhid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); + else -+ do_translate =3D (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); ++ do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); + + if (do_translate) { + if (value) @@ -248,7 +224,7 @@ ON)); + + if (test_bit(usage->code, hid->pb_pressed_numlock) || + test_bit(LED_NUML, input->led)) { -+ trans =3D find_translation(powerbook_numlock_keys, usage->code); ++ trans = find_translation(powerbook_numlock_keys, usage->code); + + if (trans) { + if (value) @@ -273,15 +249,14 @@ ON)); + set_bit(KEY_NUMLOCK, input->keybit); + + /* Enable all needed keys */ -+ for (trans =3D powerbook_fn_keys; trans->from; trans++) ++ for (trans = powerbook_fn_keys; trans->from; trans++) + set_bit(trans->to, input->keybit); + -+ for (trans =3D powerbook_numlock_keys; trans->from; trans++) ++ for (trans = powerbook_numlock_keys; trans->from; trans++) + set_bit(trans->to, input->keybit); +} +#else -+static inline int hidinput_pb_event(struct hid_device *hid, struct input_d= -ev *input, ++static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, + struct hid_usage *usage, __s32 value) +{ + return 0; @@ -292,15 +267,14 @@ ev *input, +} +#endif + - static void hidinput_configure_usage(struct hid_input *hidinput, struct hi= -d_field *field, + static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, struct hid_usage *usage) { @@ -336,7 +490,12 @@ static void hidinput_configure_usage(str -=20 + set_bit(EV_REP, input->evbit); switch(usage->hid & HID_USAGE) { -=2D case 0x003: map_key_clear(KEY_FN); break; +- case 0x003: map_key_clear(KEY_FN); break; + case 0x003: + /* The fn key on Apple PowerBooks */ + map_key_clear(KEY_FN); @@ -313,35 +287,30 @@ d_field *field, @@ -493,6 +652,9 @@ void hidinput_hid_event(struct hid_devic return; } -=20 -+ if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) && hidinput_pb_event(hid, = -input, usage, value)) + ++ if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) && hidinput_pb_event(hid, input, usage, value)) + return; + if (usage->hat_min < usage->hat_max || usage->hat_dir) { - int hat_dir =3D usage->hat_dir; + int hat_dir = usage->hat_dir; if (!hat_dir) @@ -535,7 +697,7 @@ void hidinput_hid_event(struct hid_devic return; } -=20 -=2D if((usage->type =3D=3D EV_KEY) && (usage->code =3D=3D 0)) /* Key 0 is "= -unassigned", not KEY_UNKNOWN */ -+ if ((usage->type =3D=3D EV_KEY) && (usage->code =3D=3D 0)) /* Key 0 is "u= -nassigned", not KEY_UNKNOWN */ + +- if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UNKNOWN */ ++ if ((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UNKNOWN */ return; -=20 + input_event(input, usage->type, usage->code, value); Index: work/drivers/usb/input/Kconfig -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -=2D-- work.orig/drivers/usb/input/Kconfig +=================================================================== +--- work.orig/drivers/usb/input/Kconfig +++ work/drivers/usb/input/Kconfig @@ -37,6 +37,16 @@ config USB_HIDINPUT -=20 + If unsure, say Y. -=20 + +config USB_HIDINPUT_POWERBOOK + bool "Enable support for iBook/PowerBook special keys" + default n diff --git a/a/content_digest b/N1/content_digest index 5238592..d8e6fa2 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -5,42 +5,33 @@ "Subject\0Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks\0" "Date\0Fri, 13 Jan 2006 23:58:33 -0500\0" "To\0Michael Hanselmann <linux-kernel@hansmi.ch>\0" - "Cc\0linux-kernel@killerfox.forkbomb.ch" + "Cc\0Vojtech Pavlik <vojtech@suse.cz>" + Benjamin Herrenschmidt <benh@kernel.crashing.org> linux-kernel@vger.kernel.org + linux-input@atrey.karlin.mff.cuni.cz linuxppc-dev@ozlabs.org - Vojtech Pavlik <vojtech@suse.cz> - " linux-input@atrey.karlin.mff.cuni.cz\0" + " linux-kernel@killerfox.forkbomb.ch\0" "\00:1\0" "b\0" "On Friday 13 January 2006 17:02, Michael Hanselmann wrote:\n" - "> -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0case 0x003: map_key_clear(KEY_FN);=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0=A0break;\n" + "> -\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240case 0x003: map_key_clear(KEY_FN);\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240break;\n" "> +#ifdef CONFIG_USB_HIDINPUT_POWERBOOK\n" - "> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0/* The fn key on Apple PowerBooks */\n" - "> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0case 0x0003: {\n" - "> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0struct hidinput_key_translatio=\n" - "n *trans;\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240/* The fn key on Apple PowerBooks */\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240case 0x0003: {\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240struct hidinput_key_translation *trans;\n" "> +\n" - "> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0map_key_clear(KEY_FN);\n" - "> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" - "=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0set_bit(KEY_NUMLOCK, input->ke=\n" - "ybit);\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240map_key_clear(KEY_FN);\n" + "> +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240set_bit(KEY_NUMLOCK, input->keybit);\n" "> +\n" "\n" "One little thing - I think that we should report FN key even if PowerBook\n" - "support is disabled. Can I solicit input on the patch below (I also rearran=\n" - "ged\n" - "teh code slightly)?=20\n" + "support is disabled. Can I solicit input on the patch below (I also rearranged\n" + "teh code slightly)? \n" "\n" - "=2D-=20\n" + "-- \n" "Dmitry\n" "\n" - "=46rom: Michael Hanselmann <linux-kernel@hansmi.ch>\n" + "From: Michael Hanselmann <linux-kernel@hansmi.ch>\n" "\n" "Input: HID - add support for fn key on Apple PowerBooks\n" "\n" @@ -53,26 +44,22 @@ "Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>\n" "\n" "Signed-off-by: Dmitry Torokhov <dtor@mail.ru>\n" - "=2D--\n" + "---\n" "\n" " drivers/usb/input/Kconfig | 10 ++\n" " drivers/usb/input/hid-core.c | 8 ++\n" - " drivers/usb/input/hid-input.c | 166 +++++++++++++++++++++++++++++++++++++=\n" - "++++-\n" + " drivers/usb/input/hid-input.c | 166 +++++++++++++++++++++++++++++++++++++++++-\n" " drivers/usb/input/hid.h | 31 ++++---\n" " 4 files changed, 201 insertions(+), 14 deletions(-)\n" "\n" "Index: work/drivers/usb/input/hid-core.c\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" - "=2D-- work.orig/drivers/usb/input/hid-core.c\n" + "===================================================================\n" + "--- work.orig/drivers/usb/input/hid-core.c\n" "+++ work/drivers/usb/input/hid-core.c\n" "@@ -1585,6 +1585,14 @@ static const struct hid_blacklist {\n" - "=20\n" - " \t{ USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION=\n" - " },\n" - "=20\n" + " \n" + " \t{ USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION },\n" + " \n" "+\t{ USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },\n" "+\t{ USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },\n" "+\t{ USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },\n" @@ -83,29 +70,27 @@ "+\n" " \t{ 0, 0 }\n" " };\n" - "=20\n" + " \n" "Index: work/drivers/usb/input/hid.h\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" - "=2D-- work.orig/drivers/usb/input/hid.h\n" + "===================================================================\n" + "--- work.orig/drivers/usb/input/hid.h\n" "+++ work/drivers/usb/input/hid.h\n" "@@ -235,18 +235,20 @@ struct hid_item {\n" " * HID device quirks.\n" " */\n" - "=20\n" - "=2D#define HID_QUIRK_INVERT\t\t\t0x001\n" - "=2D#define HID_QUIRK_NOTOUCH\t\t\t0x002\n" - "=2D#define HID_QUIRK_IGNORE\t\t\t0x004\n" - "=2D#define HID_QUIRK_NOGET\t\t\t\t0x008\n" - "=2D#define HID_QUIRK_HIDDEV\t\t\t0x010\n" - "=2D#define HID_QUIRK_BADPAD\t\t\t0x020\n" - "=2D#define HID_QUIRK_MULTI_INPUT\t\t\t0x040\n" - "=2D#define HID_QUIRK_2WHEEL_MOUSE_HACK_7\t\t0x080\n" - "=2D#define HID_QUIRK_2WHEEL_MOUSE_HACK_5\t\t0x100\n" - "=2D#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON\t\t0x200\n" - "=2D#define HID_QUIRK_2WHEEL_POWERMOUSE\t\t0x400\n" - "=2D#define HID_QUIRK_CYMOTION\t\t\t0x800\n" + " \n" + "-#define HID_QUIRK_INVERT\t\t\t0x001\n" + "-#define HID_QUIRK_NOTOUCH\t\t\t0x002\n" + "-#define HID_QUIRK_IGNORE\t\t\t0x004\n" + "-#define HID_QUIRK_NOGET\t\t\t\t0x008\n" + "-#define HID_QUIRK_HIDDEV\t\t\t0x010\n" + "-#define HID_QUIRK_BADPAD\t\t\t0x020\n" + "-#define HID_QUIRK_MULTI_INPUT\t\t\t0x040\n" + "-#define HID_QUIRK_2WHEEL_MOUSE_HACK_7\t\t0x080\n" + "-#define HID_QUIRK_2WHEEL_MOUSE_HACK_5\t\t0x100\n" + "-#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON\t\t0x200\n" + "-#define HID_QUIRK_2WHEEL_POWERMOUSE\t\t0x400\n" + "-#define HID_QUIRK_CYMOTION\t\t\t0x800\n" "+#define HID_QUIRK_INVERT\t\t\t0x00000001\n" "+#define HID_QUIRK_NOTOUCH\t\t\t0x00000002\n" "+#define HID_QUIRK_IGNORE\t\t\t0x00000004\n" @@ -120,12 +105,11 @@ "+#define HID_QUIRK_CYMOTION\t\t\t0x00000800\n" "+#define HID_QUIRK_POWERBOOK_HAS_FN\t\t0x00001000\n" "+#define HID_QUIRK_POWERBOOK_FN_ON\t\t0x00002000\n" - "=20\n" + " \n" " /*\n" " * This is the global environment of the parser. This information is\n" "@@ -432,6 +434,11 @@ struct hid_device {\t\t\t\t\t\t\t/* device repo\n" - " \tvoid (*ff_exit)(struct hid_device*); /* Called=\n" - " by hid_exit_ff(hid) */\n" + " \tvoid (*ff_exit)(struct hid_device*); /* Called by hid_exit_ff(hid) */\n" " \tint (*ff_event)(struct hid_device *hid, struct input_dev *input,\n" " \t\t\tunsigned int type, unsigned int code, int value);\n" "+\n" @@ -134,18 +118,16 @@ "+\tunsigned long pb_pressed_numlock[NBITS(KEY_MAX)];\n" "+#endif\n" " };\n" - "=20\n" + " \n" " #define HID_GLOBAL_STACK_SIZE 4\n" "Index: work/drivers/usb/input/hid-input.c\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" - "=2D-- work.orig/drivers/usb/input/hid-input.c\n" + "===================================================================\n" + "--- work.orig/drivers/usb/input/hid-input.c\n" "+++ work/drivers/usb/input/hid-input.c\n" "@@ -73,6 +73,160 @@ static const struct {\n" " #define map_key_clear(c)\tdo { map_key(c); clear_bit(c, bit); } while (0)\n" " #define map_ff_effect(c)\tdo { set_bit(c, input->ffbit); } while (0)\n" - "=20\n" + " \n" "+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK\n" "+\n" "+struct hidinput_key_translation {\n" @@ -156,7 +138,7 @@ "+\n" "+#define POWERBOOK_FLAG_FKEY 0x01\n" "+\n" - "+static struct hidinput_key_translation powerbook_fn_keys[] =3D {\n" + "+static struct hidinput_key_translation powerbook_fn_keys[] = {\n" "+\t{ KEY_BACKSPACE, KEY_DELETE },\n" "+\t{ KEY_F1,\tKEY_BRIGHTNESSDOWN,\tPOWERBOOK_FLAG_FKEY },\n" "+\t{ KEY_F2,\tKEY_BRIGHTNESSUP,\tPOWERBOOK_FLAG_FKEY },\n" @@ -175,7 +157,7 @@ "+\t{ }\n" "+};\n" "+\n" - "+static struct hidinput_key_translation powerbook_numlock_keys[] =3D {\n" + "+static struct hidinput_key_translation powerbook_numlock_keys[] = {\n" "+\t{ KEY_J,\tKEY_KP1 },\n" "+\t{ KEY_K,\tKEY_KP2 },\n" "+\t{ KEY_L,\tKEY_KP3 },\n" @@ -198,34 +180,31 @@ "+\t{ }\n" "+};\n" "+\n" - "+static int usbhid_pb_fnmode =3D 1;\n" + "+static int usbhid_pb_fnmode = 1;\n" "+module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);\n" "+MODULE_PARM_DESC(pb_fnmode,\n" - "+\t\"Mode of fn key on PowerBooks (0 =3D disabled, 1 =3D fkeyslast, 2 =3D fke=\n" - "ysfirst)\");\n" + "+\t\"Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)\");\n" "+\n" - "+static struct hidinput_key_translation *find_translation(struct hidinput_k=\n" - "ey_translation *table, u16 from)\n" + "+static struct hidinput_key_translation *find_translation(struct hidinput_key_translation *table, u16 from)\n" "+{\n" "+\tstruct hidinput_key_translation *trans;\n" "+\n" "+\t/* Look for the translation */\n" - "+\tfor (trans =3D table; trans->from; trans++)\n" - "+\t\tif (trans->from =3D=3D from)\n" + "+\tfor (trans = table; trans->from; trans++)\n" + "+\t\tif (trans->from == from)\n" "+\t\t\treturn trans;\n" "+\n" "+\treturn NULL;\n" "+}\n" "+\n" - "+static int hidinput_pb_event(struct hid_device *hid, struct input_dev *inp=\n" - "ut,\n" + "+static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,\n" "+\t\t\t struct hid_usage *usage, __s32 value)\n" "+{\n" "+\tstruct hidinput_key_translation *trans;\n" "+\n" - "+\tif (usage->code =3D=3D KEY_FN) {\n" - "+\t\tif (value) hid->quirks |=3D HID_QUIRK_POWERBOOK_FN_ON;\n" - "+\t\telse hid->quirks &=3D ~HID_QUIRK_POWERBOOK_FN_ON;\n" + "+\tif (usage->code == KEY_FN) {\n" + "+\t\tif (value) hid->quirks |= HID_QUIRK_POWERBOOK_FN_ON;\n" + "+\t\telse hid->quirks &= ~HID_QUIRK_POWERBOOK_FN_ON;\n" "+\n" "+\t\tinput_event(input, usage->type, usage->code, value);\n" "+\n" @@ -235,18 +214,16 @@ "+\tif (usbhid_pb_fnmode) {\n" "+\t\tint do_translate;\n" "+\n" - "+\t\ttrans =3D find_translation(powerbook_fn_keys, usage->code);\n" + "+\t\ttrans = find_translation(powerbook_fn_keys, usage->code);\n" "+\t\tif (trans) {\n" "+\t\t\tif (test_bit(usage->code, hid->pb_pressed_fn))\n" - "+\t\t\t\tdo_translate =3D 1;\n" + "+\t\t\t\tdo_translate = 1;\n" "+\t\t\telse if (trans->flags & POWERBOOK_FLAG_FKEY)\n" - "+\t\t\t\tdo_translate =3D\n" - "+\t\t\t\t\t(usbhid_pb_fnmode =3D=3D 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_=\n" - "ON)) ||\n" - "+\t\t\t\t\t(usbhid_pb_fnmode =3D=3D 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_=\n" - "ON));\n" + "+\t\t\t\tdo_translate =\n" + "+\t\t\t\t\t(usbhid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||\n" + "+\t\t\t\t\t(usbhid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));\n" "+\t\t\telse\n" - "+\t\t\t\tdo_translate =3D (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);\n" + "+\t\t\t\tdo_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);\n" "+\n" "+\t\t\tif (do_translate) {\n" "+\t\t\t\tif (value)\n" @@ -262,7 +239,7 @@ "+\n" "+\t\tif (test_bit(usage->code, hid->pb_pressed_numlock) ||\n" "+\t\t test_bit(LED_NUML, input->led)) {\n" - "+\t\t\ttrans =3D find_translation(powerbook_numlock_keys, usage->code);\n" + "+\t\t\ttrans = find_translation(powerbook_numlock_keys, usage->code);\n" "+\n" "+\t\t\tif (trans) {\n" "+\t\t\t\tif (value)\n" @@ -287,15 +264,14 @@ "+\tset_bit(KEY_NUMLOCK, input->keybit);\n" "+\n" "+\t/* Enable all needed keys */\n" - "+\tfor (trans =3D powerbook_fn_keys; trans->from; trans++)\n" + "+\tfor (trans = powerbook_fn_keys; trans->from; trans++)\n" "+\t\tset_bit(trans->to, input->keybit);\n" "+\n" - "+\tfor (trans =3D powerbook_numlock_keys; trans->from; trans++)\n" + "+\tfor (trans = powerbook_numlock_keys; trans->from; trans++)\n" "+\t\tset_bit(trans->to, input->keybit);\n" "+}\n" "+#else\n" - "+static inline int hidinput_pb_event(struct hid_device *hid, struct input_d=\n" - "ev *input,\n" + "+static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,\n" "+\t\t\t\t struct hid_usage *usage, __s32 value)\n" "+{\n" "+\treturn 0;\n" @@ -306,15 +282,14 @@ "+}\n" "+#endif\n" "+\n" - " static void hidinput_configure_usage(struct hid_input *hidinput, struct hi=\n" - "d_field *field,\n" + " static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,\n" " \t\t\t\t struct hid_usage *usage)\n" " {\n" "@@ -336,7 +490,12 @@ static void hidinput_configure_usage(str\n" - "=20\n" + " \n" " \t\t\tset_bit(EV_REP, input->evbit);\n" " \t\t\tswitch(usage->hid & HID_USAGE) {\n" - "=2D\t\t\t\tcase 0x003: map_key_clear(KEY_FN);\t\tbreak;\n" + "-\t\t\t\tcase 0x003: map_key_clear(KEY_FN);\t\tbreak;\n" "+\t\t\t\tcase 0x003:\n" "+\t\t\t\t\t/* The fn key on Apple PowerBooks */\n" "+\t\t\t\t\tmap_key_clear(KEY_FN);\n" @@ -327,35 +302,30 @@ "@@ -493,6 +652,9 @@ void hidinput_hid_event(struct hid_devic\n" " \t\treturn;\n" " \t}\n" - "=20\n" - "+\tif ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) && hidinput_pb_event(hid, =\n" - "input, usage, value))\n" + " \n" + "+\tif ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) && hidinput_pb_event(hid, input, usage, value))\n" "+\t\treturn;\n" "+\n" " \tif (usage->hat_min < usage->hat_max || usage->hat_dir) {\n" - " \t\tint hat_dir =3D usage->hat_dir;\n" + " \t\tint hat_dir = usage->hat_dir;\n" " \t\tif (!hat_dir)\n" "@@ -535,7 +697,7 @@ void hidinput_hid_event(struct hid_devic\n" " \t\treturn;\n" " \t}\n" - "=20\n" - "=2D\tif((usage->type =3D=3D EV_KEY) && (usage->code =3D=3D 0)) /* Key 0 is \"=\n" - "unassigned\", not KEY_UNKNOWN */\n" - "+\tif ((usage->type =3D=3D EV_KEY) && (usage->code =3D=3D 0)) /* Key 0 is \"u=\n" - "nassigned\", not KEY_UNKNOWN */\n" + " \n" + "-\tif((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is \"unassigned\", not KEY_UNKNOWN */\n" + "+\tif ((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is \"unassigned\", not KEY_UNKNOWN */\n" " \t\treturn;\n" - "=20\n" + " \n" " \tinput_event(input, usage->type, usage->code, value);\n" "Index: work/drivers/usb/input/Kconfig\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\n" - "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" - "=2D-- work.orig/drivers/usb/input/Kconfig\n" + "===================================================================\n" + "--- work.orig/drivers/usb/input/Kconfig\n" "+++ work/drivers/usb/input/Kconfig\n" "@@ -37,6 +37,16 @@ config USB_HIDINPUT\n" - "=20\n" + " \n" " \t If unsure, say Y.\n" - "=20\n" + " \n" "+config USB_HIDINPUT_POWERBOOK\n" "+\tbool \"Enable support for iBook/PowerBook special keys\"\n" "+\tdefault n\n" @@ -370,4 +340,4 @@ " \tbool \"Force feedback support (EXPERIMENTAL)\"\n" " \tdepends on USB_HIDINPUT && EXPERIMENTAL" -60b62b8def614d22f1e9238639da0b7210b4beb5745243a321f1a3ed13841b01 +1ebcbf163f002bf0c9ac6bcd0fd5b29ed48acbfce82de1f38bebaff030b94902
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.