AppleALC — dynamic AppleHDA patching

I tried again and I saw that it doesn't deactivate HPET but creates HPE0. In IORegistry I have both HPET and HPE0 This is my ORIGINAL RTC-TMR-HPET from DSDT: Device (RTC) { Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */) // _HID: Hardware ID Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0070, // Range Minimum 0x0070, // Range Maximum 0x01, // Alignment 0x02, // Length ) IO (Decode16, 0x0074, // Range Minimum 0x0074, // Range Maximum 0x01, // Alignment 0x04, // Length ) IRQNoFlags () {8} }) } Device (TMR) { Name (_HID, EisaId ("PNP0100") /* PC-class System Timer */) // _HID: Hardware ID Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0040, // Range Minimum 0x0040, // Range Maximum 0x01, // Alignment 0x04, // Length ) IO (Decode16, 0x0050, // Range Minimum 0x0050, // Range Maximum 0x01, // Alignment 0x04, // Length ) IRQNoFlags () {0} }) } Device (HPET) { Name (_HID, EisaId ("PNP0103") /* HPET System Timer */) // _HID: Hardware ID OperationRegion (HPTC, SystemMemory, 0xFED1F404, 0x04) Field (HPTC, DWordAcc, NoLock, Preserve) { HPTS, 2, , 5, HPTE, 1, Offset (0x04) } Method (_STA, 0, NotSerialized) // _STA: Status { If (HPTE) { Return (0x0F) } Else { Return (0x00) } } Name (CRS0, ResourceTemplate () { Memory32Fixed (ReadWrite, 0xFED00000, // Address Base 0x00000400, // Address Length ) }) Name (CRS1, ResourceTemplate () { Memory32Fixed (ReadWrite, 0xFED01000, // Address Base 0x00000400, // Address Length ) }) Name (CRS2, ResourceTemplate () { Memory32Fixed (ReadWrite, 0xFED02000, // Address Base 0x00000400, // Address Length ) }) Name (CRS3, ResourceTemplate () { Memory32Fixed (ReadWrite, 0xFED03000, // Address Base 0x00000400, // Address Length ) }) Method (_CRS, 0, Serialized) // _CRS: Current Resource Settings { Switch (ToInteger (HPTS)) { Case (0x00) { Return (CRS0) /* \_SB_.PCI0.LPC0.HPET.CRS0 */ } Case (0x01) { Return (CRS1) /* \_SB_.PCI0.LPC0.HPET.CRS1 */ } Case (0x02) { Return (CRS2) /* \_SB_.PCI0.LPC0.HPET.CRS2 */ } Case (0x03) { Return (CRS3) /* \_SB_.PCI0.LPC0.HPET.CRS3 */ } } Return (CRS0) /* \_SB_.PCI0.LPC0.HPET.CRS0 */ } } This is SSDT-HPET_RTC_TIMR-fix.aml: DefinitionBlock ("", "SSDT", 2, "OCLT", "HRTfix", 0x00000000) { External (_SB_.PCI0.LPC0, DeviceObj) External (_SB_.PCI0.LPC0.RTC_, DeviceObj) External (_SB_.PCI0.LPC0.TMR_, DeviceObj) External (HPTE, IntObj) Scope (\) { If (_OSI ("Darwin")) { HPTE = Zero } } Scope (_SB.PCI0.LPC0.RTC) { Method (_STA, 0, NotSerialized) // _STA: Status { If (_OSI ("Darwin")) { Return (Zero) } Else { Return (0x0F) } } } Scope (_SB.PCI0.LPC0.TMR) { Method (_STA, 0, NotSerialized) // _STA: Status { If (_OSI ("Darwin")) { Return (Zero) } Else { Return (0x0F) } } } Scope (_SB.PCI0.LPC0) { Device (HPE0) { Name (_HID, EisaId ("PNP0103") /* HPET System Timer */) // _HID: Hardware ID Name (_UID, Zero) // _UID: Unique ID Name (BUF0, ResourceTemplate () { IRQNoFlags () {0,8} Memory32Fixed (ReadWrite, 0xFED00000, // Address Base 0x00000400, // Address Length ) }) Method (_STA, 0, NotSerialized) // _STA: Status { If (_OSI ("Darwin")) { Return (0x0F) } Else { Return (Zero) } } Method (_CRS, 0, Serialized) // _CRS: Current Resource Settings { Return (BUF0) /* \_SB_.PCI0.LPC0.HPE0.BUF0 */ } } Device (RTC0) { Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */) // _HID: Hardware ID Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0070, // Range Minimum 0x0070, // Range Maximum 0x01, // Alignment 0x02, // Length ) IO (Decode16, 0x0074, // Range Minimum 0x0074, // Range Maximum 0x01, // Alignment 0x04, // Length ) }) Method (_STA, 0, NotSerialized) // _STA: Status { If (_OSI ("Darwin")) { Return (0x0F) } Else { Return (Zero) } } } Device (TMR0) { Name (_HID, EisaId ("PNP0100") /* PC-class System Timer */) // _HID: Hardware ID Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0040, // Range Minimum 0x0040, // Range Maximum 0x01, // Alignment 0x04, // Length ) IO (Decode16, 0x0050, // Range Minimum 0x0050, // Range Maximum 0x01, // Alignment 0x04, // Length ) }) Method (_STA, 0, NotSerialized) // _STA: Status { If (_OSI ("Darwin")) { Return (0x0F) } Else { Return (Zero) } } } } }

Author:
[source]