# Laptop keyboard and trackpad not working



## debu_chocobo (Mar 4, 2021)

Hi everyone.

I'm running FreeBSD 12.2, but my laptop keyboard and trackpad don't work. I can plug in a USB keyboard and mouse and they work fine. I found this in the log file, but couldn't find much to explain the error message or how to fix it.

I'm using a Surface Book.
Intel Core i5-6300U
8GB Ram

Many thanks for any help.


```
uhid0: <SINO WEALTH USB KEYBOARD, class 0/0, rev 1.10/1.00, addr 4> on usbus0
uhid1 on uhub1
uhid1: <Microsoft Surface Keyboard, class 0/0, rev 2.10/5.07, addr 5> on usbus0
uhid1: no report descriptor
device_attach: uhid1 attach returned 12
uhid1 on uhub1
uhid1: <Microsoft Surface Keyboard, class 0/0, rev 2.10/5.07, addr 5> on usbus0
uhid1: no report descriptor
device_attach: uhid1 attach returned 12
uhid1 on uhub1
uhid1: <Microsoft Surface Keyboard, class 0/0, rev 2.10/5.07, addr 5> on usbus0
uhid1: no report descriptor
device_attach: uhid1 attach returned 12
axge0 on uhub4
```
------------------------------------------------------------------------------------------------

EDIT: Found the solution for TTY (doesn't work in Gnome). I'll leave it here for anyone else trying to get into FreeBSD.
The Keyboard and mouse use uhid. The kernel USB drivers need blacklisting for the uhid keyboard.

Find which interface the keyboard is attached to. Mine is on ugen0.4.
# usbconfig

```
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <Microsoft USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.3: <VIA Labs, Inc. USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.4: <Microsoft Surface Keyboard> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.5: <SINO WEALTH USB KEYBOARD> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen0.6: <Microsoft USB3.0 Hub> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.7: <VIA Labs, Inc. USB3.0 Hub> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.8: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (124mA)
```

Get the idVendor and idProduct.
# usbconfig -d ugen.0.4 dump_device_desc

```
ugen0.4: <Microsoft Surface Keyboard> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0210
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x045e
  idProduct = 0x07cd
  bcdDevice = 0x0507
  iManufacturer = 0x0001  <Microsoft>
  iProduct = 0x0002  <Surface Keyboard>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001
```

Modify the following line where 0x045e is the idVendor and idProduct is 0x07cd to whatever is in your output.

hw.usb.quirk=0x045e 0x07cd 0xffff UQ_KBD_BOOTPROTO

Add the above line to /boot/loader.conf. Here's mine:


```
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load="YES"
hw.usb.quirk=0x045e 0x07cd 0xfff UQ_KBD_BOOTPROTO
```

Install the uhid package.
# pkg install uhidd

Add the following lines to rc.conf.  Change the /dev/ugen0.4 to wherever your keyboard is attached based on usbconfig output.

```
uhidd_flags="-kmohsu /dev/ugen0.4"
uhidd_enable="YES"
Here's my rc.conf just for reference.
keymap="uk.kbd"
ifconfig_ue0="DHCP"
sshd_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
kld_list="/boot/modules/i915kms.ko"
uhidd_flags="-kmohsu /dev/ugen0.5"
uhidd_enable="YES"
allscreens_flags="-f terminus-b32"
```

Reboot. Should be working.
---------------------------------------------------------------------------------------
Hi everyone.
I'm running FreeBSD 12.2, but my laptop keyboard and trackpad don't  work. I can plug in a USB keyboard and mouse and they work fine. I found  this in the log file, but couldn't find much to explain the error  message or how to fix it.
I'm using a Surface Book.Intel Core i5-6300U8GB Ram
Many thanks for any help.

```
uhid0: <SINO WEALTH USB KEYBOARD, class 0/0, rev 1.10/1.00, addr 4> on usbus0
uhid1 on uhub1
uhid1: <Microsoft Surface Keyboard, class 0/0, rev 2.10/5.07, addr 5> on usbus0
uhid1: no report descriptor
device_attach: uhid1 attach returned 12
uhid1 on uhub1
uhid1: <Microsoft Surface Keyboard, class 0/0, rev 2.10/5.07, addr 5> on usbus0
uhid1: no report descriptor
device_attach: uhid1 attach returned 12
uhid1 on uhub1
uhid1: <Microsoft Surface Keyboard, class 0/0, rev 2.10/5.07, addr 5> on usbus0
uhid1: no report descriptor
device_attach: uhid1 attach returned 12
axge0 on uhub4
```


----------



## SirDice (Mar 4, 2021)

I suspect you're going to need sysutils/uhidd with FreeBSD 12.2 for this laptop. Or try 13.0-BETA4.


----------



## debu_chocobo (Mar 5, 2021)

Many thanks, SirDice. 

That got me pointed in the right direction. TTY's working fine now, but same problem in Gnome. I'll start a new thread. Thanks again.


SirDice said:


> I suspect you're going to need sysutils/uhidd with FreeBSD 12.2 for this laptop. Or try 13.0-BETA4.


----------



## debu_chocobo (Mar 5, 2021)

Now TTY works perfectly but both the keyboard and trackpad are completely unresponsive in Gnome.

Can't see anything wrong in Xorg.0.txt.

USB config gives me only one device - no separate keyboard and trackpad.

Many thanks for any help.


```
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <Microsoft USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.3: <VIA Labs, Inc. USB2.0 Hub> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.4: <SINO WEALTH USB KEYBOARD> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen0.5: <Microsoft Surface Keyboard> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.6: <Microsoft USB3.0 Hub> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.7: <VIA Labs, Inc. USB3.0 Hub> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.8: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (124mA)
```


----------



## SirDice (Mar 5, 2021)

Don't post multiple threads about the same issue. Threads merged.


----------

