1 /* SPDX-License-Identifier: GPL-2.0-only */
10 Name (RBUF, ResourceTemplate ()
12 DWordIo (ResourceProducer,
13 MinFixed, // IsMinFixed
14 MaxFixed, // IsMaxFixed
16 EntireRange, // ISARanges
17 0x00000000, // AddressGranularity
18 0x00000000, // AddressMinimum
19 0x00000000, // AddressMaximum
20 0x00000000, // AddressTranslation
21 0x00000000, // RangeLength
22 , // ResourceSourceIndex
25 // Disabled due to IRQ storm: http://crosbug.com/p/29548
26 //Interrupt (ResourceConsumer,
27 // Level, ActiveHigh, Shared, , , ) {14}
30 Method (_CRS, 0, NotSerialized)
32 CreateDwordField (^RBUF, ^BAR0._MIN, BMIN)
33 CreateDwordField (^RBUF, ^BAR0._MAX, BMAX)
34 CreateDwordField (^RBUF, ^BAR0._LEN, BLEN)
36 BLEN = DEFAULT_GPIOSIZE
37 BMIN = DEFAULT_GPIOBASE
38 BMAX = DEFAULT_GPIOBASE + DEFAULT_GPIOSIZE - 1
43 Method (_STA, 0, NotSerialized)
48 // GWAK: Setup GPIO as ACPI GPE for Wake
50 Method (GWAK, 1, Serialized)
52 // Local0 = GPIO Base Address
55 // Local1 = BANK, Local2 = OFFSET
63 // Local3 = GPIOBASE + GPIO_OWN(BANK)
64 Local3 = Local0 + Local1 * 4
67 OperationRegion (IOWN, SystemIO, Local3, 4)
68 Field (IOWN, AnyAcc, NoLock, Preserve) {
72 // GPIO_OWN[GPIO] = 0 (ACPI)
73 GOWN &= ~(1 << Local2)
79 // Local3 = GPIOBASE + GPIO_ROUTE(BANK)
80 Local3 = Local0 + 0x30 + Local1 * 4
83 OperationRegion (IROU, SystemIO, Local3, 4)
84 Field (IROU, AnyAcc, NoLock, Preserve) {
88 // GPIO_ROUTE[GPIO] = 0 (SCI)
89 GROU &= ~(1 << Local2)
92 // Set GPnCONFIG to GPIO|INPUT|INVERT
95 // Local3 = GPIOBASE + GPnCONFIG0(GPIO)
96 Local3 = Local0 + 0x100 + Arg0 * 8
99 OperationRegion (GPNC, SystemIO, Local3, 8)
100 Field (GPNC, AnyAcc, NoLock, Preserve) {
101 GMOD, 1, // MODE: 0=NATIVE 1=GPIO
103 GIOS, 1, // IO_SEL: 0=OUTPUT 1=INPUT
104 GINV, 1, // INVERT: 0=NORMAL 1=INVERT
105 GLES, 1, // LxEB: 0=EDGE 1=LEVEL
107 ILVL, 1, // INPUT: 0=LOW 1=HIGH
108 OLVL, 1, // OUTPUT: 0=LOW 1=HIGH
109 GPWP, 2, // PULLUP: 00=NONE 01=DOWN 10=UP 11=INVALID
110 ISEN, 1, // SENSE: 0=ENABLE 1=DISABLE