1
0
Fork 0
mirror of https://github.com/tylernguyen/x1c6-hackintosh.git synced 2025-02-05 01:23:14 -06:00
x1c6-hackintosh/patches/SSDT-PNLF.dsl

58 lines
2.2 KiB
Text
Raw Permalink Normal View History

2020-11-03 11:58:35 -06:00
/*
* Add PNLF device
* For use with AppleBacklightSmoother.kext
*
* Credits @hieplpvip
*/
DefinitionBlock("", "SSDT", 2, "tyler", "_PNLF", 0)
{
External(_SB.PCI0.GFX0, DeviceObj)
2020-11-03 13:22:45 -06:00
// OS Is Darwin?
External (OSDW, MethodObj) // 0 Arguments
2020-11-03 11:58:35 -06:00
// For backlight control
2020-11-03 13:22:45 -06:00
Scope(_SB.PCI0.GFX0)
2020-11-03 11:58:35 -06:00
{
2020-11-03 13:22:45 -06:00
/**
* The purpose of the PNLF-device is to make AppleBacklight load.
*
* But it is not enough to make backlight working. There is a mismatch in PWM MAX between macOS and our laptop,
* so we need to fix that, either by patching macOS (which AppleBacklightSmoother and WhateverGreen's CoffeeLake patch does)
* or set PWM MAX in hardware to match that of macOS (which the traditional SSDT-PNLF does). In addition, we also need to set
* UID to match profiles defined in WhateverGreen). But each platform needs a different value. If you look into SSDT-PNLF
* (both from this repo and WhateverGreen), you would see it contains device-id of various IGPU. They are used for
* automatically detecting platform and injecting corresponding value.
*
* SSDT-PNLF from WhateverGreen also set PWM MAX, but as I said before, it's not needed for AppleBacklightSmoother as
* it patches macOS to work with all PWM MAX.
*
* (@hieplpvip, https://github.com/hieplpvip/AppleBacklightSmoother/issues/2#issuecomment-703273278)
*/
Device (PNLF)
2020-11-03 11:58:35 -06:00
{
2020-11-03 13:22:45 -06:00
Name (_HID, EisaId ("APP0002")) // _HID: Hardware ID
Name (_CID, "backlight") // _CID: Compatible ID
// _UID is set depending on device ID to match profiles in WhateverGreen
// 0x0E - 14: Arrandale/Sandy/Ivy
// 0x0F - 15: Haswell/Broadwell
// 0x10 - 16: Skylake/KabyLake
// 0x11 - 17: custom LMAX=0x7a1
// 0x12 - 18: custom LMAX=0x1499
// 0x13 - 19: CoffeeLake 0xffff
2021-06-21 20:51:16 -05:00
Name (_UID, 0x10) // _UID: Unique ID
2020-11-03 13:22:45 -06:00
Method (_STA, 0, NotSerialized)
2020-11-03 11:58:35 -06:00
{
2020-11-03 13:22:45 -06:00
If (OSDW ())
{
Return (0x0B)
}
2020-11-03 11:58:35 -06:00
2020-11-03 13:22:45 -06:00
Return (Zero)
2020-11-03 11:58:35 -06:00
}
}
}
}