macbook12-spi-driver
macbook12-spi-driver copied to clipboard
Touchbar doesn't start after Suspend
Branch: "mbp15"
MBP 2019 15" - Model A1990
$ uname -a Linux joax-ubuntu 5.6.9 #8 SMP Thu May 14 16:02:50 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux
When starting Ubuntu, including this driver, the Touchbar works as intended. But when Ubuntu suspends, the Touchbar is lost.
Reproduce:
- Close the laptop lid
- Wait 1 minute
- Open laptop lid
When opening, the Touchbar is not active. The following log is on /var/log/syslog:
May 17 20:43:14 joax-ubuntu kernel: [ 6415.967830] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar display to 4 (-113)
May 17 20:43:14 joax-ubuntu kernel: [ 6415.967831] apple-ib-touchbar 0003:05AC:8302.0007: tb: Touchbar suspended.
I was able to make it work by patching the file. I know this might not be the desired fix so I won't send it as merge request:
@@ -1419,6 +1476,7 @@ static struct hid_driver appletb_hid_driver = {
.input_configured = appletb_input_configured,
#ifdef CONFIG_PM
.suspend = appletb_suspend,
+ .resume = appletb_reset_resume,
.reset_resume = appletb_reset_resume,
#endif
};
With this change, the touchbar does work again back from Suspend. The only missing piece is the keyboard brightness which I don't think has to do with this driver, but with how the keyboard is brought back on resume (BCE driver perhaps?). Still researching that.
Edited:
I was able to bring the keyboard back-light as well by restarting upower on wake of sleep by adding the following file /lib/systemd/system-sleep/upower-onwake:
#!/bin/sh
# Restart UPower
case "$1" in
post)
sleep 5
/usr/sbin/service upower restart
;;
esac
You could add a line as well to restore the backlight level. I chose not to.