usbhid, wtp, and hkbd devices at the same time.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Aug 2024 23:05:01 UTC
Hi, I am currently trying to set up a FreeBSD 13.3-RELEASE system on a Macbook, and am trying to get a perfect setup for the keyboard and trackpad. In my ideal world, I would like the system to automatically on boot use: 1. 'wtp' driver for the trackpad, 2. 'hkbd' driver for the inbuilt keyboard. As it stands, I have been able to set this up with a /boot/loader.conf containing: --- wsp_load="YES" hkbd_load="YES" hw.usb.usbhid.enable="1" --- and a /boot/device.hints containing: hint.ukbd.0.disabled="1" # kill ukbd hint.hkbd.0.at="usb" # use hkbd --- (Killing ukbd using a device.hint means that single-user-mode does not work as there is no keyboard, but it is possible to manually set the hint using the boot config to enable ukbd and boot into single-user-mode if necessary.) This is nearly perfect for my use-case, as I want to refrain from building the kernel myself. However, when I suspend and then resume the system, the wsp driver no longer shows up, and the trackpad (ugen0.3.2?) attaches with usbhid. The issue seems to stem from the usbhid driver taking preference over the wsp driver on the suspend sequence (but not the boot sequence for some reason). In sys/dev/usb/input/usbhid.c, the usbhid_probe function specifically returns "return (BUS_PROBE_DEFAULT + 1);" to take preference. That seems to follow the discussion here: https://groups.google.com/g/bsdmailinglist/c/kPnaviy-gC8 I can change the wsp.c code's wsp_probe function to "return (BUS_PROBE_DEFAULT + 2);" which ensures the wsp driver takes priority, but I would really like a solution which only involves editing system files instead. I thought that using usb_quirk or hidquirk could work, but it isn't obvious to me if it is possible to IGNORE a specific *endpoint*, rather than a whole device (i.e. ensure that usbhid ignores `ugen0.3.2` at all times. I have attached a few files: * dmesg.txt: dmesg of booting and then suspend/resuming, showing the wsp driver "going away" and being taken over by usbhid. * devinfo.beforesleep.txt: devinfo -v, before suspending * devinfo.aftersleep.txt, devinfo -v, after resuming * usbconfig.beforesleep.txt: usbconfig show_ifdrv, before suspending * usbconfig.aftersleep.txt: usbconfig show_ifdrv, after resuming I have considered somehow using the hidraw driver too, but also not sure how to go about that. The ultimate goal is to use the wsp and hkbd, with suspend/resume resuming to those drivers too. I have also tried using `devctl` to force the wsp driver to be used, but it causes a kernel crash (report to be submitted). Any support is appreciated. Cheers, Joshua.