Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchbar doesn't start after Suspend #47

Open
joax opened this issue May 18, 2020 · 1 comment
Open

Touchbar doesn't start after Suspend #47

joax opened this issue May 18, 2020 · 1 comment

Comments

@joax
Copy link

joax commented May 18, 2020

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:

  1. Close the laptop lid
  2. Wait 1 minute
  3. 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.

@joax
Copy link
Author

joax commented May 26, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant