Debian Codegraph @

src/superio/winbond/w83627hf/acpi/superio.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /*
4 * include this file into a mainboard's DSDT _SB device tree and it will expose the
5 * W83627HF SuperIO and its functionality.
6 *
7 * Devices are marked as nonexistent if they got 0x00000000 as I/O base address
8 * (compatibility with legacy bios, which disables logical devices that way)
9 *
10 * It allows the change of IO ports, IRQs and DMA settings on most logical
11 * devices, disabling and reenabling logical devices and controlling power
12 * saving mode on logical devices or the whole chip.
13 *
14 * Notes:
15 * - ECP mode of parallel port not implemented, DMA settings of parallel port
16 * will be reset on DSDT init
17 * - Hardware monitor is only shown as "Motherboard Resource", shows no real
18 * functionality
19 *
20 * Controllable through preprocessor macros:
21 * NO_W83627HF_FDC: don't expose the floppy disk controller
22 * NO_W83627HF_FDC_ENUM: don't try to enumerate the connected floppy drives
23 * NO_W83627HF_PPORT: don't expose the parallel port
24 * NO_W83627HF_UARTA: don't expose the first serial port
25 * NO_W83627HF_UARTB: don't expose the second serial port (already hidden
26 * if UARTB is configured as IRDA port by firmware)
27 * NO_W83627HF_IRDA: don't expose the IRDA port (already hidden if UARTB is
28 * configured as serial port by firmware)
29 * NO_W83627HF_CIR: don't expose the Consumer Infrared functionality
30 * NO_W83627HF_KBC: don't expose the keyboard controller
31 * NO_W83627HF_PS2M: don't expose the PS/2 mouse functionality of the
32 * keyboard controller
33 * NO_W83627HF_GAME: don't expose the game port
34 * NO_W83627HF_MIDI: don't expose the MIDI port
35 * NO_W83627HF_HWMON: don't expose the hardware monitor as
36 * PnP "Motherboard Resource"
37 * W83627HF_KBC_COMPAT: show the keyboard controller and the PS/2 mouse as
38 * enabled if it is disabled but an address is assigned
39 * to it. This may be necessary in some cases.
40 *
41 * Datasheet: "W83627HF/F WINBOND I/O" rev. 6.0
42 * http://www.itox.com/pages/support/wdt/W83627HF.pdf
43 */
44
45 #include <superio/acpi/pnp.asl>
46
47 Device(SIO) {
48 Name (_HID, EisaId("PNP0A05"))
49 Name (_STR, Unicode("Winbond W83627HF SuperIO"))
50 Name (_UID, "w83627hf")
51
52 /* Mutex for accesses to the configuration ports (prolog and epilog commands are used, so synchronization is useful) */
53 Mutex(CRMX, 1)
54
55 /* SuperIO configuration ports */
56 OperationRegion (CREG, SystemIO, SUPERIO_PNP_BASE, 0x02)
57 Field (CREG, ByteAcc, NoLock, Preserve)
58 {
59 PNP_ADDR_REG, 8,
60 PNP_DATA_REG, 8
61 }
62 IndexField (PNP_ADDR_REG, PNP_DATA_REG, ByteAcc, NoLock, Preserve)
63 {
64 Offset (0x02),
65 RST, 1, /* Soft reset */
66 , 7,
67 Offset (0x07),
68 LDN, 8, /* Logical device selector */
69 Offset (0x20),
70 DID, 8, /* Device ID */
71 DREV, 8, /* Device Revision */
72 FDPW, 1, /* FDC Power Down */
73 , 2,
74 PRPW, 1, /* PRT Power Down */
75 UAPW, 1, /* UART A Power Down */
76 UBPW, 1, /* UART B Power Down */
77 HWPW, 1, /* HWM Power Down */
78 , 1,
79 IPD, 1, /* Immediate Chip Power Down */
80 , 7,
81 PNPS, 1, /* PnP Address Select Register Default Value Mode */
82 , 1,
83 KBCR, 1, /* KBC enabled after system reset (read-only) */
84 , 3,
85 CLKS, 1, /* Clock select */
86 AQ16, 1, /* 16bit Address Qualification */
87 FDCT, 1, /* Tristate FDC (?) */
88 , 2,
89 PRTT, 1, /* Tristate parallel port (?) */
90 URAT, 1, /* Tristate UART A (?) */
91 URBT, 1, /* Tristate UART B (?) */
92 , 2,
93 URAI, 1, /* UART A Legacy IRQ Select Disable */
94 URBI, 1, /* UART B Legacy IRQ Select Disable */
95 PRTI, 1, /* Parallel Port Legacy IRQ/DRQ Select Disable */
96 FDCI, 1, /* FDC Legacy IRQ/DRQ Select Disable */
97 , 1,
98 LCKC, 1, /* Lock Configuration Registers */
99 Offset (0x29),
100 IO3S, 8, /* GPIO3 pin selection register */
101 Offset (0x30),
102 ACTR, 1, /* Logical device activation */
103 ACT1, 1, /* Logical part activation 1 (mostly unused) */
104 ACT2, 1, /* Logical part activation 2 (mostly unused) */
105 , 5,
106 Offset (0x60),
107 IO1H, 8, /* First I/O port base - high byte */
108 IO1L, 8, /* First I/O port base - low byte */
109 IO2H, 8, /* Second I/O port base - high byte */
110 IO2L, 8, /* Second I/O port base - low byte */
111 Offset (0x70),
112 IRQ0, 8, /* First IRQ */
113 Offset (0x72),
114 IRQ1, 8, /* First IRQ */
115 Offset (0x74),
116 DMA0, 8, /* DMA */
117 Offset (0xE0),
118 /* CRE0-CRE4: function logical device dependent, seems to be reserved for ACPI settings */
119 CRE0, 8,
120 CRE1, 8,
121 CRE2, 8,
122 CRE3, 8,
123 CRE4, 8,
124 Offset (0xF0),
125 /* OPT1-OPTA aka CRF0-CRF9: function logical device dependent */
126 OPT1, 8,
127 OPT2, 8,
128 OPT3, 8,
129 OPT4, 8,
130 OPT5, 8,
131 OPT6, 8,
132 OPT7, 8,
133 OPT8, 8,
134 OPT9, 8,
135 OPTA, 8
136 }
137
138 Method (_CRS)
139 {
140 Return (ResourceTemplate () {
141 /* Announce the used I/O ports to the OS */
142 IO (Decode16, SUPERIO_PNP_BASE, SUPERIO_PNP_BASE, 0x02, 0x01)
143 })
144 }
145
146 /* Enter configuration mode (and acquire mutex)
147 Method must be run before accessing the configuration region.
148 Parameter is the LDN which should be accessed. Values >= 0xFF mean
149 no LDN switch should be done.
150 */
151 Method (ENTER_CONFIG_MODE, 1)
152 {
153 Acquire (CRMX, 0xFFFF)
154 ADDR = 0x87
155 ADDR = 0x87
156 If (Arg0 < 0xFF) {
157 LDN = Arg0
158 }
159 }
160
161 /* Exit configuration mode (and release mutex)
162 Method must be run after accessing the configuration region.
163 */
164 Method (EXIT_CONFIG_MODE)
165 {
166 ADDR = 0xAA
167 Release (CRMX)
168 }
169
170 /* PM: indicate IPD (Immediate Power Down) bit state as D0/D3 */
171 Method (_PSC) {
172 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
173 Local0 = IPD
174 EXIT_CONFIG_MODE ()
175 If (Local0) { Return (3) }
176 Else { Return (0) }
177 }
178
179 /* PM: Switch to D0 by setting IPD low */
180 Method (_PS0) {
181 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
182 IPD = 0
183 EXIT_CONFIG_MODE ()
184 }
185
186 /* PM: Switch to D3 by setting IPD high */
187 Method (_PS3) {
188 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
189 IPD = 1
190 EXIT_CONFIG_MODE ()
191 }
192
193 #ifndef NO_W83627HF_FDC
194 /* =================== Floppy Disk Controller ================ */
195 Device (FDC0) {
196 Name (_HID, EisaId ("PNP0700"))
197 Name (_STR, Unicode ("W83627HF Floppy Disk Controller"))
198 Name (_UID, "w83627hf-fdc")
199
200 Method (_STA)
201 {
202 Local0 = 0x00
203 ENTER_CONFIG_MODE (0)
204 If (ACTR) {
205 Local0 = 0x0F
206 }
207 ElseIf (IO1H || IO1L)
208 {
209 Local0 = 0x0D
210 }
211 EXIT_CONFIG_MODE ()
212 Return (Local0)
213 }
214
215 /* Current power state (Returns 1 if LDN in power saving mode,
216 * 2 if whole chip is powered down), 0 else
217 */
218 Method (_PSC) {
219 Local0 = ^^_PSC ()
220 If (Local0) { Return (Local0) }
221 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
222 Local0 = FDPW
223 EXIT_CONFIG_MODE ()
224 If (Local0) { Return (3) }
225 Else { Return (0) }
226 }
227 /* Disable power saving mode */
228 Method (_PS0) {
229 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
230 FDPW = 1
231 EXIT_CONFIG_MODE ()
232 }
233 /* Enable power saving mode */
234 Method (_PS3) {
235 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
236 FDPW = 0
237 EXIT_CONFIG_MODE ()
238 }
239
240 Method (_DIS)
241 {
242 ENTER_CONFIG_MODE (0)
243 ACTR = 0
244 EXIT_CONFIG_MODE ()
245 }
246
247 Method (_CRS)
248 {
249 Name (CRS, ResourceTemplate () {
250 IO (Decode16, 0x0000, 0x0000, 0x01, 0x07, IO0)
251 IRQNoFlags () {6}
252 DMA (Compatibility, NotBusMaster, Transfer8) {2}
253 })
254
255 /* Get IO port info */
256 ENTER_CONFIG_MODE (0)
257 Local0 = IO1L
258 Local1 = IO1H
259 EXIT_CONFIG_MODE ()
260
261 /* Calculate full IO port address */
262 Local0 |= Local1 << 8
263
264 /* Modify the resource template and return it */
265 CreateWordField (CRS, IO0._MIN, IMIN)
266 CreateWordField (CRS, IO0._MAX, IMAX)
267 IMIN = Local0
268 IMAX = Local0
269 Return (CRS)
270 }
271
272 Method (_PRS)
273 {
274 Return (ResourceTemplate ()
275 {
276 StartDependentFnNoPri ()
277 {
278 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x07)
279 IRQNoFlags () {6}
280 DMA (Compatibility, NotBusMaster, Transfer8) {2}
281 }
282 EndDependentFn ()
283 })
284 }
285
286 #ifndef NO_W83627HF_FDC_ENUM
287 Method (_FDE, 0) {
288 /* Try probing drives.
289 Probing is done through selecting and activating a drive
290 and reading 0x03F7 aka the "shared IDE and floppy register"
291 as any value there besides zero seems to indicate a
292 connected drive.
293 */
294 // Create template
295 Name(FDE, Buffer(){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})
296 CreateByteField (FDE, 1, FD1)
297 CreateByteField (FDE, 4, FD2)
298 CreateByteField (FDE, 8, FD3)
299 CreateByteField (FDE, 12, FD4)
300
301 // Get resources from logical device
302 ENTER_CONFIG_MODE (0)
303 Local0 = ACTR
304 Local1 = IO1H
305 Local2 = IO1L
306 EXIT_CONFIG_MODE ()
307 Local1 <<= 8
308 Local1 |= Local2
309 If (!Local0) {
310 Return (FDE)
311 }
312
313 OperationRegion (FIO1, SystemIO, Local1, 0x06)
314 Field (FIO1, ByteAcc, NoLock, Preserve)
315 {
316 Offset(0x02),
317 SELE, 2,
318 RSTL, 1,
319 IDMA, 1,
320 ACT1, 1,
321 ACT2, 1,
322 ACT3, 1,
323 ACT4, 1,
324 Offset(0x04),
325 BSY1, 1,
326 BSY2, 1,
327 BSY3, 1,
328 BSY4, 1,
329 BUSY, 1,
330 NDMA, 1,
331 IODI, 1,
332 RDY, 1,
333 DATA, 8,
334 }
335 OperationRegion (FIO2, SystemIO, 0x3F7, 0x01)
336 Field (FIO2, ByteAcc, NoLock, Preserve)
337 {
338 SIFR, 8
339 }
340
341 ACT1 = 1
342 SELE = 0
343 Sleep(0x64)
344 If (SIFR) { FD1 = 1 }
345
346 ACT1 = 0
347 ACT2 = 1
348 SELE = 1
349 Sleep(0x64)
350 If (SIFR) { FD2 = 1 }
351
352 ACT2 = 0
353 ACT3 = 1
354 SELE = 2
355 Sleep(0x64)
356 If (SIFR) { FD3 = 1 }
357
358 ACT3 = 0
359 ACT4 = 1
360 SELE = 3
361 Sleep(0x64)
362 If (SIFR) { FD4 = 1 }
363 ACT4 = 0
364 SELE = 0
365
366 Return (FDE)
367 }
368 #endif
369
370
371 Method (_SRS, 1, Serialized)
372 {
373 Name (TMPL, ResourceTemplate () {
374 IO (Decode16, 0, 0, 1, 7, IO0)
375 IRQNoFlags (IRQ0) {}
376 DMA (Compatibility, NotBusMaster, Transfer8, DMA0) {}
377 })
378 CreateWordField (Arg0, IO0._MIN, IOA0)
379 CreateByteField (Arg0, IRQ0._INT, IRQL)
380 CreateByteField (Arg0, DMA0._DMA, DMCH)
381
382 Local0 = IOA0 % 256
383 Local1 = IOA0 / 256
384
385 ENTER_CONFIG_MODE (0)
386 IO1L = Local0
387 IO1H = Local1
388 ACTR = 1
389 EXIT_CONFIG_MODE ()
390 }
391 }
392 #endif
393
394 #ifndef NO_W83627HF_PPORT
395 /* ======================== Parallel Port ======================== */
396 /* Currently no ECP support */
397 Device (PAR0) {
398 Name (_HID, EisaId ("PNP0400"))
399 Name (_DDN, "LPT1")
400 Name (_UID, "w83627hf-pport")
401
402 Method (MODE, 1) {
403 Local0 = Arg0 & 7
404 ENTER_CONFIG_MODE (1)
405 Local1 = OPT1 & 3
406 OPT1 = Local1 | Local0
407 EXIT_CONFIG_MODE()
408 }
409
410 Method (_INI)
411 {
412 /* Deactivate DMA, even if set by BIOS. We don't announce it
413 through _CRS and it's only useful in ECP mode which we
414 don't support at the moment. */
415 ENTER_CONFIG_MODE (1)
416 DMA0 = 0x04
417 EXIT_CONFIG_MODE ()
418 }
419
420 Method (_STA)
421 {
422 Local0 = 0x00
423 ENTER_CONFIG_MODE (1)
424 Local1 = OPT1 & 3
425 If (ACTR) {
426 If (Local1 != 2) {
427 Local0 = 0x0D
428 } Else {
429 Local0 = 0x0D
430 }
431 }
432 ElseIf (IO1H || IO1L)
433 {
434 Local0 = 0x0D
435 }
436 EXIT_CONFIG_MODE ()
437 Return (Local0)
438 }
439
440 Method (_PSC) {
441 Local0 = ^^_PSC ()
442 If (Local0) { Return (Local0) }
443 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
444 Local0 = PRPW
445 EXIT_CONFIG_MODE ()
446 If (Local0) { Return (3) }
447 Else { Return (0) }
448 }
449 Method (_PS0) {
450 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
451 PRPW = 1
452 EXIT_CONFIG_MODE ()
453 }
454 Method (_PS3) {
455 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
456 PRPW = 0
457 EXIT_CONFIG_MODE ()
458 }
459
460 Method (_DIS) {
461 ENTER_CONFIG_MODE (1)
462 ACTR = 0
463 EXIT_CONFIG_MODE ()
464 }
465
466 Method (_CRS)
467 {
468 Name (CRS, ResourceTemplate ()
469 {
470 IO (Decode16, 0x0000, 0x0000, 0x04, 0x08, IO0)
471 IRQNoFlags (IRQX) {}
472 })
473 CreateWordField (CRS, IO0._MIN, IOP0)
474 CreateWordField (CRS, IO0._MAX, IOR0)
475 CreateByteField (CRS, IO0._ALN, IOAL)
476 CreateByteField (CRS, IO0._LEN, IOLE)
477 CreateWordField (CRS, IRQX._INT, IRQW)
478
479 /* Get device settings */
480 ENTER_CONFIG_MODE (1)
481 Local0 = IO1L
482 Local1 = IO1H
483 Local2 = OPT1
484 Local5 = IRQ0
485 EXIT_CONFIG_MODE ()
486 /* Calculate IO port and modify template */
487 Local0 |= Local1 << 8
488 IOP0 = Local1
489 IOR0 = Local1
490
491 /* Set align and length based on active parallel port mode */
492 Local3 = Local2 & 3
493 Local4 = Local2 & 4
494 If (Local4) {
495 IOAL = 0x04
496 }
497 If (Local0 == 0xBC)
498 {
499 IOLE = 0x04
500 }
501 Else
502 {
503 IOLE = 0x08
504 }
505 /* Calculate IRQ bitmap */
506 Local0 = 1
507 IRQW = Local0 << Local5
508 /* Return resource template */
509 Return (CRS)
510 }
511
512 Name (_PRS, ResourceTemplate ()
513 {
514 /* Traditional configurations (SPP mode) */
515 StartDependentFn (0,1)
516 {
517 IO (Decode16, 0x0378, 0x0378, 0x04, 0x08)
518 IRQNoFlags () {3,4,5,7,9,10,11,12}
519 }
520 StartDependentFn (0,1)
521 {
522 IO (Decode16, 0x0278, 0x0278, 0x04, 0x08)
523 IRQNoFlags () {3,4,5,7,9,10,11,12}
524 }
525 StartDependentFn (0,1)
526 {
527 IO (Decode16, 0x03BC, 0x03BC, 0x04, 0x04)
528 IRQNoFlags () {3,4,5,7,9,10,11,12}
529 }
530 /* Traditional configurations (EPP mode) */
531 StartDependentFn (0,0)
532 {
533 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
534 IRQNoFlags () {3,4,5,7,9,10,11,12}
535 }
536 StartDependentFn (0,0)
537 {
538 IO (Decode16, 0x0278, 0x0278, 0x08, 0x08)
539 IRQNoFlags () {3,4,5,7,9,10,11,12}
540 }
541 /* Any configurable address (EPP mode) */
542 StartDependentFn (2,0)
543 {
544 IO (Decode16, 0x0100, 0x0FF8, 0x08, 0x08)
545 IRQNoFlags () {3,4,5,7,9,10,11,12}
546 }
547 /* Any configurable address (No EPP mode) */
548 StartDependentFn (2,1)
549 {
550 IO (Decode16, 0x0100, 0x0FFC, 0x04, 0x08)
551 IRQNoFlags () {3,4,5,7,9,10,11,12}
552 }
553 EndDependentFn ()
554 })
555
556 Method (_SRS, 1, Serialized)
557 {
558 Name (TMPL, ResourceTemplate () {
559 IO (Decode16, 0, 0, 4, 4, IO0)
560 IRQNoFlags (IRQX) {}
561 })
562 CreateWordField (Arg0, IO0._MIN, IOA0)
563 CreateWordField (Arg0, IO0._MIN, IOA1)
564 CreateByteField (Arg0, IO0._ALN, IOAL)
565 CreateByteField (Arg0, IO0._LEN, IOLE)
566 CreateWordField (Arg0, IRQX._INT, IRQL)
567
568 If (IOAL == 4) {
569 Local2 = 0x0
570 } else {
571 Local2 = 0x1
572 }
573
574 Local0 = IOA0 % 256
575 Local1 = IOA0 / 256
576
577 ENTER_CONFIG_MODE (1)
578 /* IO port */
579 IO1L = Local0
580 IO1H = Local1
581 /* Mode */
582 Local3 = OPT1
583 Local3 &= 0xF8
584 OPT1 = Local2 | Local3
585 /* DMA off */
586 DMA0 = 0x04
587 /* IRQ */
588 IRQ0 = FindSetLeftBit (IRQL) - 1
589 /* Activate */
590 ACTR = 1
591 EXIT_CONFIG_MODE ()
592 }
593 }
594 #endif
595
596 #ifndef NO_W83627HF_UARTA
597 /* =========================== UART A ============================ */
598 Device (SER0) {
599 Name (_HID, EisaId ("PNP0501"))
600 Name (_UID, "w83627hf-uarta")
601 Name (_DDN, "COM1")
602
603 Method (_STA)
604 {
605 Local0 = 0x00
606 ENTER_CONFIG_MODE (2)
607 If (ACTR) {
608 Local0 = 0x0F
609 }
610 ElseIf (IO1H || IO1L)
611 {
612 Local0 = 0x0D
613 }
614 EXIT_CONFIG_MODE ()
615 Return (Local0)
616 }
617
618 Method (_PSC) {
619 Local0 = ^^_PSC ()
620 If (Local0) { Return (Local0) }
621 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
622 Local0 = UAPW
623 EXIT_CONFIG_MODE ()
624 If (Local0) { Return (3) }
625 Else { Return (0) }
626 }
627 Method (_PS0) {
628 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
629 UAPW = 1
630 EXIT_CONFIG_MODE ()
631 }
632 Method (_PS3) {
633 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
634 UAPW = 0
635 EXIT_CONFIG_MODE ()
636 }
637
638 Method (_DIS)
639 {
640 ENTER_CONFIG_MODE (2)
641 ACTR = 0
642 EXIT_CONFIG_MODE ()
643 }
644
645 Method (_CRS, 0, Serialized)
646 {
647 Name (CRS, ResourceTemplate () {
648 IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
649 IRQNoFlags (IRQX) {6}
650 })
651 ENTER_CONFIG_MODE (2)
652 Local0 = IO1L
653 Local1 = IO1H
654 Local2 = IRQ0
655 EXIT_CONFIG_MODE ()
656 Local0 |= Local1 << 8
657
658 CreateWordField (CRS, IO0._MIN, IMIN)
659 IMIN = Local0
660 CreateWordField (CRS, IO0._MAX, IMAX)
661 IMAX = Local0
662
663 CreateWordField (CRS, IRQX._INT, IRQW)
664 Local3 = 1
665 IRQW = Local3 << Local2
666
667 Return (CRS)
668 }
669
670 Name (_PRS, ResourceTemplate ()
671 {
672 StartDependentFn (0,0) {
673 IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
674 IRQNoFlags () {3,4,5,7,9,10,11,12}
675 }
676 StartDependentFn (0,0) {
677 IO (Decode16, 0x02F8, 0x02F8, 0x08, 0x08)
678 IRQNoFlags () {3,4,5,7,9,10,11,12}
679 }
680 StartDependentFn (1,0) {
681 IO (Decode16, 0x03E8, 0x03E8, 0x08, 0x08)
682 IRQNoFlags () {3,4,5,7,9,10,11,12}
683 }
684 StartDependentFn (1,0) {
685 IO (Decode16, 0x02E8, 0x02E8, 0x08, 0x08)
686 IRQNoFlags () {3,4,5,7,9,10,11,12}
687 }
688 StartDependentFn (2,0) {
689 IO (Decode16, 0x0100, 0x0FF8, 0x08, 0x08)
690 IRQNoFlags () {3,4,5,7,9,10,11,12}
691 }
692 EndDependentFn()
693 })
694
695 Method (_SRS, 1, Serialized)
696 {
697 Name (TMPL, ResourceTemplate () {
698 IO (Decode16, 0, 0, 1, 6, IO0)
699 IRQNoFlags (IRQX) {}
700 })
701 CreateWordField (Arg0, IO0._MIN, IOA0)
702 CreateWordField (Arg0, IRQX._INT, IRQL)
703
704 Local0 = IOA0 % 256
705 Local1 = IOA0 / 256
706
707 Local3 = FindSetLeftBit (IRQL) - 1
708
709 ENTER_CONFIG_MODE (2)
710 IO1L = Local0
711 IO1H = Local1
712 IRQ0 = Local3
713 ACTR = 1
714 EXIT_CONFIG_MODE ()
715 }
716 }
717 #endif
718
719 #ifndef NO_W83627HF_UARTB
720 /* =========================== UART B ============================ */
721 Device (SER1) {
722 Name (_HID, EisaId ("PNP0501"))
723 Name (_UID, "w83627hf-uartb")
724 Name (_DDN, "COM2")
725
726 Method (_STA)
727 {
728 Local0 = 0x00
729 ENTER_CONFIG_MODE (3)
730 If (!(OPT2 & 0x30))
731 {
732 If (ACTR) {
733 Local0 = 0x0F
734 }
735 ElseIf (IO1H || IO1L)
736 {
737 Local0 = 0x0D
738 }
739 }
740 EXIT_CONFIG_MODE ()
741 Return (Local0)
742 }
743
744 Method (_PSC) {
745 Local0 = ^^_PSC ()
746 If (Local0) { Return (Local0) }
747 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
748 Local0 = UBPW
749 EXIT_CONFIG_MODE ()
750 If (Local0) { Return (3) }
751 Else { Return (0) }
752 }
753 Method (_PS0) {
754 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
755 UBPW = 1
756 EXIT_CONFIG_MODE ()
757 }
758 Method (_PS3) {
759 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
760 UBPW = 0
761 EXIT_CONFIG_MODE ()
762 }
763
764 Method (_DIS)
765 {
766 ENTER_CONFIG_MODE (3)
767 ACTR = 0
768 EXIT_CONFIG_MODE ()
769 }
770
771 Method (_CRS)
772 {
773 Name (CRS, ResourceTemplate () {
774 IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
775 IRQNoFlags (IRQX) {6}
776 })
777 ENTER_CONFIG_MODE (3)
778 Local0 = IO1L
779 Local1 = IO1H
780 Local2 = IRQ0
781 EXIT_CONFIG_MODE ()
782 Local0 |= Local1 << 8
783
784 CreateWordField (CRS, IO0._MIN, IMIN)
785 IMIN = Local0
786 CreateWordField (CRS, IO0._MAX, IMAX)
787 IMAX = Local0
788
789 CreateWordField (CRS, IRQX._INT, IRQW)
790 Local3 = 1
791 IRQW = Local3 << Local2
792
793 Return (CRS)
794 }
795
796 Name (_PRS, ResourceTemplate ()
797 {
798 StartDependentFn (0,0) {
799 IO (Decode16, 0x02F8, 0x02F8, 0x08, 0x08)
800 IRQNoFlags () {3,4,5,7,9,10,11,12}
801 }
802 StartDependentFn (0,0) {
803 IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
804 IRQNoFlags () {3,4,5,7,9,10,11,12}
805 }
806 StartDependentFn (1,0) {
807 IO (Decode16, 0x03E8, 0x03E8, 0x08, 0x08)
808 IRQNoFlags () {3,4,5,7,9,10,11,12}
809 }
810 StartDependentFn (1,0) {
811 IO (Decode16, 0x02E8, 0x02E8, 0x08, 0x08)
812 IRQNoFlags () {3,4,5,7,9,10,11,12}
813 }
814 StartDependentFn (2,0) {
815 IO (Decode16, 0x0100, 0x0FF8, 0x08, 0x08)
816 IRQNoFlags () {3,4,5,7,9,10,11,12}
817 }
818 EndDependentFn()
819 })
820
821 Method (_SRS, 1, Serialized)
822 {
823 Name (TMPL, ResourceTemplate () {
824 IO (Decode16, 0, 0, 1, 8, IO0)
825 IRQNoFlags (IRQX) {}
826 })
827 CreateWordField (Arg0, IO0._MIN, IOA0)
828 CreateByteField (Arg0, IRQX._INT, IRQL)
829
830 Local0 = IOA0 % 256
831 Local1 = IOA0 / 256
832
833 Local3 = FindSetLeftBit (IRQL) - 1
834
835 ENTER_CONFIG_MODE (3)
836 IO1L = Local0
837 IO1H = Local1
838 IRQ0 = Local3
839 ACTR = 1
840 EXIT_CONFIG_MODE ()
841 }
842 }
843 #endif
844
845 #ifndef NO_W83627HF_IRDA
846 /* ======================== UART B (IRDA) ======================== */
847 Device (IRDA) {
848 Name (_HID, EisaId ("PNP0510"))
849 Name (_UID, "w83627hf-irda")
850 Name (_STR, Unicode("IrDA Port"))
851
852 Method (_STA)
853 {
854 Local0 = 0x00
855 ENTER_CONFIG_MODE (3)
856 If (OPT2 & 0x30)
857 {
858 If (ACTR) {
859 Local0 = 0x0F
860 }
861 ElseIf (IO1H || IO1L)
862 {
863 Local0 = 0x0D
864 }
865 }
866 EXIT_CONFIG_MODE ()
867 Return (Local0)
868 }
869
870 Method (_PSC) {
871 Local0 = ^^_PSC ()
872 If (Local0) { Return (Local0) }
873 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
874 Local0 = UBPW
875 EXIT_CONFIG_MODE ()
876 If (Local0) { Return (3) }
877 Else { Return (0) }
878 }
879 Method (_PS0) {
880 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
881 UBPW = 1
882 EXIT_CONFIG_MODE ()
883 }
884 Method (_PS3) {
885 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
886 UBPW = 0
887 EXIT_CONFIG_MODE ()
888 }
889
890 Method (_DIS)
891 {
892 ENTER_CONFIG_MODE (3)
893 ACTR = 0
894 EXIT_CONFIG_MODE ()
895 }
896
897 Method (_CRS)
898 {
899 Name (CRS, ResourceTemplate () {
900 IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
901 IRQNoFlags (IRQX) {6}
902 })
903 ENTER_CONFIG_MODE (3)
904 Local1 = IO1H
905 Local0 = IO1L
906 Local2 = IRQ0
907 EXIT_CONFIG_MODE ()
908 Local0 |= Local1 << 8
909
910 CreateWordField (CRS, IO0._MIN, IMIN)
911 IMIN = Local0
912 CreateWordField (CRS, IO0._MAX, IMAX)
913 IMAX = Local0
914
915 CreateWordField (CRS, IRQX._INT, IRQW)
916 Local3 = 1
917 IRQW = Local3 << Local2
918
919 Return (CRS)
920 }
921
922 Name (_PRS, ResourceTemplate ()
923 {
924 StartDependentFn (0,0) {
925 IO (Decode16, 0x02F8, 0x02F8, 0x08, 0x08)
926 IRQNoFlags () {3,4,5,7,9,10,11,12}
927 }
928 StartDependentFn (1,0) {
929 IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
930 IRQNoFlags () {3,4,5,7,9,10,11,12}
931 }
932 StartDependentFn (0,0) {
933 IO (Decode16, 0x03E8, 0x03E8, 0x08, 0x08)
934 IRQNoFlags () {3,4,5,7,9,10,11,12}
935 }
936 StartDependentFn (0,0) {
937 IO (Decode16, 0x02E8, 0x02E8, 0x08, 0x08)
938 IRQNoFlags () {3,4,5,7,9,10,11,12}
939 }
940 StartDependentFn (2,0) {
941 IO (Decode16, 0x0100, 0x0FF8, 0x08, 0x08)
942 IRQNoFlags () {3,4,5,7,9,10,11,12}
943 }
944 EndDependentFn()
945 })
946
947 Method (_SRS, 1, Serialized)
948 {
949 Name (TMPL, ResourceTemplate () {
950 IO (Decode16, 0, 0, 1, 8, IO0)
951 IRQNoFlags (IRQX) {}
952 })
953 CreateWordField (Arg0, IO0._MIN, IOA0)
954 CreateByteField (Arg0, IRQX._INT, IRQL)
955
956 Local0 = IOA0 % 256
957 Local1 = IOA0 / 256
958
959 Local3 = FindSetLeftBit (IRQL) - 1
960
961 ENTER_CONFIG_MODE (3)
962 IO1L = Local0
963 IO1H = Local1
964 IRQ0 = Local3
965 ACTR = 1
966 EXIT_CONFIG_MODE ()
967 }
968 }
969 #endif
970
971 #ifndef NO_W83627HF_CIR
972 /* ========================= Consumer IR ========================= */
973 Device (CIR0)
974 {
975 Name (_HID, EisaId ("WEC1022")) /* Should be the correct one */
976 Name (_UID, "w83627hf-cir")
977 Name (_STR, Unicode("Winbond Consumer Infrared Transceiver"))
978
979 Method (_STA)
980 {
981 Local0 = 0x00
982 ENTER_CONFIG_MODE (6)
983 If (ACTR) {
984 Local0 = 0x0F
985 }
986 ElseIf (IO1H || IO1L)
987 {
988 Local0 = 0x0D
989 }
990 EXIT_CONFIG_MODE ()
991 Return (Local0)
992 }
993
994 Method (_DIS)
995 {
996 ENTER_CONFIG_MODE (6)
997 ACTR = 0
998 EXIT_CONFIG_MODE ()
999 }
1000
1001 Method (_CRS)
1002 {
1003 Name (CRS, ResourceTemplate () {
1004 IO (Decode16, 0x0000, 0x0000, 0x01, 0x08, IO0)
1005 IRQNoFlags (IRQX) {6}
1006 })
1007 ENTER_CONFIG_MODE (6)
1008 Local0 = IO1L
1009 Local1 = IO1H
1010 Local2 = IRQ0
1011 EXIT_CONFIG_MODE ()
1012 Local0 |= Local1 << 8
1013
1014 CreateWordField (CRS, IO0._MIN, IMIN)
1015 IMIN = Local0
1016 CreateWordField (CRS, IO0._MAX, IMAX)
1017 IMAX = Local0
1018
1019 CreateWordField (CRS, IRQX._INT, IRQW)
1020 Local3 = 1
1021 IRQW = Local3 << Local2
1022
1023 Return (CRS)
1024 }
1025
1026 Name (_PRS, ResourceTemplate ()
1027 {
1028 StartDependentFn (0,0) {
1029 IO (Decode16, 0x0100, 0x0FF8, 0x08, 0x08)
1030 IRQNoFlags () {3,4,5,7,9,10,11,12}
1031 }
1032 EndDependentFn()
1033 })
1034
1035 Method (_SRS, 1, Serialized)
1036 {
1037 Name (TMPL, ResourceTemplate () {
1038 IO (Decode16, 0, 0, 1, 8, IO0)
1039 IRQNoFlags (IRQX) {}
1040 })
1041 CreateWordField (Arg0, IO0._MIN, IOA0)
1042 CreateByteField (Arg0, IRQX._INT, IRQL)
1043
1044 Local0 = IOA0 % 256
1045 Local1 = IOA0 / 256
1046
1047 Local3 = FindSetLeftBit (IRQL) - 1
1048
1049 ENTER_CONFIG_MODE (6)
1050 IO1L = Local0
1051 IO1H = Local1
1052 IRQ0 = Local3
1053 ACTR = 1
1054 EXIT_CONFIG_MODE ()
1055 }
1056 }
1057 #endif
1058
1059 #ifndef NO_W83627HF_KBC
1060 /* ===================== Keyboard Controller ===================== */
1061 Device (KBD0)
1062 {
1063 Name (_HID, EisaId ("PNP0303"))
1064 Name (_UID, "w83627hf-kbc")
1065
1066 Method (_STA)
1067 {
1068 Local0 = 0x00
1069 ENTER_CONFIG_MODE (5)
1070 If (ACTR) {
1071 Local0 = 0x0F
1072 }
1073 ElseIf (IO1H || IO1L || IO2H || IO2L)
1074 {
1075 #ifdef W83627HF_KBC_COMPAT
1076 Local0 = 0x0F
1077 #else
1078 Local0 = 0x0D
1079 #endif
1080 }
1081 EXIT_CONFIG_MODE ()
1082 Return (Local0)
1083 }
1084
1085 Method (_DIS)
1086 {
1087 ENTER_CONFIG_MODE (5)
1088 ACTR = 0
1089 EXIT_CONFIG_MODE ()
1090 Notify(PS2M, 1)
1091 }
1092
1093 Method (_CRS, 0, Serialized)
1094 {
1095 Name (CRS, ResourceTemplate () {
1096 IRQNoFlags (IRQX) {}
1097 IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO0)
1098 IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO1)
1099 })
1100 ENTER_CONFIG_MODE (5)
1101 Local0 = IO1L
1102 Local1 = IO1H
1103 Local2 = IO2L
1104 Local3 = IO2H
1105 Local4 = IRQ0
1106 EXIT_CONFIG_MODE ()
1107
1108 Local0 |= Local1 << 8
1109 Local2 |= Local3 << 8
1110
1111 CreateWordField (CRS, IO0._MIN, IMIN)
1112 IMIN = Local0
1113 CreateWordField (CRS, IO0._MAX, IMAX)
1114 IMAX = Local0
1115
1116 CreateWordField (CRS, IO1._MIN, I1MI)
1117 I1MI = Local2
1118 CreateWordField (CRS, IO1._MAX, I1MA)
1119 I1MA = Local2
1120
1121 CreateWordField (CRS, IRQX._INT, IRQW)
1122 Local5 = 1
1123 IRQW = Local5 << Local4
1124
1125 Return (CRS)
1126 }
1127
1128 Name (_PRS, ResourceTemplate ()
1129 {
1130 StartDependentFn (0,0) {
1131 IRQNoFlags () {1}
1132 IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
1133 IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
1134 }
1135 EndDependentFn()
1136 })
1137
1138 Method (_SRS, 1, Serialized)
1139 {
1140 Name (TMPL, ResourceTemplate () {
1141 IRQNoFlags (IRQX) {}
1142 IO (Decode16, 0, 0, 1, 1, IO0)
1143 IO (Decode16, 0, 0, 1, 1, IO1)
1144 })
1145 CreateWordField (Arg0, IO0._MIN, IOA0)
1146 CreateWordField (Arg0, IO1._MIN, IOA1)
1147 CreateWordField (Arg0, IRQX._INT, IRQL)
1148
1149 Local0 = IOA0 % 256
1150 Local1 = IOA0 / 256
1151 Local2 = IOA1 % 256
1152 Local3 = IOA1 / 256
1153
1154 Local4 = FindSetLeftBit (IRQL) - 1
1155
1156 ENTER_CONFIG_MODE (5)
1157 IO1L = Local0
1158 IO1H = Local1
1159 IO2L = Local2
1160 IO2H = Local3
1161 IRQ0 = Local4
1162 ACTR = 1
1163 EXIT_CONFIG_MODE ()
1164 Notify(PS2M, 1)
1165 }
1166 }
1167 #ifndef NO_W83627HF_PS2M
1168 Device (PS2M)
1169 {
1170 Name (_HID, EisaId ("PNP0F13"))
1171 Name (_UID, "w83627hf-ps2m")
1172
1173 Method (_STA)
1174 {
1175 Local0 = 0x00
1176 ENTER_CONFIG_MODE (5)
1177 If (ACTR && IRQ1) {
1178 Local0 = 0x0F
1179 }
1180 ElseIf (IO1H || IO1L || IO2H || IO2L)
1181 {
1182 #ifdef W83627HF_KBC_COMPAT
1183 Local0 = 0x0F
1184 #else
1185 Local0 = 0x0D
1186 #endif
1187 }
1188 EXIT_CONFIG_MODE ()
1189 Return (Local0)
1190 }
1191
1192 Method (_DIS)
1193 {
1194 ENTER_CONFIG_MODE (5)
1195 IRQ1 = 0
1196 EXIT_CONFIG_MODE ()
1197 }
1198
1199 Method (_CRS, 0, Serialized)
1200 {
1201 Name (CRS, ResourceTemplate () {
1202 IRQNoFlags (IRQX) {}
1203 })
1204 ENTER_CONFIG_MODE (5)
1205 Local4 = IRQ1
1206 EXIT_CONFIG_MODE ()
1207
1208 CreateWordField (CRS, IRQX._INT, IRQW)
1209 Local5 = 1
1210 IRQW = Local5 << Local4
1211
1212 Return (CRS)
1213 }
1214
1215 Name (_PRS, ResourceTemplate ()
1216 {
1217 StartDependentFn (0,0) {
1218 IRQNoFlags () {12}
1219 }
1220 StartDependentFn (2,0) {
1221 IRQNoFlags () {1,3,4,5,6,7,9,10,11}
1222 }
1223 EndDependentFn()
1224 })
1225
1226 Method (_SRS, 1, Serialized)
1227 {
1228 Name (TMPL, ResourceTemplate () {
1229 IRQNoFlags (IRQX) {}
1230 })
1231 CreateWordField (Arg0, IRQX._INT, IRQL)
1232
1233 Local0 = FindSetLeftBit (IRQL) - 1
1234
1235 ENTER_CONFIG_MODE (5)
1236 IRQ1 = Local0
1237 /* Only activates if KBD is active */
1238 EXIT_CONFIG_MODE ()
1239 }
1240 }
1241 #endif
1242 #endif
1243
1244 #ifndef NO_W83627HF_GAME
1245 /* ========================== Game Port ========================== */
1246 Device (GAME)
1247 {
1248 Name (_HID, EisaId ("PNPB02F"))
1249 Name (_STR, Unicode ("Joystick/Game Port"))
1250 Name (_UID, "w83627hf-game")
1251
1252 Method (_STA) {
1253 Local0 = 0
1254 ENTER_CONFIG_MODE (7)
1255 If (IO1L || IO1H) {
1256 If (ACTR || ACT1) {
1257 Local0 = 0x0F
1258 }
1259 Else {
1260 Local0 = 0x0D
1261 }
1262 }
1263 EXIT_CONFIG_MODE ()
1264 Return (Local0)
1265 }
1266
1267 Method (_CRS)
1268 {
1269 Name (CRS, ResourceTemplate () {
1270 IO (Decode16, 0x0000, 0x0000, 0x01, 0x01, IO0)
1271 IRQNoFlags (IRQX) {}
1272 })
1273 ENTER_CONFIG_MODE (7)
1274 Local0 = IO1L
1275 Local1 = IO1H
1276 Local2 = IRQ0
1277 EXIT_CONFIG_MODE ()
1278
1279 Local0 |= Local1 << 8
1280
1281 CreateWordField (CRS, IO0._MIN, IMIN)
1282 CreateWordField (CRS, IO0._MAX, IMAX)
1283 IMIN = Local0
1284 IMAX = Local0
1285
1286 If (Local2) {
1287 CreateWordField (CRS, IRQX._INT, IRQW)
1288 Local3 = 1
1289 IRQW = Local3 << Local2
1290 }
1291
1292 Return (CRS)
1293 }
1294
1295 }
1296 #endif
1297
1298 #ifndef NO_W83627HF_MIDI
1299 /* ========================== MIDI Port ========================== */
1300 Device (MIDI)
1301 {
1302 Name (_HID, EisaId ("PNPB006"))
1303 Name (_STR, Unicode ("MPU-401 Compatible MIDI Port"))
1304 Name (_UID, "w83627hf-midi")
1305
1306 Method (_STA)
1307 {
1308 Local0 = 0
1309 ENTER_CONFIG_MODE (7)
1310 If (IO2L || IO2H) {
1311 If (ACTR || ACT2) {
1312 Local0 = 0x0F
1313 }
1314 Else {
1315 Local0 = 0x0D
1316 }
1317 }
1318 EXIT_CONFIG_MODE ()
1319 Return (Local0)
1320 }
1321
1322 Method (_CRS)
1323 {
1324 Name (CRS, ResourceTemplate () {
1325 IO (Decode16, 0x0000, 0x0000, 0x02, 0x02, IO0)
1326 IRQNoFlags (IRQX) {}
1327 })
1328 ENTER_CONFIG_MODE (7)
1329 Local0 = IO2L
1330 Local1 = IO2H
1331 Local2 = IRQ1
1332 EXIT_CONFIG_MODE ()
1333
1334 Local0 |= Local1 << 8
1335
1336 CreateWordField (CRS, IO0._MIN, IMIN)
1337 CreateWordField (CRS, IO0._MAX, IMAX)
1338 IMIN = Local0
1339 IMAX = Local0
1340
1341 If (Local2) {
1342 CreateWordField (CRS, IRQX._INT, IRQW)
1343 Local3 = 1
1344 IRQW = Local3 << Local2
1345 }
1346
1347 Return (CRS)
1348 }
1349
1350 }
1351 #endif
1352
1353 /* ==== Suspend LED control if it is connected to the SuperIO ==== */
1354 Method (SLED, 1)
1355 {
1356 ENTER_CONFIG_MODE (9)
1357 Local0 = OPT4
1358 Local0 &= 63
1359 OPT4 = Local0 | ((Arg0 & 3) << 6)
1360 EXIT_CONFIG_MODE ()
1361 }
1362
1363 /* ===== Power LED control if it is connected to the SuperIO ===== */
1364 Method (PLED, 1)
1365 {
1366 ENTER_CONFIG_MODE (8)
1367 Local0 = OPT4
1368 Local0 &= 63
1369 OPT4 = Local0 | ((Arg0 & 3) << 6)
1370 EXIT_CONFIG_MODE ()
1371 }
1372
1373 #ifndef NO_W83627HF_HWMON
1374 /* ====================== Hardware Monitor ======================= */
1375 Device (HMON)
1376 {
1377 Name (_HID, EisaId ("PNP0C02")) // TODO: find better matching ID
1378 Name (_STR, Unicode("W83627 Hardware Monitor"))
1379 Name (_UID, "w83627hf-hwmon")
1380
1381 Method (_STA)
1382 {
1383 Local0 = 0x00
1384 ENTER_CONFIG_MODE (11)
1385 If (ACTR) {
1386 Local0 = 0x0F
1387 }
1388 ElseIf (IO1H || IO1L)
1389 {
1390 Local0 = 0x0D
1391 }
1392 EXIT_CONFIG_MODE ()
1393 Return (Local0)
1394 }
1395
1396 Method (_PSC)
1397 {
1398 Local0 = ^^_PSC ()
1399 If (Local0) { Return (Local0) }
1400 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
1401 Local0 = HWPW
1402 EXIT_CONFIG_MODE ()
1403 If (Local0) { Return (3) }
1404 Else { Return (0) }
1405 }
1406
1407 Method (_PS0)
1408 {
1409 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
1410 HWPW = 1
1411 EXIT_CONFIG_MODE ()
1412 }
1413
1414 Method (_PS3)
1415 {
1416 ENTER_CONFIG_MODE (PNP_NO_LDN_CHANGE)
1417 HWPW = 0
1418 EXIT_CONFIG_MODE ()
1419 }
1420
1421 Method (_CRS, 0, Serialized)
1422 {
1423 Name (CRS, ResourceTemplate () {
1424 IO (Decode16, 0x0000, 0x0000, 0x08, 0x02, IO0)
1425 IRQNoFlags (IRQX) {}
1426 })
1427 ENTER_CONFIG_MODE (11)
1428 Local0 = IO1L
1429 Local1 = IO1H
1430 Local2 = IRQ1
1431 EXIT_CONFIG_MODE ()
1432
1433 Local0 |= Local1 << 8
1434
1435 CreateWordField (CRS, IO0._MIN, IMIN)
1436 CreateWordField (CRS, IO0._MAX, IMAX)
1437 IMIN = Local0
1438 IMAX = Local0
1439
1440 If (Local2) {
1441 CreateWordField (CRS, IRQX._INT, IRQW)
1442 Local3 = 1
1443 IRQW = Local3 << Local2
1444 }
1445 Return (CRS)
1446 }
1447 }
1448 #endif
1449
1450 /* Returns the wake source register.
1451 It is cleared after reading.
1452 Bit 0: Keyboard wake-up event
1453 Bit 1: Mouse wake-up event
1454 Bit 2: Power button event
1455 Bit 3: CIR wake-up event
1456 Bit 4: Power loss event
1457 Bit 5: VSB power loss status
1458 */
1459 Method (WAKS)
1460 {
1461 ENTER_CONFIG_MODE (10)
1462 Local0 = CRE3
1463 EXIT_CONFIG_MODE ()
1464 Return (Local0)
1465 }
1466 }