forked from RehabMan/HP-ProBook-4x30s-DSDT-Patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4x40s_SandyBridge.txt
624 lines (547 loc) · 23.4 KB
/
4x40s_SandyBridge.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 00_Optimize.txt
# Optimize (get rid of stuff that is WMI/BIOS related)
# remove large chunk of symbols used only by device WMID and device WMID itself
into all code_regex Name\s*\(WSIP,[\s\S]*Name\s*\(ETYP,\s*Buffer\s*\(.*\)\s*\{\}\) remove_matched;
into device label WMID remove_entry;
# remove references to device WMID
into_all all code_regex .*WMID.*\(.*\) removeall_matched;
into method label _TMP parent_label PCHZ code_regex Store\s*\(DerefOf\s*\(Index\s*\(DerefOf\s*\(Index\s*\(\\_SB\.WMID\.TSTV,[\s\S]*\} remove_matched;
# remove all OEM _DSM methods
into_all method label _DSM remove_entry;
# remove ThermalZone
into scope label \_TZ remove_entry;
into_all method code_regex \\_TZ.* removeall_matched;
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 01_Compilation.txt
# Fix compilation errors
# Fix _T_x compiler reserved warnings (not necessary to fix)
#into_all all code_regex _T_0 replaceall_matched begin T_0 end;
#into_all all code_regex _T_1 replaceall_matched begin T_1 end;
#into_all all code_regex _T_2 replaceall_matched begin T_2 end;
#into_all all code_regex _T_3 replaceall_matched begin T_3 end;
#into_all all code_regex _T_4 replaceall_matched begin T_4 end;
#into_all all code_regex _T_5 replaceall_matched begin T_5 end;
#into_all all code_regex _T_6 replaceall_matched begin T_6 end;
# Another way to fix the _T_x compiler reserved warnings (still not necessary)
#into method label TRUP code_regex Name\s+\(_T_0,\s+Zero\) remove_matched;
#into method label TRUP code_regex Store\s+\(PRDT,\s+_T_0\) remove_matched;
#into method label TRUP code_regex \(_T_0 replaceall_matched begin (PRDT end;
#into method label VHIV code_regex Name\s+\(_T_0,\s+Zero\) remove_matched;
#into method label VHIV code_regex Store\s+\(Arg2,\s+_T_0\) remove_matched;
#into method label VHIV code_regex \(_T_0 replaceall_matched begin (Arg2 end;
#into method label \_SB.PCI0.LPCB.PS2M._HID code_regex Name\s+\(_T_0,\s+Zero\) remove_matched;
#into method label \_SB.PCI0.LPCB.PS2M._HID code_regex Store\s+\(PRDT,\s+_T_0\) remove_matched;
#into method label \_SB.PCI0.LPCB.PS2M._HID code_regex \(_T_0 replaceall_matched begin (PRDT end;
#into method label WQBI code_regex Name\s+\(_T_0,\s+Zero\) remove_matched;
#into method label WQBI code_regex Store\s+\(Arg0,\s+_T_0\) remove_matched;
#into method label WQBI code_regex \(_T_0 replaceall_matched begin (Arg0 end;
#into method label WQBC code_regex Name\s+\(_T_0,\s+Zero\) remove_matched;
#into method label WQBC code_regex Store\s+\(Local6,\s+_T_0\) remove_matched;
#into method label WQBC code_regex \(_T_0 replaceall_matched begin (Local6 end;
#into method label WQBC code_regex Name\s+\(_T_1,\s+Zero\) remove_matched;
#into method label WQBC code_regex Store\s+\(DerefOf\s+\(Index\s+\(ST99,\s+0x00\)\),\s+_T_1\) replace_matched begin Store (DerefOf (Index (ST99, 0x00)), Local2) end;
#into method label WQBC code_regex \(_T_1 replaceall_matched begin (Local2 end;
#nto method label WMBA code_regex Name\s+\(_T_0,\s+Zero\) remove_matched;
#into method label WMBA code_regex Store\s+\(Local6,\s+_T_0\) remove_matched;
#into method label WMBA code_regex \(_T_0 replaceall_matched begin (Local6 end;
# Fix parse errors
into device label GFX0 code_regex If\s\(CondRefOf\s\(FPED\)\)\s*\n\s*\{\s*\n\s*FPED\s\(\)\s*\n\s*\} remove_matched;
# Fix line 2169 2181 compilations errors (these are specfiic to 4530s)
into_all all code_regex DWordMemory\s\(ResourceProducer,\sPosDecode,\sMinFixed,\sMaxFixed,\sCacheable,\sReadWrite,\n\s+0x00000000,\s+//\sGranularity\n\s+0x00000000,\s+//\sRange\sMinimum\n\s+0x00000000,\s+//\sRange\sMaximum\n\s+0x00000000,\s+//\sTranslation\sOffset\n\s+0x00000000,\s+//\sLength replace_matched
begin
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,\n
0x00000000, // Granularity\n
0x00000000, // Range Minimum\n
0x00000000, // Range Maximum\n
0x00000000, // Translation Offset\n
0x00000001, // Length\n
end;
into_all all code_regex DWordMemory\s\(ResourceProducer,\sPosDecode,\sMinFixed,\sMaxFixed,\sCacheable,\sReadWrite,\n\s+0x00000000,\s+//\sGranularity\n\s+0x00000000,\s+//\sRange\sMinimum\n\s+0xFEDFFFFF,\s+//\sRange\sMaximum\n\s+0x00000000,\s+//\sTranslation\sOffset\n\s+0x00000000,\s+//\sLength replace_matched
begin
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,\n
0x00000000, // Granularity\n
0x00000000, // Range Minimum\n
0xFEDFFFFF, // Range Maximum\n
0x00000000, // Translation Offset\n
0xFEE00000, // Length\n
end;
# Fix 3 compilation warnings
#rehabman: These are warnings and not sure if it a good idea to "fix" them...
#into_all all code_regex \\_SB\.F4EV,.0x0500 replaceall_matched begin F4EV, 0xFFFF end;
#into_all all code_regex \\_SB\.BEVT,.0x10 replaceall_matched begin BEVT, 0xFFFF end;
# Fix NBTT compilation warning
#rehabman: These are also warnings, and not necessary to patch
#into_all all code_regex Name\s\(NBTT,\sPackage\s\(0x08\) replaceall_matched
#begin
#Name (NBTT, Package()
#end;
# ProBook 4x40s specific
into all code_regex Name\s+\(BB2S,\s+\"\s+\"\.\.\.\) replace_matched
begin
Name (BB2S, " ")
end;
#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+\{.*\} 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;
# Add missing IMEI device
into device label IMEI parent_label PCI0 remove_entry;
into device label PCI0 insert
begin
Device (IMEI)\n
{\n
Name (_ADR, 0x00160000)\n
}\n
end;
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 05_OScheck.txt
# patch _INI method in Scope(_SB)
into method label _INI replace_content
begin
// always store 0x07D6 for "Darwin"\n
Store (0x07D6, OSYS)\n
//\_TZ.BOTT ()\n
//\_TZ.RETD ()\n
Store (One, PFLV)\n
end;
into method label WCOS replace_content
begin
// assume "Windows 2006" values\n
Store (0x06, WOSI)\n
Store (WOSI, WHOS)\n
Return (WOSI)\n
end;
# patch OS checks
#into_all all code_regex If\s\(_OSI\s\(\"Windows\s2006\"\)\) replaceall_matched
#begin If (LOr (_OSI ("Darwin"), _OSI ("Windows 2006"))) end;
#into_all all code_regex If\s\(\\_OSI\s\(\"Windows\s2006\"\)\) replaceall_matched
#begin If (LOr (_OSI ("Darwin"), _OSI ("Windows 2006"))) end;
# Remove icons on menu bar for SD card
into method label _RMV parent_label SMHC replace_content begin Return (Zero) end;
into method label _RMV parent_label MSHC replace_content begin Return (Zero) end;
into method label _RMV parent_label XDCC replace_content begin Return (Zero) end;
into method label _RMV parent_label I1C replace_content begin Return (Zero) end;
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 06_Battery.txt
# Add cycle count and temperature to battery info method
# 16-bit version
into method label BTIF code_regex Store\s\(BDAT,\sLocal1\) replace_matched
begin
Store (BDAT, Local1)\n
// battery cycle count\n
Store (BCC, Index (DerefOf (Index (NBTI, Arg0)), 0x0D))\n
// battery temperature\n
Acquire (\\_SB.PCI0.LPCB.EC0.ECMX, 0xFFFF)\n
Store (5, \\_SB.PCI0.LPCB.EC0.CRZN)\n
Store (\\_SB.PCI0.LPCB.EC0.TEMP, Local2)\n
Release (\\_SB.PCI0.LPCB.EC0.ECMX)\n
Add (Multiply (Local2, 10), 2732, Local2) // Celsius to .1K\n
Store (Local2, Index (DerefOf (Index (NBTI, Arg0)), 0x0E))\n
end;
# Need to extend size of NBTI packages
into all code_regex \"Hewlett\-Packard\"\s+\},\s+Package\s\(0x0D\) replaceall_matched
begin
"Hewlett-Packard",\n
Zero,\n
Zero,\n
},\n
Package(0x0F)\n
end;
into all code_regex Name\s\(NBTI,\sPackage\s\(0x02\)\s+\{\s+Package\s\(0x0D\) replaceall_matched
begin
Name (NBTI, Package(0x02)\n
{\n
Package(0x0F)\n
end;
into_all all code_regex \"LIon\",\s+\"Hewlett\-Packard\"\n\s+\}\n replaceall_matched
begin
"LIon",\n
"Hewlett-Packard",\n
Zero,\n
Zero,\n
}\n
end;
# Convert battery EC info from 16-bit to 8-bit fields...
# Need this utility method B1B2(lowbyte, hibyte)... returns ((hibyte << 8) | lowbyte)
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized)\n
{\n
ShiftLeft (Arg1, 8, Local0)\n
Or (Arg0, Local0, Local0)\n
Return (Local0)\n
}\n
end;
# Change EC register declarations from 16-bit to 8-bit
into device label EC0 code_regex BSN,\s+16 replace_matched begin BSN0, 8, BSN1, 8 end;
into device label EC0 code_regex CBT,\s+16 replace_matched begin CBT0, 8, CBT1, 8 end;
into device label EC0 code_regex BDC,\s+16 replace_matched begin BDC0, 8, BDC1, 8 end;
into device label EC0 code_regex BFC,\s+16 replace_matched begin BFC0, 8, BFC1, 8 end;
into device label EC0 code_regex BPR,\s+16 replace_matched begin BPR0, 8, BPR1, 8 end;
into device label EC0 code_regex BCR,\s+16 replace_matched begin BCR0, 8, BCR1, 8 end;
into device label EC0 code_regex BRC,\s+16 replace_matched begin BRC0, 8, BRC1, 8 end;
into device label EC0 code_regex BCC,\s+16 replace_matched begin BCC0, 8, BCC1, 8 end;
into device label EC0 code_regex BPV,\s+16 replace_matched begin BPV0, 8, BPV1, 8 end;
into device label EC0 code_regex BME,\s+16 replace_matched begin BME0, 8, BME1, 8 end;
into device label EC0 code_regex BDV,\s+16 replace_matched begin BDV0, 8, BDV1, 8 end;
into device label EC0 code_regex BRTE,\s+16 replace_matched begin RTE0, 8, RTE1, 8 end;
into device label EC0 code_regex BATE,\s+16 replace_matched begin ATE0, 8, ATE1, 8 end;
into device label EC0 code_regex BCV1,\s+16 replace_matched begin BCX0, 8, BCX1, 8 end;
into device label EC0 code_regex BCV2,\s+16 replace_matched begin BCA0, 8, BCA1, 8 end;
into device label EC0 code_regex BCV3,\s+16 replace_matched begin BCB0, 8, BCB1, 8 end;
into device label EC0 code_regex BCV4,\s+16 replace_matched begin BCP0, 8, BCP1, 8 end;
into device label EC0 code_regex BATF,\s+16 replace_matched begin ATF0, 8, ATF1, 8 end;
into device label EC0 code_regex MAXC,\s+16 replace_matched begin AXC0, 8, AXC1, 8 end;
into device label EC0 code_regex BSTS,\s+16 replace_matched begin BST0, 8, BST1, 8 end;
into device label EC0 code_regex BDAT,\s+16 replace_matched begin BDA0, 8, BDA1, 8 end;
# Change access (reads) to those registers from 16-bit to 8-bit
into_all method label BTIF code_regex \(BFC, replaceall_matched begin (B1B2 (BFC0, BFC1), end;
into_all method label GBTI code_regex \(BFC, replaceall_matched begin (B1B2 (BFC0, BFC1), end;
into_all method label BTIF code_regex \(BDV, replaceall_matched begin (B1B2 (BDV0, BDV1), end;
into_all method label GBTI code_regex \(BDV, replaceall_matched begin (B1B2 (BDV0, BDV1), end;
into_all method label BTIF code_regex \(BSN, replaceall_matched begin (B1B2 (BSN0, BSN1), end;
into_all method label GBTI code_regex \(BSN, replaceall_matched begin (B1B2 (BSN0, BSN1), end;
into_all method label BTST code_regex \(BPR, replaceall_matched begin (B1B2 (BPR0, BPR1), end;
into_all method label GBTI code_regex \(BPR, replaceall_matched begin (B1B2 (BPR0, BPR1), end;
into_all method label BTST code_regex \(BRC, replaceall_matched begin (B1B2 (BRC0, BRC1), end;
into_all method label GBTI code_regex \(BRC, replaceall_matched begin (B1B2 (BRC0, BRC1), end;
into_all method label GBTI code_regex \(BCR, replaceall_matched begin (B1B2 (BCR0, BCR1), end;
into_all method label BTST code_regex \(BPV, replaceall_matched begin (B1B2 (BPV0, BPV1), end;
into_all method label GBTI code_regex \(BPV, replaceall_matched begin (B1B2 (BPV0, BPV1), end;
into_all method label GBTI code_regex \(BDC, replaceall_matched begin (B1B2 (BDC0, BDC1), end;
into_all method label GBTI code_regex \(BME, replaceall_matched begin (B1B2 (BME0, BME1), end;
into_all method label GBTI code_regex \(BCC, replaceall_matched begin (B1B2 (BCC0, BCC1), end;
into_all method label BTIF code_regex \(BCC, replaceall_matched begin (B1B2 (BCC0, BCC1), end;
into_all method label GBTI code_regex \(CBT, replaceall_matched begin (B1B2 (CBT0, CBT1), end;
into_all method label GBTI code_regex \(BSTS, replaceall_matched begin (B1B2 (BST0, BST1), end;
into_all method label BTIF code_regex \(BDAT, replaceall_matched begin (B1B2 (BDA0, BDA1), end;
into_all method label GBTI code_regex \(BDAT, replaceall_matched begin (B1B2 (BDA0, BDA1), end;
into_all method label GBTI code_regex \(BCV1, replaceall_matched begin (B1B2 (BCX0, BCX1), end;
into_all method label GBTI code_regex \(BCV2, replaceall_matched begin (B1B2 (BCA0, BCA1), end;
into_all method label GBTI code_regex \(BCV3, replaceall_matched begin (B1B2 (BCB0, BCB1), end;
into_all method label GBTI code_regex \(BCV4, replaceall_matched begin (B1B2 (BCP0, BCP1), end;
into_all method label GBTI code_regex \(BRTE, replaceall_matched begin (B1B2 (RTE0, RTE1), end;
into_all method label GBTI code_regex \(BATE, replaceall_matched begin (B1B2 (ATE0, ATE1), end;
into_all method label GBTI code_regex \(BATF, replaceall_matched begin (B1B2 (ATF0, ATF1), end;
into_all method label GBTC code_regex \(MAXC, replaceall_matched begin (B1B2 (AXC0, AXC1), end;
# Now deal with the writes to those registers
# Store (0xFA, MAXC)
into_all method label SBTC code_regex \(0xFA,\sMAXC\) replaceall_matched begin (0xFA, AXC0)\nStore (Zero, AXC1) end;
# Store (Zero, MAXC)
into_all method label SBTC code_regex \(Zero,\sMAXC\) replaceall_matched begin (Zero, AXC0)\nStore (Zero, AXC1) end;
# Store (0x00, MAXC)
into_all method label SBTC code_regex \(0x00,\sMAXC\) replaceall_matched begin (0x00, AXC0)\nStore (0x00, AXC1) end;
# Store (GBSS (B1B2 (BSN0, BSN1), BDAT, BTSN)
into_all method label GBTI code_regex Store\s\(GBSS\s\(B1B2\s\(BSN0,\sBSN1\),\sBDAT\),\sBTSN\) replaceall_matched
begin
Store (GBSS (B1B2 (BSN0, BSN1), B1B2 (BDA0, BDA1)), BTSN)\n
end;
# Disable BAT1 device
into method label _STA parent_label BAT1 replace_content begin Return (Zero) end;
# Fix method PPNT, called from AC adapter device (AC/ADP1) (ProBooks)
into method label PPNT parent_label EC0 replace_content begin // nothing end;
# Fix method PNOT, called from AC adapter device (AC/ADP1) (EliteBooks?)
into method label PNOT replace_content begin // nothing end;
# These are not really battery related, but similar problems...
# Fix method PCNT, called from HWAK which is called from _WAK
into method label PCNT replace_content begin // nothing end;
# CFGD is an External in an SSDT being dropped...
into method label _WAK code_regex (If\s+\(And\s+\(CFGD,\s+0x01000000\)\)[\s\S]*\((0x01|One),\s+0x48\)\n.*\n.*\}) replace_matched
begin
If (CondRefOf(CFGD))\n
{\n
%1\n
}\n
end;
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 02b_EHCI_4x40s.txt
# USB property injection for 4x40s (HM76)
# Insert Apple USB properties into EHC1
into method label _DSM parent_adr 0x001D0000 remove_entry;
into device name_adr 0x001D0000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"AAPL,clock-id", Buffer() { 0x01 },\n
"subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n
"subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n
"AAPL,current-available", 2100,\n
"AAPL,current-extra", 2200,\n
"AAPL,current-extra-in-sleep", 1600,\n
"AAPL,device-internal", 0x02,\n
"AAPL,max-port-current-in-sleep", 2100,\n
})\n
}\n
end;
# Insert Apple USB properties into EHC2
into method label _DSM parent_adr 0x001A0000 remove_entry;
into device name_adr 0x001A0000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"AAPL,clock-id", Buffer() { 0x01 },\n
"subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n
"subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n
"AAPL,current-available", 2100,\n
"AAPL,current-extra", 2200,\n
"AAPL,current-extra-in-sleep", 1600,\n
"AAPL,device-internal", 0x02,\n
"AAPL,max-port-current-in-sleep", 2100,\n
})\n
}\n
end;
# Insert Apple USB properties into USB 3.0 XHC
into method label _DSM parent_adr 0x00140000 remove_entry;
into device name_adr 0x00140000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n
"subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n
"AAPL,current-available", 2100,\n
"AAPL,current-extra", 2200,\n
"AAPL,current-extra-in-sleep", 1600,\n
"AAPL,device-internal", 0x02,\n
"AAPL,max-port-current-in-sleep", 2100,\n
})\n
}\n
end;
#Maintained by: RehabMan for: HP Probook 4x30s/4x40s
# 07_MEI_4x40s_Sandy.txt
into device label IMEI parent_label PCI0 remove_entry;
into device label PCI0 insert
begin
Device (IMEI)\n
{\n
Name (_ADR, 0x00160000)\n
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"device-id", Buffer() { 0x3A, 0x1C, 0x00, 0x00 },\n
"name", Buffer() { "pci8086,1c3a" },\n
})\n
}\n
}\n
end;