diff options
author | Patrick Rudolph <siro@das-labor.org> | 2017-11-14 19:00:20 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-07-09 09:19:59 +0000 |
commit | f1114d891865e70ae1f2ba58844fec11d055ae3a (patch) | |
tree | 93d58cca13f40c9ee0edee69ebd7b7c3fa62dede /src/ec/lenovo/h8/acpi | |
parent | 01d2e46ddb9e17bda911ccce97bfef8ad77b1cbc (diff) |
ec/lenovo/h8/acpi: Add BDC interface
* Add SSDT generator to add dynamic ACPI code.
* Implement GBDC and SBDC for thinkpad_acpi kernel module.
Required for BDC power control from userspace.
Tested on Lenovo T430:
The bluetooth module is detected and can be powercycled using network manager.
Change-Id: Ida825196650966194a883945896a038b0790fe45
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/20985
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/ec/lenovo/h8/acpi')
-rw-r--r-- | src/ec/lenovo/h8/acpi/thinkpad.asl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ec/lenovo/h8/acpi/thinkpad.asl b/src/ec/lenovo/h8/acpi/thinkpad.asl index eb5b60e705..de2fe68192 100644 --- a/src/ec/lenovo/h8/acpi/thinkpad.asl +++ b/src/ec/lenovo/h8/acpi/thinkpad.asl @@ -153,4 +153,41 @@ Device (HKEY) { Return (\_SB.PCI0.LPCB.EC.GSTS) } + + /* + * Returns the current state: + * Bit 0: BT HW present + * Bit 1: BT radio enabled + * Bit 2: BT state at resume + */ + Method (GBDC, 0) + { + If (HBDC) { + Store(One, Local0) + If(\_SB.PCI0.LPCB.EC.BTEB) + { + Or(Local0, 2, Local0) + } + /* FIXME: Implement state at resume, for now Enabled */ + Or(Local0, 4, Local0) + Return (Local0) + } Else { + Return (0) + } + } + + /* + * Set the current state: + * Bit 1: BT radio enabled + * Bit 2: BT state at resume + */ + Method (SBDC, 1) + { + If (HBDC) { + ShiftRight (And(Arg0, 2), 1, Local0) + Store (Local0, \_SB.PCI0.LPCB.EC.BTEB) + + /* FIXME: Store state at resume */ + } + } } |