Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: hci_bcm: Support Apple GPIO handling
Enable Bluetooth on the following Macs which do not specify the GPIOs for device wakeup and shutdown in the DSDT but instead provide custom ACPI methods to toggle the pins: MacBook8,1 2015 12" MacBook9,1 2016 12" MacBook10,1 2017 12" MacBookPro13,1 2016 13" MacBookPro13,2 2016 13" with Touch Bar MacBookPro13,3 2016 15" with Touch Bar MacBookPro14,1 2017 13" MacBookPro14,2 2017 13" with Touch Bar MacBookPro14,3 2017 15" with Touch Bar The custom ACPI methods are called: BTLP (Low Power) takes one argument, toggles device wakeup GPIO BTPU (Power Up) tells SMC to drive shutdown GPIO high BTPD (Power Down) tells SMC to drive shutdown GPIO low BTRS (Reset) calls BTPU followed by BTPD BTRB unknown, not present on all MacBooks Search for the BTLP, BTPU and BTPD methods on ->probe, cache them in struct bcm_device and invoke them instead of toggling the GPIO pins if the machine is a Mac. Additionally, set the baudrate based on a custom device property provided by Apple in lieu of _CRS resources. The host wakeup pin goes into the SMC which handles it transparently to the OS, so there's no need to request an IRQ for it. The existing code is a bit fishy as it ignores the return value of bcm_gpio_set_power(), even though portions of it may fail (such as enabling the clock). The present commit returns an error if calling the ACPI methods fails and the code needs to be fixed up in a separate commit to evaluate the return value of bcm_gpio_set_power() and bcm_gpio_set_device_wake(), as well as check for failure of clock enablement and so on. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110901 Reported-by: Leif Liddy <leif.liddy@gmail.com> Cc: Ronald Tschalär <ronald@innovation.ch> Cc: Peter Y. Chuang <peter@novelist.xyz> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lukas Wunner <lukas@wunner.de>
- Loading branch information