# Surface Pro 4 Type Cover

## jyoung

Hi Folks,

I'm setting up Gentoo on a Surface Pro 4, and I'm having difficulty getting the Type Cover (the detachable keyboard) to work. In addition to the Gentoo handbook, I've been following this excellent example:

https://github.com/danielquinn/Gentoo-Surface-Pro-3

The thread was originally for a Surface Pro 3, but after in the notes for kernel 4.4.x he says 'we now have support for the Surface Pro 4 TypeCover'. The solution in the thread is a custom .config file + a series of kernel patches. For some reason, this didn't work for me, regardless of which kernel version I attempted (I tried 4.4.x and 4.9.5).

I'd don't think it's a hardware problem. The Type Cover does work in the UEFI boot menu, and it works in the Grub boot menu. From within Gentoo, dmesg is also able to detect the Type Cover as a USB HID device, even though keystrokes aren't registering. The touchpad doesn't work either.

The Type Cover didn't not work with the Gentoo live usb (which I rather expected since that kernel hadn't been patched), and it also didn't work with a Linux Lite live usb.

If you folks could point me in the right direction, that would be great!

----------

## Roman_Gruber

 *Quote:*   

> The solution in the thread is a custom .config file + a series of kernel patches. 

 

Please provide more details for the lazy guys.

like direct link to these references and kernel patches.

--

Are you talking about that the patch command does not work out of the box? That never worked for myself. I always edited the kernel source by hand by reading those patches, reading the kernel source and adapting it myself. I suggest you apply those changes yourself and check if those refercned functions have not changed and such. It's not that hard. I did that for years for several components.

the patch only works for the "reference" kernel it was created for.

Check your HID section, any other section, staging section and such.

You can debug with xev for example.

--

You are talking about a microsoft surface pro 4, right? Thats a very exotic hardware in the first place. 2nd its exotic that some guys want to use gnu/linux on that too, which reduces the available users also.

--

It also depends if it tells uefi i am a keyboard, i am a mouse, or if they tell them i am something else!

----------

## jyoung

Actually, the problem was on my end. In order to generate the specifics you asked for, I repeated all the earlier steps using the 4.9.5 kernel. This time, I noticed that 'make install' was writing the kernel to vmlinuz-4.9.5-gentoo-surfacepro3 instead of vmlinuz-4.9.5-gentoo  (as I assumed). Once I directed the bootloader to the right place, the Type Cover worked.

Thanks for asking questions that made me realize this! And, for any future readers, the procedure in the thread below seems to work for a Surface Pro 4:

https://github.com/danielquinn/Gentoo-Surface-Pro-3

----------

## Roman_Gruber

Glad it worked for you.

i usually have to copy the build kernel myself => cp /usr/src/linux/arch/x86/boot/bzimage /boot/mychoosennamekernel

----------

