Status: Maintained
- Version: 1.6.0
+ Version: 1.7.0
Download now ยป
@@ -19,7 +19,7 @@
-[![OpenCore](https://img.shields.io/badge/OpenCore-0.7.4-blue.svg)](https://github.com/acidanthera/OpenCorePkg)
+[![OpenCore](https://img.shields.io/badge/OpenCore-0.7.6-blue.svg)](https://github.com/acidanthera/OpenCorePkg)
![macOS-Stable](https://img.shields.io/badge/macOS-Monterey-brightgreen.svg)
![macOS-Stable](https://img.shields.io/badge/macOS-BigSur-brightgreen.svg)
![macOS-Stable](https://img.shields.io/badge/macOS-Catalina-brightgreen.svg)
@@ -37,7 +37,7 @@ Switch to develop branch ยป
See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "_ALS0", 0x00000000)
+{
+ Scope (_SB)
+ {
+ Device (ALS0)
+ {
+ Name (_HID, "ACPI0008" /* Ambient Light Sensor Device */) // _HID: Hardware ID
+ Name (_CID, "smc-als") // _CID: Compatible ID
+ Name (_ALI, 0x012C) // _ALI: Ambient Light Illuminance
+ Name (_ALR, Package (0x01) // _ALR: Ambient Light Response
+ {
+ Package (0x02)
+ {
+ 0x64,
+ 0x012C
+ }
+ })
+ Method (_STA, 0, NotSerialized) // _STA: Status
+ {
+ If (_OSI ("Darwin"))
+ {
+ Return (0x0F)
+ }
+ Else
+ {
+ Return (Zero)
+ }
+ }
+ }
+ }
+}
+
diff --git a/Source Code/SSDT-BATX.dsl b/Source Code/SSDT-BATX.dsl
new file mode 100644
index 0000000..e7cbe37
--- /dev/null
+++ b/Source Code/SSDT-BATX.dsl
@@ -0,0 +1,880 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "_BATX", 0x00010000)
+{
+ External (_SB_.PCI0.LPC_.EC__, DeviceObj)
+ External (_SB_.PCI0.LPC_.EC__.BAT0._HID, IntObj)
+ External (_SB_.PCI0.LPC_.EC__.BAT0._STA, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.BAT1._HID, IntObj)
+ External (_SB_.PCI0.LPC_.EC__.BAT1._STA, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.HIID, FieldUnitObj)
+ External (H8DR, FieldUnitObj)
+
+ Scope (\_SB.PCI0.LPC.EC)
+ {
+ OperationRegion (BRAM, EmbeddedControl, Zero, 0x0100)
+ Device (BATX)
+ {
+ Name (BDBG, Zero)
+ Name (BBIS, One)
+ Name (BDQP, Zero)
+ Mutex (BAXM, 0x00)
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0x38),
+ HB0S, 7,
+ HB0A, 1,
+ HB1S, 7,
+ HB1A, 1
+ }
+
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0xA0),
+ RC00, 8,
+ RC01, 8,
+ FC00, 8,
+ FC01, 8,
+ AE00, 8,
+ AE01, 8,
+ RS00, 8,
+ RS01, 8,
+ AC00, 8,
+ AC01, 8,
+ VO00, 8,
+ VO01, 8,
+ AF00, 8,
+ AF01, 8,
+ BS00, 8,
+ BS01, 8
+ }
+
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0xA0),
+ BM00, 8,
+ BM01, 8,
+ MD00, 8,
+ MD01, 8,
+ CC00, 8,
+ CC01, 8
+ }
+
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0xA0),
+ DC00, 8,
+ DC01, 8,
+ DV00, 8,
+ DV01, 8,
+ OM00, 8,
+ OM01, 8,
+ SI00, 8,
+ SI01, 8,
+ DT00, 8,
+ DT01, 8,
+ SN00, 8,
+ SN01, 8
+ }
+
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0xA0),
+ CH00, 8,
+ CH01, 8,
+ CH02, 8,
+ CH03, 8
+ }
+
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0xA0),
+ MN00, 8,
+ MN01, 8,
+ MN02, 8,
+ MN03, 8,
+ MN04, 8,
+ MN05, 8,
+ MN06, 8,
+ MN07, 8,
+ MN08, 8,
+ MN09, 8,
+ MN0A, 8,
+ MN0B, 8,
+ MN0C, 8,
+ MN0D, 8,
+ MN0E, 8,
+ MN0F, 8
+ }
+
+ Field (BRAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0xA0),
+ DN00, 8,
+ DN01, 8,
+ DN02, 8,
+ DN03, 8,
+ DN04, 8,
+ DN05, 8,
+ DN06, 8,
+ DN07, 8,
+ DN08, 8,
+ DN09, 8,
+ DN0A, 8,
+ DN0B, 8,
+ DN0C, 8,
+ DN0D, 8,
+ DN0E, 8,
+ DN0F, 8
+ }
+
+ Method (SBRC, 0, NotSerialized)
+ {
+ Return (B1B2 (RC00, RC01))
+ }
+
+ Method (SBFC, 0, NotSerialized)
+ {
+ Return (B1B2 (FC00, FC01))
+ }
+
+ Method (SBAE, 0, NotSerialized)
+ {
+ Return (B1B2 (AE00, AE01))
+ }
+
+ Method (SBRS, 0, NotSerialized)
+ {
+ Return (B1B2 (RS00, RS01))
+ }
+
+ Method (SBAC, 0, NotSerialized)
+ {
+ Return (B1B2 (AC00, AC01))
+ }
+
+ Method (SBVO, 0, NotSerialized)
+ {
+ Return (B1B2 (VO00, VO01))
+ }
+
+ Method (SBAF, 0, NotSerialized)
+ {
+ Return (B1B2 (AF00, AF01))
+ }
+
+ Method (SBBS, 0, NotSerialized)
+ {
+ Return (B1B2 (BS00, BS01))
+ }
+
+ Method (SBBM, 0, NotSerialized)
+ {
+ Return (B1B2 (BM00, BM01))
+ }
+
+ Method (SBMD, 0, NotSerialized)
+ {
+ Return (B1B2 (MD00, MD01))
+ }
+
+ Method (SBCC, 0, NotSerialized)
+ {
+ Return (B1B2 (CC00, CC01))
+ }
+
+ Method (SBDC, 0, NotSerialized)
+ {
+ Return (B1B2 (DC00, DC01))
+ }
+
+ Method (SBDV, 0, NotSerialized)
+ {
+ Return (B1B2 (DV00, DV01))
+ }
+
+ Method (SBOM, 0, NotSerialized)
+ {
+ Return (B1B2 (OM00, OM01))
+ }
+
+ Method (SBSI, 0, NotSerialized)
+ {
+ Return (B1B2 (SI00, SI01))
+ }
+
+ Method (SBDT, 0, NotSerialized)
+ {
+ Return (B1B2 (DT00, DT01))
+ }
+
+ Method (SBSN, 0, NotSerialized)
+ {
+ Return (ToDecimalString (B1B2 (SN00, SN01)))
+ }
+
+ Method (SBCH, 0, NotSerialized)
+ {
+ Return (ToString (B1B4 (CH00, CH01, CH02, CH03), Ones))
+ }
+
+ Method (SBMN, 0, NotSerialized)
+ {
+ Local0 = Buffer (0x10){}
+ Local0 [Zero] = MN00 /* \_SB_.PCI0.LPC_.EC__.BATX.MN00 */
+ Local0 [One] = MN01 /* \_SB_.PCI0.LPC_.EC__.BATX.MN01 */
+ Local0 [0x02] = MN02 /* \_SB_.PCI0.LPC_.EC__.BATX.MN02 */
+ Local0 [0x03] = MN03 /* \_SB_.PCI0.LPC_.EC__.BATX.MN03 */
+ Local0 [0x04] = MN04 /* \_SB_.PCI0.LPC_.EC__.BATX.MN04 */
+ Local0 [0x05] = MN05 /* \_SB_.PCI0.LPC_.EC__.BATX.MN05 */
+ Local0 [0x06] = MN06 /* \_SB_.PCI0.LPC_.EC__.BATX.MN06 */
+ Local0 [0x07] = MN07 /* \_SB_.PCI0.LPC_.EC__.BATX.MN07 */
+ Local0 [0x08] = MN08 /* \_SB_.PCI0.LPC_.EC__.BATX.MN08 */
+ Local0 [0x09] = MN09 /* \_SB_.PCI0.LPC_.EC__.BATX.MN09 */
+ Local0 [0x0A] = MN0A /* \_SB_.PCI0.LPC_.EC__.BATX.MN0A */
+ Local0 [0x0B] = MN0B /* \_SB_.PCI0.LPC_.EC__.BATX.MN0B */
+ Local0 [0x0C] = MN0C /* \_SB_.PCI0.LPC_.EC__.BATX.MN0C */
+ Local0 [0x0D] = MN0D /* \_SB_.PCI0.LPC_.EC__.BATX.MN0D */
+ Local0 [0x0E] = MN0E /* \_SB_.PCI0.LPC_.EC__.BATX.MN0E */
+ Local0 [0x0F] = MN0F /* \_SB_.PCI0.LPC_.EC__.BATX.MN0F */
+ Return (ToString (Local0, Ones))
+ }
+
+ Method (SBDN, 0, NotSerialized)
+ {
+ Local0 = Buffer (0x10){}
+ Local0 [Zero] = DN00 /* \_SB_.PCI0.LPC_.EC__.BATX.DN00 */
+ Local0 [One] = DN01 /* \_SB_.PCI0.LPC_.EC__.BATX.DN01 */
+ Local0 [0x02] = DN02 /* \_SB_.PCI0.LPC_.EC__.BATX.DN02 */
+ Local0 [0x03] = DN03 /* \_SB_.PCI0.LPC_.EC__.BATX.DN03 */
+ Local0 [0x04] = DN04 /* \_SB_.PCI0.LPC_.EC__.BATX.DN04 */
+ Local0 [0x05] = DN05 /* \_SB_.PCI0.LPC_.EC__.BATX.DN05 */
+ Local0 [0x06] = DN06 /* \_SB_.PCI0.LPC_.EC__.BATX.DN06 */
+ Local0 [0x07] = DN07 /* \_SB_.PCI0.LPC_.EC__.BATX.DN07 */
+ Local0 [0x08] = DN08 /* \_SB_.PCI0.LPC_.EC__.BATX.DN08 */
+ Local0 [0x09] = DN09 /* \_SB_.PCI0.LPC_.EC__.BATX.DN09 */
+ Local0 [0x0A] = DN0A /* \_SB_.PCI0.LPC_.EC__.BATX.DN0A */
+ Local0 [0x0B] = DN0B /* \_SB_.PCI0.LPC_.EC__.BATX.DN0B */
+ Local0 [0x0C] = DN0C /* \_SB_.PCI0.LPC_.EC__.BATX.DN0C */
+ Local0 [0x0D] = DN0D /* \_SB_.PCI0.LPC_.EC__.BATX.DN0D */
+ Local0 [0x0E] = DN0E /* \_SB_.PCI0.LPC_.EC__.BATX.DN0E */
+ Local0 [0x0F] = DN0F /* \_SB_.PCI0.LPC_.EC__.BATX.DN0F */
+ Return (ToString (Local0, Ones))
+ }
+
+ Method (B1B2, 2, NotSerialized)
+ {
+ Return ((Arg0 | (Arg1 << 0x08)))
+ }
+
+ Method (B1B4, 4, NotSerialized)
+ {
+ Local0 = (Arg2 | (Arg3 << 0x08))
+ Local0 = (Arg1 | (Local0 << 0x08))
+ Local0 = (Arg0 | (Local0 << 0x08))
+ Return (Local0)
+ }
+
+ Name (_HID, EisaId ("PNP0C0A") /* Control Method Battery */) // _HID: Hardware ID
+ Name (_UID, Zero) // _UID: Unique ID
+ Name (_PCL, Package (0x01) // _PCL: Power Consumer List
+ {
+ _SB
+ })
+ Method (_STA, 0, NotSerialized) // _STA: Status
+ {
+ Local0 = Zero
+ If (_OSI ("Darwin"))
+ {
+ If (CondRefOf (^^BAT1._STA))
+ {
+ If (CondRefOf (^^BAT0._STA))
+ {
+ Local0 = (^^BAT0._STA () | ^^BAT1._STA ())
+ }
+ Else
+ {
+ Local0 = ^^BAT1._STA ()
+ }
+ }
+ Else
+ {
+ Local0 = ^^BAT0._STA ()
+ }
+
+ If (\H8DR)
+ {
+ Return (Local0)
+ }
+ Else
+ {
+ Return (0x0F)
+ }
+ }
+
+ Return (Zero)
+ }
+
+ Method (_INI, 0, NotSerialized) // _INI: Initialize
+ {
+ If (_OSI ("Darwin"))
+ {
+ If (CondRefOf (^^BAT0._HID))
+ {
+ ^^BAT0._HID = Zero
+ }
+
+ If (CondRefOf (^^BAT1._HID))
+ {
+ ^^BAT1._HID = Zero
+ }
+ }
+ }
+
+ Name (PBIX, Package (0x15)
+ {
+ One,
+ One,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ One,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0x00017318,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0x03E8,
+ 0x01F4,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ "",
+ "",
+ "",
+ "",
+ Zero
+ })
+ Name (BX0I, Package (0x15){})
+ Name (BX1I, Package (0x15){})
+ Method (GBIX, 2, NotSerialized)
+ {
+ If ((Arg0 == 0x10))
+ {
+ Local4 = HB1S /* \_SB_.PCI0.LPC_.EC__.BATX.HB1S */
+ Local5 = HB1A /* \_SB_.PCI0.LPC_.EC__.BATX.HB1A */
+ }
+ Else
+ {
+ Local4 = HB0S /* \_SB_.PCI0.LPC_.EC__.BATX.HB0S */
+ Local5 = HB0A /* \_SB_.PCI0.LPC_.EC__.BATX.HB0A */
+ }
+
+ Local6 = 0x0A
+ Local7 = Zero
+ While ((!Local7 && Local6))
+ {
+ If (Local5)
+ {
+ If (((Local4 & 0x07) == 0x07))
+ {
+ Sleep (0x03E8)
+ Local6--
+ }
+ Else
+ {
+ Local7 = One
+ }
+ }
+ Else
+ {
+ Local6 = Zero
+ }
+ }
+
+ If ((Local7 != One))
+ {
+ Debug = "BATX:GBIX: !!!WARNING: Could not get battery-data in time. Giving up for now. - WARNING!!!"
+ Arg1 [0x02] = 0xFFFFFFFF
+ Arg1 [0x03] = 0xFFFFFFFF
+ Arg1 [0x06] = Zero
+ Arg1 [0x07] = Zero
+ Return (Arg1)
+ }
+
+ If (Acquire (BAXM, 0xFFFF))
+ {
+ Debug = "BATX:AcquireLock failed in GBIX"
+ Return (Arg1)
+ }
+
+ HIID = (Arg0 | One)
+ Arg1 [0x08] = SBCC ()
+ Local7 = SBBM ()
+ Local7 >>= 0x0F
+ Arg1 [One] = (Local7 ^ One)
+ HIID = Arg0
+ If (Local7)
+ {
+ Local1 = (SBFC () * 0x0A)
+ }
+ Else
+ {
+ Local1 = SBFC ()
+ }
+
+ Arg1 [0x03] = Local1
+ HIID = (Arg0 | 0x02)
+ If (Local7)
+ {
+ Local0 = (SBDC () * 0x0A)
+ }
+ Else
+ {
+ Local0 = SBDC ()
+ }
+
+ Arg1 [0x02] = Local0
+ Arg1 [0x06] = ((Local0 / 0x64) * 0x0A)
+ Arg1 [0x07] = ((Local0 / 0x64) * 0x05)
+ Arg1 [0x05] = SBDV ()
+ Arg1 [0x11] = SBSN ()
+ HIID = (Arg0 | 0x06)
+ Arg1 [0x10] = SBDN ()
+ HIID = (Arg0 | 0x04)
+ Arg1 [0x12] = SBCH ()
+ HIID = (Arg0 | 0x05)
+ Arg1 [0x13] = SBMN ()
+ Release (BAXM)
+ Return (Arg1)
+ }
+
+ Method (_BIX, 0, NotSerialized) // _BIX: Battery Information Extended
+ {
+ If ((BDBG == One))
+ {
+ Debug = "BATX:_BIX"
+ }
+
+ BX0I = GBIX (Zero, PBIX)
+ If ((HB0A && (BDBG == One)))
+ {
+ Concatenate ("BATX:BIXPowerUnit: BAT0 ", BX0I [One], Debug)
+ Concatenate ("BATX:BIXDesignCapacity: BAT0 ", ToDecimalString (DerefOf (BX0I [0x02])), Debug)
+ Concatenate ("BATX:BIXLastFullChargeCapacity: BAT0 ", ToDecimalString (DerefOf (BX0I [0x03])), Debug)
+ Concatenate ("BATX:BIXBatteryTechnology: BAT0 ", ToDecimalString (DerefOf (BX0I [0x04])), Debug)
+ Concatenate ("BATX:BIXDesignVoltage: BAT0 ", ToDecimalString (DerefOf (BX0I [0x05])), Debug)
+ Concatenate ("BATX:BIXDesignCapacityOfWarning: BAT0 ", ToDecimalString (DerefOf (BX0I [0x06])), Debug)
+ Concatenate ("BATX:BIXDesignCapacityOfLow: BAT0 ", ToDecimalString (DerefOf (BX0I [0x07])), Debug)
+ Concatenate ("BATX:BIXCycleCount: BAT0 ", ToDecimalString (DerefOf (BX0I [0x08])), Debug)
+ Concatenate ("BATX:BIXModelNumber: BAT0 ", DerefOf (BX0I [0x10]), Debug)
+ Concatenate ("BATX:BIXSerialNumber: BAT0 ", DerefOf (BX0I [0x11]), Debug)
+ Concatenate ("BATX:BIXBatteryType: BAT0 ", DerefOf (BX0I [0x12]), Debug)
+ Concatenate ("BATX:BIXOEMInformation: BAT0 ", DerefOf (BX0I [0x13]), Debug)
+ }
+
+ If (!HB1A)
+ {
+ Return (BX0I) /* \_SB_.PCI0.LPC_.EC__.BATX.BX0I */
+ }
+
+ BX1I = GBIX (0x10, PBIX)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BIXPowerUnit: BAT1 ", BX1I [One], Debug)
+ Concatenate ("BATX:BIXDesignCapacity: BAT1 ", ToDecimalString (DerefOf (BX1I [0x02])), Debug)
+ Concatenate ("BATX:BIXLastFullChargeCapacity: BAT1 ", ToDecimalString (DerefOf (BX1I [0x03])), Debug)
+ Concatenate ("BATX:BIXBatteryTechnology: BAT1 ", ToDecimalString (DerefOf (BX1I [0x04])), Debug)
+ Concatenate ("BATX:BIXDesignVoltage: BAT1 ", ToDecimalString (DerefOf (BX1I [0x05])), Debug)
+ Concatenate ("BATX:BIXDesignCapacityOfWarning: BAT1 ", ToDecimalString (DerefOf (BX1I [0x06])), Debug)
+ Concatenate ("BATX:BIXDesignCapacityOfLow: BAT1 ", ToDecimalString (DerefOf (BX1I [0x07])), Debug)
+ Concatenate ("BATX:BIXCycleCount: BAT1 ", ToDecimalString (DerefOf (BX1I [0x08])), Debug)
+ Concatenate ("BATX:BIXModelNumber: BAT1 ", DerefOf (BX1I [0x10]), Debug)
+ Concatenate ("BATX:BIXSerialNumber: BAT1 ", DerefOf (BX1I [0x11]), Debug)
+ Concatenate ("BATX:BIXBatteryType: BAT1 ", DerefOf (BX1I [0x12]), Debug)
+ Concatenate ("BATX:BIXOEMInformation: BAT1 ", DerefOf (BX1I [0x13]), Debug)
+ }
+
+ If (!HB0A)
+ {
+ Return (BX1I) /* \_SB_.PCI0.LPC_.EC__.BATX.BX1I */
+ }
+
+ If ((DerefOf (BX0I [One]) != DerefOf (BX1I [One]
+ )))
+ {
+ Debug = "BATX:BIXPowerUnit: !!!WARNING: PowerUnits differ between batteries. This case isn\'t handled in SSDT-BATX atm. Please report a bug - WARNING!!!"
+ }
+
+ Local0 = BX0I /* \_SB_.PCI0.LPC_.EC__.BATX.BX0I */
+ Local0 [0x02] = (DerefOf (BX0I [0x02]) + DerefOf (
+ BX1I [0x02]))
+ Local0 [0x03] = (DerefOf (BX0I [0x03]) + DerefOf (
+ BX1I [0x03]))
+ Local0 [0x05] = ((DerefOf (BX0I [0x05]) + DerefOf (
+ BX1I [0x05])) / 0x02)
+ Local0 [0x06] = (DerefOf (BX0I [0x06]) + DerefOf (
+ BX1I [0x06]))
+ Local0 [0x07] = (DerefOf (BX0I [0x07]) + DerefOf (
+ BX1I [0x07]))
+ Local0 [0x08] = ((DerefOf (BX0I [0x08]) + DerefOf (
+ BX1I [0x08])) / 0x02)
+ Local0 [0x10] = Concatenate (Concatenate (DerefOf (BX0I [0x10]),
+ " / "), DerefOf (BX1I [0x10]))
+ Local0 [0x11] = Concatenate (Concatenate (DerefOf (BX0I [0x11]),
+ " / "), DerefOf (BX1I [0x11]))
+ Local0 [0x12] = Concatenate (Concatenate (DerefOf (BX0I [0x12]),
+ " / "), DerefOf (BX1I [0x12]))
+ Local0 [0x13] = Concatenate (Concatenate (DerefOf (BX0I [0x13]),
+ " / "), DerefOf (BX1I [0x13]))
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BIXPowerUnit: BATX ", Local0 [One], Debug)
+ Concatenate ("BATX:BIXDesignCapacity: BATX ", ToDecimalString (DerefOf (Local0 [0x02])), Debug)
+ Concatenate ("BATX:BIXLastFullChargeCapacity: BATX ", ToDecimalString (DerefOf (Local0 [0x03])), Debug)
+ Concatenate ("BATX:BIXBatteryTechnology: BATX ", ToDecimalString (DerefOf (Local0 [0x04])), Debug)
+ Concatenate ("BATX:BIXDesignVoltage: BATX ", ToDecimalString (DerefOf (Local0 [0x05])), Debug)
+ Concatenate ("BATX:BIXDesignCapacityOfWarning: BATX ", ToDecimalString (DerefOf (Local0 [0x06])), Debug)
+ Concatenate ("BATX:BIXDesignCapacityOfLow: BATX ", ToDecimalString (DerefOf (Local0 [0x07])), Debug)
+ Concatenate ("BATX:BIXCycleCount: BATX ", ToDecimalString (DerefOf (Local0 [0x08])), Debug)
+ Concatenate ("BATX:BIXModelNumber: BATX ", DerefOf (Local0 [0x10]), Debug)
+ Concatenate ("BATX:BIXSerialNumber: BATX ", DerefOf (Local0 [0x11]), Debug)
+ Concatenate ("BATX:BIXBatteryType: BATX ", DerefOf (Local0 [0x12]), Debug)
+ Concatenate ("BATX:BIXOEMInformation: BATX ", DerefOf (Local0 [0x13]), Debug)
+ }
+
+ Return (Local0)
+ }
+
+ Name (PBST, Package (0x04)
+ {
+ Zero,
+ Zero,
+ Zero,
+ Zero
+ })
+ Name (BT0P, Package (0x04){})
+ Name (BT1P, Package (0x04){})
+ Method (GBST, 2, NotSerialized)
+ {
+ If (Acquire (BAXM, 0xFFFF))
+ {
+ Debug = "BATX:AcquireLock failed in GBST"
+ Return (Arg1)
+ }
+
+ If ((Arg0 == Zero))
+ {
+ Local6 = HB0S /* \_SB_.PCI0.LPC_.EC__.BATX.HB0S */
+ }
+ Else
+ {
+ Local6 = HB1S /* \_SB_.PCI0.LPC_.EC__.BATX.HB1S */
+ }
+
+ If ((Local6 & 0x20))
+ {
+ Local0 = 0x02
+ }
+ ElseIf ((Local6 & 0x40))
+ {
+ Local0 = One
+ }
+ Else
+ {
+ Local0 = Zero
+ }
+
+ HIID = (Arg0 | One)
+ Local7 = SBBM ()
+ Local7 >>= 0x0F
+ HIID = Arg0
+ Local2 = SBRC ()
+ If (Local7)
+ {
+ Local2 *= 0x0A
+ }
+
+ Local1 = SBAC ()
+ If ((Local0 == One))
+ {
+ If ((Local1 >= 0x8000))
+ {
+ Local1 = (0x00010000 - Local1)
+ }
+ }
+ Else
+ {
+ Local1 = Zero
+ }
+
+ Local3 = SBVO ()
+ If (Local7)
+ {
+ Local1 = ((Local1 * Local3) / 0x03E8)
+ }
+
+ Arg1 [Zero] = Local0
+ Arg1 [One] = Local1
+ Arg1 [0x02] = Local2
+ Arg1 [0x03] = Local3
+ Release (BAXM)
+ Return (Arg1)
+ }
+
+ Name (PBAI, Package (0x02)
+ {
+ 0xFF,
+ 0xFF
+ })
+ Method (_BST, 0, NotSerialized) // _BST: Battery Status
+ {
+ If ((BDBG == One))
+ {
+ Debug = "BATX:_BST()"
+ }
+
+ Local3 = DerefOf (PBAI [Zero])
+ Local4 = DerefOf (PBAI [One])
+ If (((Local3 != HB0A) || (Local4 != HB1A)))
+ {
+ PBAI [Zero] = HB0A /* \_SB_.PCI0.LPC_.EC__.BATX.HB0A */
+ PBAI [One] = HB1A /* \_SB_.PCI0.LPC_.EC__.BATX.HB1A */
+ If (((Local3 != 0xFF) || (Local4 != 0xFF)))
+ {
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:_BST() - PBAI:HB0A (old): ", Local3, Debug)
+ Concatenate ("BATX:_BST() - PBAI:HB1A (old): ", Local4, Debug)
+ Concatenate ("BATX:_BST() - PBAI:HB0A (new): ", HB0A, Debug)
+ Concatenate ("BATX:_BST() - PBAI:HB1A (new): ", HB1A, Debug)
+ }
+
+ Notify (BATX, 0x81) // Information Change
+ }
+ }
+
+ If (HB0A)
+ {
+ BT0P = GBST (Zero, PBST)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BSTState: BAT0 (acpi) - ", HB0S, Debug)
+ Concatenate ("BATX:BSTState: BAT0 ", DerefOf (BT0P [Zero]), Debug)
+ Concatenate ("BATX:BSTPresentRate: BAT0 ", ToDecimalString (DerefOf (BT0P [One])), Debug)
+ Concatenate ("BATX:BSTRemainingCapacity: BAT0 ", ToDecimalString (DerefOf (BT0P [0x02])), Debug)
+ Concatenate ("BATX:BSTPresentVoltage: BAT0 ", ToDecimalString (DerefOf (BT0P [0x03])), Debug)
+ }
+
+ If (!HB1A)
+ {
+ Return (BT0P) /* \_SB_.PCI0.LPC_.EC__.BATX.BT0P */
+ }
+ }
+
+ BT1P = GBST (0x10, PBST)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BSTState: BAT1 (acpi) - ", HB1S, Debug)
+ Concatenate ("BATX:BSTState: BAT1 ", DerefOf (BT1P [Zero]), Debug)
+ Concatenate ("BATX:BSTPresentRate: BAT1 ", ToDecimalString (DerefOf (BT1P [One])), Debug)
+ Concatenate ("BATX:BSTRemainingCapacity: BAT1 ", ToDecimalString (DerefOf (BT1P [0x02])), Debug)
+ Concatenate ("BATX:BSTPresentVoltage: BAT1 ", ToDecimalString (DerefOf (BT1P [0x03])), Debug)
+ }
+
+ If (!HB0A)
+ {
+ Return (BT1P) /* \_SB_.PCI0.LPC_.EC__.BATX.BT1P */
+ }
+
+ Local0 = BT0P /* \_SB_.PCI0.LPC_.EC__.BATX.BT0P */
+ Local4 = DerefOf (BT0P [Zero])
+ Local5 = DerefOf (BT1P [Zero])
+ Local0 [Zero] = Zero
+ If (((Local4 == 0x02) || (Local5 == 0x02)))
+ {
+ Local0 [Zero] = 0x02
+ }
+ ElseIf (((Local4 == One) || (Local5 == One)))
+ {
+ Local0 [Zero] = One
+ }
+
+ Local0 [One] = (DerefOf (BT0P [One]) + DerefOf (
+ BT1P [One]))
+ Local0 [0x02] = (DerefOf (BT0P [0x02]) + DerefOf (
+ BT1P [0x02]))
+ Local0 [0x03] = ((DerefOf (BT0P [0x03]) + DerefOf (
+ BT1P [0x03])) / 0x02)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BSTState: BATX ", DerefOf (Local0 [Zero]), Debug)
+ Concatenate ("BATX:BSTPresentRate: BATX ", ToDecimalString (DerefOf (Local0 [One])), Debug)
+ Concatenate ("BATX:BSTRemainingCapacity: BATX ", ToDecimalString (DerefOf (Local0 [0x02])), Debug)
+ Concatenate ("BATX:BSTPresentVoltage: BATX ", ToDecimalString (DerefOf (Local0 [0x03])), Debug)
+ }
+
+ Return (Local0)
+ }
+
+ If (BBIS)
+ {
+ Name (PBSS, Package (0x07)
+ {
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF
+ })
+ Name (PBS0, Package (0x07){})
+ Name (PBS1, Package (0x07){})
+ Method (GBSS, 2, NotSerialized)
+ {
+ If (Acquire (BAXM, 0xFFFF))
+ {
+ Debug = "BATX:AcquireLock failed in GBSS"
+ Return (PBSS) /* \_SB_.PCI0.LPC_.EC__.BATX.PBSS */
+ }
+
+ HIID = Arg0
+ Local6 = SBAF ()
+ If ((Local6 == 0xFFFF))
+ {
+ Local6 = Zero
+ }
+
+ Arg1 [One] = Local6
+ Local6 = SBAE ()
+ If ((Local6 == 0xFFFF))
+ {
+ Local6 = Zero
+ }
+
+ Arg1 [0x02] = Local6
+ Arg1 [0x03] = SBRS ()
+ Arg1 [0x04] = SBAC ()
+ Arg1 [Zero] = 0x0BD7
+ Release (BAXM)
+ Return (Arg1)
+ }
+
+ Method (CBSS, 0, NotSerialized)
+ {
+ If ((BDBG == One))
+ {
+ Debug = "BATX:CBSS()"
+ }
+
+ If (HB0A)
+ {
+ PBS0 = GBSS (Zero, PBSS)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BSSTimeToFull: BAT0 ", ToDecimalString (DerefOf (PBS0 [One])), Debug)
+ Concatenate ("BATX:BSSTimeToEmpty: BAT0 ", ToDecimalString (DerefOf (PBS0 [0x02])), Debug)
+ Concatenate ("BATX:BSSChargeLevel: BAT0 ", ToDecimalString (DerefOf (PBS0 [0x03])), Debug)
+ Concatenate ("BATX:BSSAverageRate: BAT0 ", ToDecimalString (DerefOf (PBS0 [0x04])), Debug)
+ }
+
+ If (!HB1A)
+ {
+ Return (PBS0) /* \_SB_.PCI0.LPC_.EC__.BATX.PBS0 */
+ }
+ }
+
+ PBS1 = GBSS (0x10, PBSS)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BSSTimeToFull: BAT1 ", ToDecimalString (DerefOf (PBS1 [One])), Debug)
+ Concatenate ("BATX:BSSTimeToEmpty: BAT1 ", ToDecimalString (DerefOf (PBS1 [0x02])), Debug)
+ Concatenate ("BATX:BSSChargeLevel: BAT1 ", ToDecimalString (DerefOf (PBS1 [0x03])), Debug)
+ Concatenate ("BATX:BSSAverageRate: BAT1 ", ToDecimalString (DerefOf (PBS1 [0x04])), Debug)
+ }
+
+ If (!HB0A)
+ {
+ Return (PBS1) /* \_SB_.PCI0.LPC_.EC__.BATX.PBS1 */
+ }
+
+ Local0 = PBS0 /* \_SB_.PCI0.LPC_.EC__.BATX.PBS0 */
+ Local0 [One] = (DerefOf (PBS0 [One]) + DerefOf (
+ PBS1 [One]))
+ Local0 [0x02] = (DerefOf (PBS0 [0x02]) + DerefOf (
+ PBS1 [0x02]))
+ Local0 [0x03] = ((DerefOf (PBS0 [0x03]) + DerefOf (
+ PBS1 [0x03])) / 0x02)
+ Local0 [0x04] = (DerefOf (PBS0 [0x04]) + DerefOf (
+ PBS1 [0x04]))
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:BSSTimeToFull: BATX ", ToDecimalString (DerefOf (Local0 [One])), Debug)
+ Concatenate ("BATX:BSSTimeToEmpty: BATX ", ToDecimalString (DerefOf (Local0 [0x02])), Debug)
+ Concatenate ("BATX:BSSChargeLevel: BATX ", ToDecimalString (DerefOf (Local0 [0x03])), Debug)
+ Concatenate ("BATX:BSSAverageRate: BATX ", ToDecimalString (DerefOf (Local0 [0x04])), Debug)
+ }
+
+ Return (Local0)
+ }
+
+ Name (PBIS, Package (0x07)
+ {
+ 0x007F007F,
+ 0xFFFFFFFF,
+ 0x2342,
+ 0x2342,
+ 0x2342,
+ 0x2342,
+ 0x2342
+ })
+ Method (CBIS, 0, NotSerialized)
+ {
+ If ((BDQP == One))
+ {
+ PBIS [Zero] = 0x006F007F
+ }
+
+ If ((BDBG == One))
+ {
+ Debug = "BATX:CBIS()"
+ }
+
+ If (Acquire (BAXM, 0xFFFF))
+ {
+ Debug = "BATX:AcquireLock failed in CBIS"
+ Return (PBIS) /* \_SB_.PCI0.LPC_.EC__.BATX.PBIS */
+ }
+
+ If (!HB0A)
+ {
+ Debug = "BATX:CBIS - Error HB0A not ready yet. Returning defaults."
+ Return (PBIS) /* \_SB_.PCI0.LPC_.EC__.BATX.PBIS */
+ }
+
+ HIID = 0x02
+ PBIS [One] = SBDT ()
+ Local6 = ToDecimalString (SBSN ())
+ PBIS [0x02] = Local6
+ PBIS [0x03] = Local6
+ PBIS [0x04] = Local6
+ PBIS [0x05] = Local6
+ PBIS [0x06] = Local6
+ Release (BAXM)
+ If ((BDBG == One))
+ {
+ Concatenate ("BATX:CBIS:BISConfig BATX ", PBIS [Zero], Debug)
+ Concatenate ("BATX:CBIS:BISManufactureDate BATX ", PBIS [One], Debug)
+ Concatenate ("BATX:CBIS:BISPackLotCode BATX ", PBIS [0x02], Debug)
+ }
+
+ Return (PBIS) /* \_SB_.PCI0.LPC_.EC__.BATX.PBIS */
+ }
+ }
+ }
+ }
+}
+
diff --git a/Source Code/SSDT-DEHCI.dsl b/Source Code/SSDT-DEHCI.dsl
new file mode 100644
index 0000000..47af15d
--- /dev/null
+++ b/Source Code/SSDT-DEHCI.dsl
@@ -0,0 +1,28 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "_DEHCI", 0x00001000)
+{
+ Scope (\)
+ {
+ OperationRegion (RCRG, SystemMemory, 0xFED1F418, One)
+ Field (RCRG, DWordAcc, Lock, Preserve)
+ {
+ , 13,
+ EH2D, 1,
+ , 1,
+ EH1D, 1
+ }
+
+ Method (_INI, 0, NotSerialized) // _INI: Initialize
+ {
+ If (_OSI ("Darwin"))
+ {
+ EH1D = One
+ EH2D = One
+ }
+ }
+ }
+}
+
diff --git a/Source Code/SSDT-ECRW.dsl b/Source Code/SSDT-ECRW.dsl
new file mode 100644
index 0000000..cce28a0
--- /dev/null
+++ b/Source Code/SSDT-ECRW.dsl
@@ -0,0 +1,67 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "ECRW", 0x00000000)
+{
+ External (_SB_.PCI0.LPC_.EC__, DeviceObj)
+
+ Scope (_SB.PCI0.LPC.EC)
+ {
+ Method (RE1B, 1, NotSerialized)
+ {
+ OperationRegion (ERAM, EmbeddedControl, Arg0, One)
+ Field (ERAM, ByteAcc, NoLock, Preserve)
+ {
+ BYTE, 8
+ }
+
+ Return (BYTE) /* \_SB_.PCI0.LPC_.EC__.RE1B.BYTE */
+ }
+
+ Method (RECB, 2, Serialized)
+ {
+ Arg1 = ((Arg1 + 0x07) >> 0x03)
+ Name (TEMP, Buffer (Arg1){})
+ Arg1 += Arg0
+ Local0 = Zero
+ While ((Arg0 < Arg1))
+ {
+ TEMP [Local0] = RE1B (Arg0)
+ Arg0++
+ Local0++
+ }
+
+ Return (TEMP) /* \_SB_.PCI0.LPC_.EC__.RECB.TEMP */
+ }
+
+ Method (WE1B, 2, NotSerialized)
+ {
+ OperationRegion (ERAM, EmbeddedControl, Arg0, One)
+ Field (ERAM, ByteAcc, NoLock, Preserve)
+ {
+ BYTE, 8
+ }
+
+ BYTE = Arg1
+ }
+
+ Method (WECB, 3, Serialized)
+ {
+ Arg1 = ((Arg1 + 0x07) >> 0x03)
+ Name (TEMP, Buffer (Arg1){})
+ TEMP = Arg2
+ Arg1 += Arg0
+ Local0 = Zero
+ While ((Arg0 < Arg1))
+ {
+ WE1B (Arg0, DerefOf (TEMP [Local0]))
+ Arg0++
+ Local0++
+ }
+ }
+ }
+}
+
+
+
diff --git a/Source Code/SSDT-HPET.dsl b/Source Code/SSDT-HPET.dsl
index 7649346..7a150cb 100644
--- a/Source Code/SSDT-HPET.dsl
+++ b/Source Code/SSDT-HPET.dsl
@@ -1,10 +1,11 @@
-//
-// Supplementary HPET _CRS from Goldfish64
-// Requires the HPET's _CRS to XCRS rename
-//
-// Modified by valnoxy
-// Designed for T440p -> https://github.com/valnoxy/t440p-oc
-//
+/*
+ * Supplementary HPET _CRS from Goldfish64
+ * Requires the HPET's _CRS to XCRS rename
+ *
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+
DefinitionBlock ("", "SSDT", 2, "CORP", "HPET", 0x00000000)
{
External (\_SB.PCI0.LPC, DeviceObj) // (from opcode)
diff --git a/Source Code/SSDT-KBD.dsl b/Source Code/SSDT-KBD.dsl
new file mode 100644
index 0000000..92c8ebf
--- /dev/null
+++ b/Source Code/SSDT-KBD.dsl
@@ -0,0 +1,268 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "_KBD", 0x00000000)
+{
+ External (_SB_.PCI0.LPC_.EC__, DeviceObj)
+ External (_SB_.PCI0.LPC_.EC__.HKEY.MLCS, MethodObj) // 1 Arguments
+ External (_SB_.PCI0.LPC_.EC__.HKEY.MMTS, MethodObj) // 1 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ14, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ15, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ16, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ1F, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ64, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ66, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ67, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ68, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ69, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.EC__.XQ6A, MethodObj) // 0 Arguments
+ External (_SB_.PCI0.LPC_.KBD_, DeviceObj)
+
+ Scope (_SB.PCI0.LPC.EC)
+ {
+ Method (_Q14, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (KBD, 0x0406)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ14 ()
+ }
+ }
+
+ Method (_Q15, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (KBD, 0x0405)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ15 ()
+ }
+ }
+
+ Name (LED1, Zero)
+ Method (_Q6A, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ If ((LED1 == Zero))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x0136)
+ Notify (\_SB.PCI0.LPC.KBD, 0x036B)
+ Notify (\_SB.PCI0.LPC.KBD, 0x01B6)
+ \_SB.PCI0.LPC.EC.HKEY.MMTS (0x02)
+ LED1 = One
+ }
+ Else
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x012A)
+ Notify (\_SB.PCI0.LPC.KBD, 0x036B)
+ Notify (\_SB.PCI0.LPC.KBD, 0x01AA)
+ \_SB.PCI0.LPC.EC.HKEY.MMTS (Zero)
+ LED1 = Zero
+ }
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ6A ()
+ }
+ }
+
+ Method (_Q16, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (KBD, 0x0367)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ16 ()
+ }
+ }
+
+ Method (_Q64, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (KBD, 0x0368)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ64 ()
+ }
+ }
+
+ Method (_Q66, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (KBD, 0x0369)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ66 ()
+ }
+ }
+
+ Method (_Q67, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x0138)
+ Notify (\_SB.PCI0.LPC.KBD, 0x0339)
+ Notify (\_SB.PCI0.LPC.KBD, 0x01B8)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ67 ()
+ }
+ }
+
+ Method (_Q68, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x011D)
+ Notify (\_SB.PCI0.LPC.KBD, 0x0448)
+ Notify (\_SB.PCI0.LPC.KBD, 0x019D)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ68 ()
+ }
+ }
+
+ Method (_Q69, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x036A)
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ69 ()
+ }
+ }
+
+ Name (LED2, Zero)
+ Method (_Q1F, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
+ {
+ If (_OSI ("Darwin"))
+ {
+ If ((LED2 == Zero))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x0136)
+ Notify (\_SB.PCI0.LPC.KBD, 0x0367)
+ Notify (\_SB.PCI0.LPC.KBD, 0x01B6)
+ \_SB.PCI0.LPC.EC.HKEY.MLCS (One)
+ LED2 = One
+ }
+ ElseIf ((LED2 == One))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x012A)
+ Notify (\_SB.PCI0.LPC.KBD, 0x036A)
+ Notify (\_SB.PCI0.LPC.KBD, 0x01AA)
+ \_SB.PCI0.LPC.EC.HKEY.MLCS (0x02)
+ LED2 = 0x02
+ }
+ ElseIf ((LED2 == 0x02))
+ {
+ Notify (\_SB.PCI0.LPC.KBD, 0x012A)
+ Notify (\_SB.PCI0.LPC.KBD, 0x0367)
+ Notify (\_SB.PCI0.LPC.KBD, 0x01AA)
+ \_SB.PCI0.LPC.EC.HKEY.MLCS (Zero)
+ LED2 = Zero
+ }
+ Else
+ {
+ \_SB.PCI0.LPC.EC.XQ1F ()
+ }
+ }
+ }
+ }
+
+ Scope (_SB.PCI0.LPC.KBD)
+ {
+ Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
+ {
+ If (!Arg2)
+ {
+ Return (Buffer (One)
+ {
+ 0x03 // .
+ })
+ }
+
+ Return (Package (0x04)
+ {
+ "RM,oem-id",
+ "LENOVO",
+ "RM,oem-table-id",
+ "Thinkpad_Clickpad"
+ })
+ }
+
+ Name (RMCF, Package (0x04)
+ {
+ "Synaptics TouchPad",
+ Package (0x26)
+ {
+ "BogusDeltaThreshX",
+ 0x0320,
+ "BogusDeltaThreshY",
+ 0x0320,
+ "Clicking",
+ ">y",
+ "DragLockTempMask",
+ 0x00040004,
+ "DynamicEWMode",
+ ">n",
+ "FakeMiddleButton",
+ ">n",
+ "HWResetOnStart",
+ ">y",
+ "PalmNoAction When Typing",
+ ">y",
+ "ScrollResolution",
+ 0x0320,
+ "SmoothInput",
+ ">y",
+ "UnsmoothInput",
+ ">y",
+ "Thinkpad",
+ ">y",
+ "EdgeBottom",
+ Zero,
+ "FingerZ",
+ 0x1E,
+ "MaxTapTime",
+ 0x05F5E100,
+ "MouseMultiplierX",
+ 0x02,
+ "MouseMultiplierY",
+ 0x02,
+ "MouseScrollMultiplierX",
+ 0x02,
+ "MouseScrollMultiplierY",
+ 0x02
+ },
+
+ "Keyboard",
+ Package (0x02)
+ {
+ "Custom PS2 Map",
+ Package (0x02)
+ {
+ Package (0x00){},
+ "e037=64"
+ }
+ }
+ })
+ }
+}
+
diff --git a/Source Code/SSDT-LED.dsl b/Source Code/SSDT-LED.dsl
new file mode 100644
index 0000000..d81c3cf
--- /dev/null
+++ b/Source Code/SSDT-LED.dsl
@@ -0,0 +1,25 @@
+// Fix LED and Power Button blink after wake from sleep for Lenovo Thinkpads:
+// X240, T440, T440P, T440S, T540P, L450, T450 etc
+// Credits: Rehabman, vit9696, Sniki
+
+#ifndef NO_DEFINITIONBLOCK
+DefinitionBlock("", "SSDT", 2, "T440", "_LED", 0)
+{
+#endif
+ External(ZWAK, MethodObj)
+ External(_SI._SST, MethodObj)
+
+ // In DSDT, native _WAK is renamed ZWAK
+ // As a result, calls to this method land here.
+ Method(_WAK, 1)
+ {
+ If (Arg0 = 3)
+ {
+ \_SI._SST(One)
+ }
+ // call into original _WAK method
+ Return (ZWAK(Arg0))
+ }
+#ifndef NO_DEFINITIONBLOCK
+}
+#endif
\ No newline at end of file
diff --git a/Source Code/SSDT-MCHC.dsl b/Source Code/SSDT-MCHC.dsl
new file mode 100644
index 0000000..2679dd7
--- /dev/null
+++ b/Source Code/SSDT-MCHC.dsl
@@ -0,0 +1,24 @@
+DefinitionBlock ("", "SSDT", 2, "T440P", "_MCHC", 0x00000000)
+{
+ External (_SB_.PCI0, DeviceObj)
+
+ Scope (_SB.PCI0)
+ {
+ Device (MCHC)
+ {
+ Name (_ADR, Zero) // _ADR: Address
+ Method (_STA, 0, NotSerialized) // _STA: Status
+ {
+ If (_OSI ("Darwin"))
+ {
+ Return (0x0F)
+ }
+ Else
+ {
+ Return (Zero)
+ }
+ }
+ }
+ }
+}
+
diff --git a/Source Code/SSDT-PWRB.dsl b/Source Code/SSDT-PWRB.dsl
new file mode 100644
index 0000000..944284f
--- /dev/null
+++ b/Source Code/SSDT-PWRB.dsl
@@ -0,0 +1,13 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "_PWRB", 0x00000000)
+{
+ External (_SB_.PWRB, DeviceObj)
+
+ Device (_SB.PWRB)
+ {
+ Name (_HID, EisaId ("PNP0C0C") /* Power Button Device */) // _HID: Hardware ID
+ }
+}
diff --git a/Source Code/SSDT-SMBUS.dsl b/Source Code/SSDT-SMBUS.dsl
new file mode 100644
index 0000000..0a6d3f3
--- /dev/null
+++ b/Source Code/SSDT-SMBUS.dsl
@@ -0,0 +1,51 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "SMBUS", 0x00000000)
+{
+ External (_SB_.PCI0.SMBU, DeviceObj)
+
+ Scope (_SB.PCI0.SMBU)
+ {
+ Device (BUS0)
+ {
+ Name (_CID, "smbus") // _CID: Compatible ID
+ Name (_ADR, Zero) // _ADR: Address
+ Device (DVL0)
+ {
+ Name (_ADR, 0x57) // _ADR: Address
+ Name (_CID, "diagsvault") // _CID: Compatible ID
+ Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
+ {
+ If (!Arg2)
+ {
+ Return (Buffer (One)
+ {
+ 0x03 // .
+ })
+ }
+
+ Return (Package (0x02)
+ {
+ "address",
+ 0x57
+ })
+ }
+ }
+
+ Method (_STA, 0, NotSerialized) // _STA: Status
+ {
+ If (_OSI ("Darwin"))
+ {
+ Return (0x0F)
+ }
+ Else
+ {
+ Return (Zero)
+ }
+ }
+ }
+ }
+}
+
diff --git a/Source Code/SSDT-THINK.dsl b/Source Code/SSDT-THINK.dsl
new file mode 100644
index 0000000..9d8f2d7
--- /dev/null
+++ b/Source Code/SSDT-THINK.dsl
@@ -0,0 +1,97 @@
+/*
+ * Designed for T440p -> See https://github.com/valnoxy/t440p-oc
+ * Alpha - Do not use in production.
+ */
+
+DefinitionBlock ("", "SSDT", 2, "T440P", "Think", 0x00000000)
+{
+ External (_SB.PCI0.LPCB.EC, DeviceObj) // EC path
+ External (_SB.PCI0.LPCB.EC.HKEY, DeviceObj) // HKEY path
+ External (_SB.PCI0.LPCB.EC.HFSP, FieldUnitObj) // Fan control register
+ External (_SB.PCI0.LPCB.EC.HFNI, FieldUnitObj) // Fan control register
+ External (_SB.PCI0.LPCB.EC.VRST, FieldUnitObj) // Second fan switch register
+ External (_SI._SST, MethodObj) // Indicator
+ External (LNUX, IntObj) // Variable set with "Linux" or "FreeBSD"
+ External (WNTF, IntObj) // Variable set with "Windows 2001" or "Microsoft Windows NT"
+
+ Scope (\)
+ {
+ If (_OSI ("Darwin"))
+ {
+ // Initialze mute button mode like Linux when it's broken, may be combined with MuteLEDFixup in prefpane.
+ LNUX = 0x01
+ // Enable DYTC thermal-management on newer Thinkpads. Please check \_SB.PCI0.LPCB.EC.HKEY.DYTC()
+ WNTF = 0x01
+ }
+ }
+
+ /*
+ * Optional: Route to customized LED pattern or origin _SI._SST if differ from built in pattern.
+ */
+ Scope (\_SB.PCI0.LPCB.EC.HKEY)
+ {
+ // Proxy-method to interface with \_SI._SST in YogaSMC
+ Method (CSSI, 1, NotSerialized)
+ {
+ \_SI._SST (Arg0)
+ }
+ }
+
+ /*
+ * Optional: Sensor access
+ *
+ * Double check name of FieldUnit for collision
+ * Registers return 0x00 for non-implemented,
+ * and return 0x80 when not available.
+ */
+ Scope (_SB.PCI0.LPCB.EC)
+ {
+ OperationRegion (ESEN, EmbeddedControl, Zero, 0x0100)
+ Field (ESEN, ByteAcc, Lock, Preserve)
+ {
+ // TP_EC_THERMAL_TMP0
+ Offset (0x78),
+ EST0, 8, // CPU
+ EST1, 8,
+ EST2, 8,
+ EST3, 8, // GPU ?
+ EST4, 8, // Battery ?
+ EST5, 8, // Battery ?
+ EST6, 8, // Battery ?
+ EST7, 8, // Battery ?
+
+ // TP_EC_THERMAL_TMP8
+ Offset (0xC0),
+ EST8, 8,
+ EST9, 8,
+ ESTA, 8,
+ ESTB, 8,
+ ESTC, 8,
+ ESTD, 8,
+ ESTE, 8,
+ ESTF, 8
+ }
+ }
+
+ /*
+ * Deprecated: Write access to fan control register
+ */
+ Scope (\_SB.PCI0.LPCB.EC.HKEY)
+ {
+ Method (CFSP, 1, NotSerialized)
+ {
+ \_SB.PCI0.LPCB.EC.HFSP = Arg0
+ }
+
+ Method (CFNI, 1, NotSerialized)
+ {
+ \_SB.PCI0.LPCB.EC.HFNI = Arg0
+ }
+
+ Method (CRST, 1, NotSerialized)
+ {
+ \_SB.PCI0.LPCB.EC.VRST = Arg0
+ }
+ }
+}
+