Linux Kernel Project Update: Touchpad is Working!

Big thanks to roadrunner2 for his work on getting functionality on his Macbook Pro (which shares alot of the same components as our computers). Apparently, there was a communication breakdown between the device and driver which is fixed by adding short delays between the setup messages. I’m not sure if this is the optimal way to solve it, but at least the trackpad has pretty close to full functionality now!

It makes me very happy to say that I am now typing this blog post from inside Linux on my Macbook.

What still doesn’t work is force touch (pressing harder on the trackpad) and right click via a two finger click (which I utilize alot). Most likely the force touch will be backburnered since it is high effort, low reward, and I can just add two finger click without having to do it from within the kernel itself.

I’ve put off work on the speakers for now since it is relatively unimportant, at least compared to getting resume working.

From what I’ve read and then confirmed for myself, the hard drive, which is nvme, is not shutting down properly. I tried reversing it, but haven’t been able to gleam too much from that process (I’m not experienced enough in reversing). Someone (I apologize for not remembering your name or where you said this) reversed it and was able to find custom op-codes that are manufacturer specific that are called right before OS X shuts down the hard drive.

My debugging of the problem is significantly hindered by the fact that every time I want to test anything, it results in me having to reboot. Thankfully, the ssd is very quick and arch has a small footprint.

Another possible part of the problem is the disabling of LPSS. From what I can tell from intel’s original LPSS patent, it is used to put the computer in a state where data can be recovered later. However, the patent is super old (1999) and an entirely different system or process is being used to suspend.

It is the intersection of these problems (improper nvme shutdown and disabled lpss side-effects) that makes fixing resume so finicky. I’m going to read as much as I can about LPSS and nvme as well as try once again to reverse the Mac driver.

Linux Kernel Project Update: Keyboard is working!

Project introduction here: http://charlieyou.me/linux0/

Max has figured out that if you disable the low power subsystem (LPSS) inside of the SPI driver (pxa2xx.c), then the applespi driver written by cb22 is able to do its job. In other words: the keyboard now works!

Well… mostly. Key rollover still does not work, so you can’t press two keys at the same time and have both be detected. Wakeup from keyboard also doesn’t work. The latter we’ll tackle along with sleep/hiberate issues. The former Max is trying to figure out now.

The immediate next step is to get the trackpad to work as well. Valid data is being read by the IRQ handler, so it should just be a matter of piping it to the correct place.

My focus is now on getting the internal speakers to work. Strangely enough, the headphone jack and internal mic work perfectly, it’s just the speakers that don’t output anything. There’s a bugzilla post for this that’s been a fairly helpful start: https://bugzilla.kernel.org/show_bug.cgi?id=110561. For an overview of the linux audio stack see this article: http://voices.canonical.com/david.henningsson/2011/12/08/audio-debugging-techniques/.

So far, I’ve played around with the patches mentioned in the bugzilla as well as hda jack retask to see if I could reroute to a different pin that is hopefully the speaker. No luck with that. Next I tried to just route the output to all unconnected pins, and that did get some sound from the speaker. Not the right sound and the kernel promptly panicked. But it’s something…

After this, the next things to tackle are:

  • Screen tearing
  • Bluetooth
  • Sleep/hibernate