Contribute
Register

[Guide] Patching DSDT/SSDT for LAPTOP backlight control

Joined
Mar 22, 2016
Messages
30
Motherboard
Laptop make & model # > See Rules!
CPU
I5-3217U
Graphics
HD 4000, NVIDIA GT720M
Mac
  1. MacBook Pro
Classic Mac
  1. Portable
Mobile Phone
  1. Android
Read post #1.
It is possible for both keys (up/down) to generate a call to the same EC query method. This is the case with the Haswell HP Envy, for example. By examining the code it is possible to determine how to disambiguate. As it turns out a variable in the EC is set to indicate the function to be performed when the _Q13 method is invoked. The patch for this case is as follows:
Code (Text):

into method label _Q13 replace_content
begin
Store(HKNO, Local0)\n
If (LEqual(Local0,7))\n
{\n
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0405)\n
}\n
If (LEqual(Local0,8))\n
{\n
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0406)\n
}\n
If (LEqual(Local0,4))\n
{\n
// Mirror toggle\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x046e)\n
}\n
end;
here, but it not working
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,061
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
It is possible for both keys (up/down) to generate a call to the same EC query method. This is the case with the Haswell HP Envy, for example. By examining the code it is possible to determine how to disambiguate. As it turns out a variable in the EC is set to indicate the function to be performed when the _Q13 method is invoked. The patch for this case is as follows:

here, but it not working

Read post #1, "Problem Reporting".
 
Joined
Mar 22, 2016
Messages
30
Motherboard
Laptop make & model # > See Rules!
CPU
I5-3217U
Graphics
HD 4000, NVIDIA GT720M
Mac
  1. MacBook Pro
Classic Mac
  1. Portable
Mobile Phone
  1. Android
Read post #1, "Problem Reporting".
Daniel:~ daniel$ kextstat|grep -y acpiplat

13 2 0xffffff7f8289b000 0x65000 0x65000 com.apple.driver.AppleACPIPlatform (3.1) <12 11 7 6 5 4 3 1>

Daniel:~ daniel$ kextstat|grep -y appleintelcpu

28 0 0xffffff7f824a9000 0x2b000 0x2b000 com.apple.driver.AppleIntelCPUPowerManagement (218.0.0) <7 6 5 4 3 1>

36 0 0xffffff7f824a4000 0x3000 0x3000 com.apple.driver.AppleIntelCPUPowerManagementClient (218.0.0) <7 6 5 4 3 1>

Daniel:~ daniel$ kextstat|grep -y applelpc

88 0 0xffffff7f82346000 0x3000 0x3000 com.apple.driver.AppleLPC (1.7.3) <87 12 5 4 3>

Daniel:~ daniel$ sudo touch /System/Library/Extensions && sudo kextcache -u /

Password:

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Trackpad.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Mouse.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Keyboard.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Controller.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext RIMBBUSB.kext

kext-dev-mode allowing invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext AirPortBrcm4360.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelMausiEthernet.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelBacklight.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC_LPCSensors.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC_GPUSensors.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC_CPUSensors.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC_ACPISensors.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID_BCM94352Z_as_BCM94360CS2.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID.kext

kext file:///System/Library/Extensions/DisableTurboBoostBattery.kext/ is in hash exception list, allowing to load

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext CustomPeripheral.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext CodecCommander.kext

kext-dev-mode allowing invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext AppleHDAHardwareConfigDriver.kext

kext-dev-mode allowing invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext AppleHDA.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext AHCIPortInjector.kext

kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIBatteryManager.kext
 

Attachments

  • EFI.zip
    408.6 KB · Views: 54
  • Daniel.ioreg
    3.9 MB · Views: 89

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,061
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
i was update attached files :)

Your EFI/Clover still does not have EFI/Clover/ACPI/origin. Re-create the directory (you should have never deleted it). Then use F4 to dump files into it.

If you look carefully at your DSDT, you will find that eventually your brightness keys will lead to method BRT6 (0x86 and 0x87 are the Notify codes for brightness in Windows). BRT6 is called from EV13. EV13 is called from SMEE. SMEE is called from SMIE. SMIE is called from NEVT. And NEVT is called from _Q66.
 
Joined
Mar 22, 2016
Messages
30
Motherboard
Laptop make & model # > See Rules!
CPU
I5-3217U
Graphics
HD 4000, NVIDIA GT720M
Mac
  1. MacBook Pro
Classic Mac
  1. Portable
Mobile Phone
  1. Android
Your EFI/Clover still does not have EFI/Clover/ACPI/origin. Re-create the directory (you should have never deleted it). Then use F4 to dump files into it.

If you look carefully at your DSDT, you will find that eventually your brightness keys will lead to method BRT6 (0x86 and 0x87 are the Notify codes for brightness in Windows). BRT6 is called from EV13. EV13 is called from SMEE. SMEE is called from SMIE. SMIE is called from NEVT. And NEVT is called from _Q66.
yes, but i use code

into method label _Q13 replace_content
begin
Store(HKNO, Local0)\n
If (LEqual(Local0,7))\n
{\n
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0405)\n
}\n
If (LEqual(Local0,8))\n
{\n
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0406)\n
}\n
If (LEqual(Local0,4))\n
{\n
// Mirror toggle\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x046e)\n
}\n
end;
replace to _Q66 but not working
 
Joined
Mar 22, 2016
Messages
30
Motherboard
Laptop make & model # > See Rules!
CPU
I5-3217U
Graphics
HD 4000, NVIDIA GT720M
Mac
  1. MacBook Pro
Classic Mac
  1. Portable
Mobile Phone
  1. Android
Your EFI/Clover still does not have EFI/Clover/ACPI/origin. Re-create the directory (you should have never deleted it). Then use F4 to dump files into it.

If you look carefully at your DSDT, you will find that eventually your brightness keys will lead to method BRT6 (0x86 and 0x87 are the Notify codes for brightness in Windows). BRT6 is called from EV13. EV13 is called from SMEE. SMEE is called from SMIE. SMIE is called from NEVT. And NEVT is called from _Q66.
yes, but i use code

into method label _Q13 replace_content
begin
Store(HKNO, Local0)\n
If (LEqual(Local0,7))\n
{\n
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0405)\n
}\n
If (LEqual(Local0,8))\n
{\n
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0406)\n
}\n
If (LEqual(Local0,4))\n
{\n
// Mirror toggle\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x046e)\n
}\n
end;
replace to _Q66 but not working
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,061
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
yes, but i use code

into method label _Q13 replace_content
begin
Store(HKNO, Local0)\n
If (LEqual(Local0,7))\n
{\n
// Brightness Down\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0405)\n
}\n
If (LEqual(Local0,8))\n
{\n
// Brightness Up\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x0406)\n
}\n
If (LEqual(Local0,4))\n
{\n
// Mirror toggle\n
Notify(\_SB.PCI0.LPCB.PS2K, 0x046e)\n
}\n
end;
replace to _Q66 but not working

Why would you expect that to work? That is for the HP Envy, not your laptop.

Read post #1030.
 
Joined
Mar 22, 2016
Messages
30
Motherboard
Laptop make & model # > See Rules!
CPU
I5-3217U
Graphics
HD 4000, NVIDIA GT720M
Mac
  1. MacBook Pro
Classic Mac
  1. Portable
Mobile Phone
  1. Android
Why would you expect that to work? That is for the HP Envy, not your laptop.

Read post #1030.
so now i must replacment code 0x0405, 0x0406 to 0x86,0x87 :(
 
Top