[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fn key and 2.6.12-rc4



On Thu, 2005-07-28 at 12:56 +0200, Stelian Pop wrote:
> Le mardi 05 juillet 2005 à 16:25 +0200, Johannes Berg a écrit :
> > Jochen Voss wrote:
> > 
> > >My only idea is to take the 2.6.12-rc kernels one by one, to find out
> > >in which one it breaks and then to look at the corresponding patch.
> > >Maybe something suspicious can be spotted there.  I guess this whole
> > >procedure would take me about one day, so I did not yet find time to
> > >do this.
> 
> I had a few hours to spend and I made it work again.
> 
> Now, I didn't look at the previous (working) code so I don't know
> exactly what change broke it. In fact, looking at the logic I don't
> understand how this could have been working before (unless the logic
> itself changed...).
> 
> Anyway, the attached patch below replaces the Johannes' one. Note that I
> don't use the Fn key myself yet, so testing has been limited to looking
> at evtest and xev output...
> 
> Should I push this in the mainstream kernel ?
> 
> Stelian.
> 

Hello, I tried to apply your patch to a clean 2.6.12.3 kernel tree but
got some rejects, so I had to apply the rejected sections manually.
Anyway, the Fn-key works perfectly now. Thank you! I'll paste the
rejects below if you're interested. (was the patch intended for 2.6.12.3
anyways? Maybe I applied it wrong?)

$ patch -p1 < ../stelian.pop.fnkey.patch
patching file drivers/usb/input/hid-core.c
Hunk #1 succeeded at 1426 with fuzz 2 (offset -20 lines).
Hunk #2 FAILED at 1541.
1 out of 2 hunks FAILED -- saving rejects to file
drivers/usb/input/hid-core.c.rej
patching file drivers/usb/input/hid-input.c
Hunk #1 FAILED at 106.
Hunk #2 FAILED at 328.
2 out of 2 hunks FAILED -- saving rejects to file
drivers/usb/input/hid-input.c.rej
patching file drivers/usb/input/hid.h
Hunk #1 FAILED at 242.
1 out of 1 hunk FAILED -- saving rejects to file
drivers/usb/input/hid.h.rej


drivers/usb/input/hid-core.c.rej:
***************
*** 1537,1542 ****
         { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD,
HID_QUIRK_BADPAD },
         { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD,
HID_QUIRK_BADPAD },

         { 0, 0 }
  };

--- 1541,1549 ----
         { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD,
HID_QUIRK_BADPAD },
         { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD,
HID_QUIRK_BADPAD },

+        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_POWERBOOK_KB_US,
HID_QUIRK_POWERBOOK_FN_BUTTON },
+        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_POWERBOOK_KB_UK,
HID_QUIRK_POWERBOOK_FN_BUTTON },
+
         { 0, 0 }
  };


drivers/usb/input/hid-input.c.rej:
***************
*** 106,111 ****
                         } else
                                 map_key(KEY_UNKNOWN);

                         break;

                 case HID_UP_BUTTON:
--- 106,115 ----
                         } else
                                 map_key(KEY_UNKNOWN);

+                        if ((device->quirks &
HID_QUIRK_POWERBOOK_FN_BUTTON) &&
+                            (hid_keyboard[usage->hid & HID_USAGE] ==
KEY_RIGHTCTRL))
+                                map_key(KEY_UNKNOWN);
+
                         break;

                 case HID_UP_BUTTON:
***************
*** 324,329 ****

                 default:
                 unknown:
                         if (field->report_size == 1) {
                                 if (field->report->type ==
HID_OUTPUT_REPORT) {
                                         map_led(LED_MISC);
--- 328,337 ----

                 default:
                 unknown:
+                        if ((device->quirks &
HID_QUIRK_POWERBOOK_FN_BUTTON) && (usage->hid == 0x00ff0003)) {
+                                map_key_clear(KEY_RIGHTCTRL);
+                                break;
+                        }
                         if (field->report_size == 1) {
                                 if (field->report->type ==
HID_OUTPUT_REPORT) {
                                         map_led(LED_MISC);


drivers/usb/input/hid.h.rej:
***************
*** 242,247 ****
  #define HID_QUIRK_2WHEEL_MOUSE_HACK_7          0x080
  #define HID_QUIRK_2WHEEL_MOUSE_HACK_5          0x100
  #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON         0x200

  /*
   * This is the global environment of the parser. This information is
--- 242,248 ----
  #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_POWERBOOK_FN_BUTTON          0x400

  /*
   * This is the global environment of the parser. This information is


Thanks again for your work :)
-- 
Johannes H. Jensen <joh@deworks.net>
deworks

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: