Skip to content

Commit

Permalink
Fixed battery status red indicator issue, remove some code in BTST me…
Browse files Browse the repository at this point in the history
…thod that access the second variable of NBST.
  • Loading branch information
kreizlie committed Jul 28, 2020
1 parent d4bbc0b commit 7340559
Show file tree
Hide file tree
Showing 22 changed files with 143 additions and 22 deletions.
Empty file modified EFI/OC/ACPI/SSDT-ALS0.aml
100755 → 100644
Empty file.
Binary file modified EFI/OC/ACPI/SSDT-BATT.aml
100755 → 100644
Binary file not shown.
Empty file modified EFI/OC/ACPI/SSDT-DMAC.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-FREQ.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-GPIO.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-GPRW.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-HPE0.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-MCHC.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-MEM2.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-PMCR.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-PNLF.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-PPMC.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-PWRB.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-RTC0.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-SBUS.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-SLPB.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-TIM0.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-XOSI.aml
100755 → 100644
Empty file.
Empty file modified EFI/OC/ACPI/SSDT-XSPI.aml
100755 → 100644
Empty file.
73 changes: 73 additions & 0 deletions USB-hotpatch/SSDT-UIAC.dsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// SSDT UIAC
DefinitionBlock ("", "SSDT", 2, "ACDT", "UIAC", 0)
{
Device (UIAC)
{
Name (_HID, "UIA00000")

Name (RMCF, Package ()
{
// XHC (8086_9d2f)
"XHC", Package ()
{
"port-count", Buffer () { 0x0F, 0x00, 0x00, 0x00 },
"ports", Package ()
{
"HS01", Package ()
{
"name", Buffer () { "HS01" },
"UsbConnector", 0,
"port", Buffer () { 0x01, 0x00, 0x00, 0x00 },
},

"HS04", Package ()
{
"name", Buffer () { "HS04" },
"UsbConnector", 0,
"port", Buffer () { 0x04, 0x00, 0x00, 0x00 },
},

"HS06", Package ()
{
"name", Buffer () { "HS06" },
"UsbConnector", 255,
"port", Buffer () { 0x06, 0x00, 0x00, 0x00 },
},

"SS01", Package ()
{
"name", Buffer () { "SS01" },
"UsbConnector", 3,
"port", Buffer () { 0x0D, 0x00, 0x00, 0x00 },
},

"SS02", Package ()
{
"name", Buffer () { "SS02" },
"UsbConnector", 10,
"port", Buffer () { 0x0E, 0x00, 0x00, 0x00 },
},

"SS03", Package ()
{
"name", Buffer () { "SS03" },
"UsbConnector", 3,
"port", Buffer () { 0x0F, 0x00, 0x00, 0x00 },
},
},
},
})

Method (_STA, 0, NotSerialized)
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
}
46 changes: 46 additions & 0 deletions USB-hotpatch/SSDT-USBX.dsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SSDT USBX
DefinitionBlock ("", "SSDT", 2, "ACDT", "USBX", 0)
{
Scope (_SB)
{
Device (USBX)
{
Name (_ADR, Zero) // _ADR: Address

Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If ((Arg2 == Zero))
{
Return (Buffer (One)
{
0x03
})
}

Return (Package (0x08)
{
"kUSBSleepPowerSupply",
0x13EC,
"kUSBSleepPortCurrentLimit",
0x0834,
"kUSBWakePowerSupply",
0x13EC,
"kUSBWakePortCurrentLimit",
0x0834
})
}

Method (_STA, 0, NotSerialized)
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
}
}
46 changes: 24 additions & 22 deletions hotpatch/SSDT-BATT.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -456,29 +456,31 @@ DefinitionBlock ("", "SSDT", 2, "ACDT", "BATT", 0)
}

Store (Local0, Index (DerefOf (Index (NBST, Arg0)), Zero))
If (And (Local0, One))
{
If (LOr (LLess (Local3, 0x0190), LGreater (Local3, 0x1964)))
{
Store (DerefOf (Index (DerefOf (Index (NBST, Arg0)), One)), Local5)
If (LOr (LLess (Local5, 0x0190), LGreater (Local5, 0x1964)))
{
Store (0x0D7A, Local3)
}
Else
{
Store (Local5, Local3)
}
}

Store (0xFFFFFFFF, Local3)
}
ElseIf (LEqual (And (Local0, 0x02), Zero))
{
Store (Zero, Local3)
}

//If (And (Local0, One))
//{
// If (LOr (LLess (Local3, 0x0190), LGreater (Local3, 0x1964)))
// {
// Store (DerefOf (Index (DerefOf (Index (NBST, Arg0)), One)), Local5)
// If (LOr (LLess (Local5, 0x0190), LGreater (Local5, 0x1964)))
// {
// Store (0x0D7A, Local3)
// }
// Else
// {
// Store (Local5, Local3)
// }
// }
//
// Store (0xFFFFFFFF, Local3)
//}
//ElseIf (LEqual (And (Local0, 0x02), Zero))
//{
// Store (Zero, Local3)
//}

Store (Zero, Local3)
Store (Local3, Index (DerefOf (Index (NBST, Arg0)), One))

Acquire (BTMX, 0xFFFF)
And (NGBT, Not (Local7), NGBT)
Release (BTMX)
Expand Down

0 comments on commit 7340559

Please sign in to comment.