diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2019-05-30 05:28:56 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-02-03 22:02:37 +0300 |
commit | 952830607c23c861991b1e9a1250bf1e6827af90 (patch) | |
tree | 2b1581b64bb065b1e48cd3338b5bf63fede16073 /src/ec/apple/acpi/ec.asl | |
parent | 1254e370cc786a8a87f6f60a5cbd9381a6e196ab (diff) |
ec/apple: Add ACPI code for Apple MacBooks
- Move ACPI code for Apple MacBooks to a separate directory to avoid
its duplication in mainboards
- Add AC and lid implementations for newer generations
- Rewrite old code using the new ASL syntax
Tested on MBA 5,2, MBP 8,1 and MBP 10,1.
Change-Id: I3d4585aac8e3ebbfed6ce4d4e39fbc33ac983069
Signed-off-by: Evgeny Zinoviev <me@ch1p.io>
Diffstat (limited to 'src/ec/apple/acpi/ec.asl')
-rw-r--r-- | src/ec/apple/acpi/ec.asl | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/ec/apple/acpi/ec.asl b/src/ec/apple/acpi/ec.asl new file mode 100644 index 0000000000..3adb7f6ab3 --- /dev/null +++ b/src/ec/apple/acpi/ec.asl @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Device(EC) +{ + Name(_HID, EISAID("PNP0C09")) + Name(_UID, 0) + + Name(_GPE, 0x17) + Mutex(ECLK, 0) + + OperationRegion(ERAM, EmbeddedControl, 0x00, 0x100) + + /* LID status change. */ + Method(_Q20, 0, NotSerialized) + { + Notify(LID, 0x80) + } + + /* AC status change. */ + Method(_Q21, 0, NotSerialized) + { + Notify(AC, 0x80) + } + + Method(_CRS, 0) + { + Name(ECMD, ResourceTemplate() + { + IO(Decode16, 0x62, 0x62, 1, 1) + IO(Decode16, 0x66, 0x66, 1, 1) + }) + Return(ECMD) + } + + Method(_PRW, 0, NotSerialized) + { + Return(Package () { 0x23, 0x04 }) + } + + Method(_INI, 0, NotSerialized) + { + } + +#include "battery.asl" +} |