forked from RehabMan/HP-ProBook-4x30s-DSDT-Patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04a_FanPatch.txt
90 lines (88 loc) · 2.78 KB
/
04a_FanPatch.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 04a_FanPatch.txt
#
# This fan patch adds a very conservative modification to the normal
# BIOS fan control. It does not attempt to trick the system into
# thinking that the laptop is arbitrarily cool. Instead it simply
# avoids some of the annoying ways in which the default HP BIOS
# controls the fan. Primarily that it ramps up the fan speed too
# agressively, and even when at relatively cool temperatures, it
# runs the fan at one speed above the lowest.
#
# add fan readings and fan control
into device label SMCD remove_entry;
into definitionblock code_regex . insert
begin
Device (SMCD)\n
{\n
Name (_HID, "FAN00000") // _HID: Hardware ID\n
// ACPISensors.kext configuration\n
Name (TACH, Package()\n
{\n
"System Fan", "FAN0",\n
})\n
Name (TEMP, Package()\n
{\n
"CPU Heatsink", "TCPU",\n
"Ambient", "TAMB",\n
//"Mainboard", "TSYS",\n
//"CPU Proximity", "TCPP",\n
})\n
// Actual methods to implement fan/temp readings/control\n
Method (FAN0, 0, Serialized)\n
{\n
Store (\_SB.PCI0.LPCB.EC0.FRDC, Local0)
If (Local0) { Divide (Add(0x3C000, ShiftRight(Local0,1)), Local0,, Local0) }
If (LEqual (0x03C4, Local0)) { Return (Zero) }\n
Return (Local0)\n
}\n
Method (TCPU, 0, Serialized)\n
{\n
Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n
Store (1, \_SB.PCI0.LPCB.EC0.CRZN)\n
Store (\_SB.PCI0.LPCB.EC0.DTMP, Local0)\n
Release (\_SB.PCI0.LPCB.EC0.ECMX)\n
Return (Local0)\n
}\n
Method (TAMB, 0, Serialized)
{\n
Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n
Store (4, \_SB.PCI0.LPCB.EC0.CRZN)\n
Store (\_SB.PCI0.LPCB.EC0.TEMP, Local0)\n
Release (\_SB.PCI0.LPCB.EC0.ECMX)\n
Return (Local0)\n
}\n
Method (FCPU, 0, Serialized)\n
{\n
Store (TCPU(), Local0)\n
// Temp between 35 and 52: hold fan at lowest speed\n
If (And (LGreaterEqual (Local0, 35), LLessEqual (Local0, 52)))\n
{\n
If (\_SB.PCI0.LPCB.EC0.ECRG)\n
{\n
Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n
Store (0x80, \_SB.PCI0.LPCB.EC0.FTGC)\n
Release (\_SB.PCI0.LPCB.EC0.ECMX)\n
}\n
}\n
Else\n
{\n
// Temp 31 or lower, or above 54: put fan into "automatic mode"\n
// Note: for temps 32, 33, 34 fan stays in whatever mode it was\n
// in previously.\n
// Note: for temps 53, 54 fan stays in whatever mode it was in\n
// previously.\n
If (Or (LLess (Local0, 32), LGreaterEqual (Local0, 55)))\n
{\n
If (\_SB.PCI0.LPCB.EC0.ECRG)\n
{\n
Acquire (\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n
Store (0xFF, \_SB.PCI0.LPCB.EC0.FTGC)\n
Release (\_SB.PCI0.LPCB.EC0.ECMX)\n
}\n
}\n
}\n
Return (Local0)\n
}\n
}\n
end;