1

I'm having a weird problem. I've done some hacking based on another person's work to backport support for the internal keyboard on a MacBook Pro 11,5 into kernel 3.19. My GitHub source can be found here.

I've done everything I can to ensure that it's as close to kernel 4.2 as possible while still being able to compile and work as expected on 3.19.

However, while booting into 4.2 gives me perfect functionality working as expected, my module doesn't seem to do anything. Existing Apple devices work as expected, but I'm still having the same problems with my built-in keyboard.

The problems are based around the fact that the function key doesn't work, and therefore I can't use my media keys. I've also done sanity testing to make sure that other Apple keyboards do work (tested with Apple wired and wireless keyboard and both work properly).

Is there a way for me to validate that my keyboard is being bound to the right driver?

The USB id for the device is 05ac:0274, and a config line can be found for that device in hid-ids.h:147 and in hid-apple.c:553-554. I'm convinced that it's just not picking up the device, because even with the hid-apple module removed, my built-in keyboard works though the other ones don't.

How can I debug what's happening and why my built-in keyboard isn't getting bound to the hid-apple module?


EDIT: I was able to get my keyboard bound to the right driver using the following:

# unbind everything matching 05AC:0274 from hid-generic
for dev in `ls /sys/bus/hid/drivers/hid-generic/ | egrep 05AC\:0274`; do
    echo -n $dev | sudo tee /sys/bus/hid/drivers/hid-generic/unbind
done
# bind everything matching 05AC:0274 to hid-apple
for dev in `ls /sys/bus/hid/devices/ | egrep 05AC:0274` ; do
    echo -n $dev | sudo tee /sys/bus/hid/drivers/hid-apple/bind
done

The problem remains: how do I force a given USB id to associate with a given driver? I'll accept the given answer below, but I'm still looking for a solution...

2

There is an excellent answer here. The short answer is the command usb-devices (available for most distros in a package called usbutils or something similar) will should give you the info you want on the current driver each usb device is using.

  • Excellent, that solves OP, but now I need to figure out why it's not getting bound to the right driver: pastebin.com/YJQstL6k – Naftuli Kay Nov 3 '15 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.