forked from RehabMan/HP-ProBook-4x30s-DSDT-Patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
02_DSDTPatch.txt
245 lines (213 loc) · 6.42 KB
/
02_DSDTPatch.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 02_DSDTPatch.txt
# Replace all instances of AC with ADP1
into_all all code_regex \.AC, replaceall_matched begin .ADP1, end;
into_all all code_regex \(AC, replaceall_matched begin (ADP1, end;
into all label AC set_label begin ADP1 end;
# Power fix - uses AppleACPIBatteryManager.kext instead VoodooBattery
into device label ADP1 code_regex Name\s+\(_PRW,[\s\S]*\}\) remove_matched;
into device label ADP1 insert
begin
Name (_PRW, Package() { 0x18, 0x03 })
end;
# Enable functions keys
# Override DSDT oemId (for Clover, since it patches with "Apple ")
into method label _DSM parent_label PS2K remove_entry;
into device label PS2K insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
// Note: Function key part seems to not be necessary
// "AAPL,has-embedded-fn-keys", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n
"RM,oem-id", "HPQOEM",\n
})\n
}\n
end;
# Inject Audio info
into method label _DSM parent_label HDEF remove_entry;
into device label HDEF insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"hda-gfx", Buffer() { "onboard-1" },\n
"layout-id", Buffer() { 0x0C, 0x00, 0x00, 0x00 },\n
"PinConfigurations", Buffer() { },\n
//"MaximumBootBeepVolume", 77,\n
})\n
}\n
end;
# IRQ fix
into device name_hid PNP0000 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched;
into device name_hid PNP0100 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched;
into device name_hid PNP0B00 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched;
into device name_hid PNP0103 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} removeall_matched;
into device name_hid PNP0103 code_regex Name\s\(([^,]+),\sResourceTemplate\s\(\)\n\s+\{((?:.|\n)*)\}\) replace_matched
begin
Name (%1, ResourceTemplate()\n
{\n
IRQNoFlags() { 0, 8, 11, 15 }\n
%2
})\n
end;
# Rename all instances of GFX0 to IGPU
into_all all code_regex GFX0 replaceall_matched begin IGPU end;
into_all all label GFX0 set_label begin IGPU end;
# Brightness control fix
into device label PNLF remove_entry;
into scope label \_SB insert
begin
Device (PNLF)\n
{\n
Name (_HID, EisaId ("APP0002"))\n
Name (_CID, "backlight")\n
Name (_UID, 10)\n
Name (_STA, 0x0B)\n
}\n
end;
# RTC fix
into device name_hid PNP0B00 code_regex (IO\s\((?:\s*[^,]+,\s*(?:\/\/\s.*)?\s*\n)+\s*)(\dx\d+)(,\s*(?:\/\/\s.*)?\s*\n\s*\)) replace_matched begin %10x02%3 end;
# Shutdown fix
into method label _PTS code_regex_not If\s\(LEqual\s\(Arg0,\s0x05\)\) code_regex ^((?:.|\n)*)$ replace_matched
begin
If (LEqual (Arg0, 0x05)) {}\n
Else\n
{\n
%1
}\n
end;
# SMBUS fix
into device label BUS0 parent_adr 0x001F0003 remove_entry;
into device name_adr 0x001F0003 insert
begin
Device (BUS0)\n
{\n
Name (_CID, "smbus")\n
Name (_ADR, Zero)\n
Device (DVL0)\n
{\n
Name (_ADR, 0x57)\n
Name (_CID, "diagsvault")\n
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package() { "address", 0x57 })\n
}\n
}\n
}\n
end;
# USB sleep fix injects Macbook 8,1 device IDs
into method label _DSM parent_adr 0x001D0001 remove_entry;
into device name_adr 0x001D0001 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c27" },\n
})\n
}\n
end;
into method label _DSM parent_adr 0x001D0002 remove_entry;
into device name_adr 0x001D0002 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x2c, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c2c" },\n
})\n
}\n
end;
into method label _DSM parent_adr 0x001D0003 remove_entry;
into device name_adr 0x001D0003 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c27" },\n
})\n
}\n
end;
into method label _DSM parent_adr 0x001D0004 remove_entry;
into device name_adr 0x001D0004 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x2c, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c2c" },\n
})\n
}\n
end;
into method label _DSM parent_adr 0x001A0001 remove_entry;
into device name_adr 0x001A0001 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return(Package()\n
{\n
"device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c27" },\n
})\n
}\n
end;
into method label _DSM parent_adr 0x001A0002 remove_entry;
into device name_adr 0x001A0002 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Store (Package()\n
{\n
"device-id", Buffer() { 0x2c, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c2c" },\n
})\n
}\n
end;
into method label _DSM parent_adr 0x001A0003 remove_entry;
into device name_adr 0x001A0003 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x27, 0x1c, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c27" },\n
})\n
}\n
end;
# HPET fix to avoid AppleIntelCPUPowerManagement panic
into method label _STA parent_hid PNP0103 remove_entry;
into device name_hid PNP0103 code_regex Name\s\(_STA\,\s+0x0F\) remove_matched;
into device name_hid PNP0103 insert
begin
Name (_STA, 0x0F)\n
end;
into method label _CRS parent_hid PNP0103 remove_entry;
into device name_hid PNP0103 insert
begin
Method (_CRS, 0, NotSerialized) { Return (BUF0) }\n
end;
# Fix _WAK method to deal with bug in AppleACPIPlatform v1.8 (in 10.8.5+)
into method label _WAK code_regex \s*(.?WAK\s+\([^)]*\)) replace_matched
begin
If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n
%1
end;