blob: feecac3dbbf1bf469f76270e57247646ec6c9cf2 [file] [log] [blame]
Duncan Laurieddc3e422013-10-02 16:10:54 -07001/*
2 * This file is part of the coreboot project.
3 *
Duncan Laurie25c6f752014-05-22 08:25:36 -07004 * Copyright (C) 2014 Google Inc.
Duncan Laurieddc3e422013-10-02 16:10:54 -07005 *
Duncan Laurie25c6f752014-05-22 08:25:36 -07006 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
Duncan Laurieddc3e422013-10-02 16:10:54 -07009 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Duncan Laurie25c6f752014-05-22 08:25:36 -070017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Duncan Laurieddc3e422013-10-02 16:10:54 -070018 */
19
Duncan Laurie3b6a88e2014-09-29 09:27:13 -070020#undef ENABLE_TOUCH_WAKE
21
Duncan Laurieddc3e422013-10-02 16:10:54 -070022Scope (\_SB)
23{
24 Device (LID0)
25 {
Duncan Laurie25c6f752014-05-22 08:25:36 -070026 Name (_HID, EisaId("PNP0C0D"))
27 Method (_LID, 0)
Duncan Laurieddc3e422013-10-02 16:10:54 -070028 {
Duncan Laurie25c6f752014-05-22 08:25:36 -070029 Return (\_SB.PCI0.LPCB.EC0.LIDS)
Duncan Laurieddc3e422013-10-02 16:10:54 -070030 }
31
Duncan Lauriebe19c542014-08-22 13:36:12 -070032 // EC wake is GPIO27 which is a special DeepSX wake pin
33 Name (_PRW, Package(){ 0x70, 5 }) // GP27_EN
Duncan Laurieddc3e422013-10-02 16:10:54 -070034 }
35
36 Device (PWRB)
37 {
38 Name(_HID, EisaId("PNP0C0C"))
39 }
40
Duncan Laurie515d3d22014-07-15 13:36:52 -070041 // Keyboard Backlight interface via EC
42 Device (KBLT) {
43 Name (_HID, "GOOG0002")
44 Name (_UID, 1)
45
46 // Read current backlight value
47 Method (KBQC, 0)
48 {
49 Return (\_SB.PCI0.LPCB.EC0.KBLV)
50 }
51
52 // Write new backlight value
53 Method (KBCM, 1)
54 {
55 Store (Arg0, \_SB.PCI0.LPCB.EC0.KBLV)
56 }
57 }
Duncan Laurie25c6f752014-05-22 08:25:36 -070058}
59
Duncan Laurie17b78662014-08-11 08:06:04 -070060/*
61 * WLAN connected to Root Port 3, becomes Root Port 1 after coalesce
62 */
63Scope (\_SB.PCI0.RP01)
64{
65 Device (WLAN)
66 {
67 Name (_ADR, 0x00000000)
68
69 /* GPIO10 is PCH_WLAN_WAKE_L */
70 Name (GPIO, 10)
71
72 Name (_PRW, Package() { GPIO, 3 })
73
74 Method (_DSW, 3, NotSerialized)
75 {
76 If (LEqual (Arg0, 1)) {
77 // Enable GPIO as wake source
78 \_SB.PCI0.LPCB.GPIO.GWAK (^GPIO)
79 }
80 }
81 }
82}
83
Duncan Laurie25c6f752014-05-22 08:25:36 -070084Scope (\_SB.PCI0.I2C0)
85{
86 Device (ATPB)
87 {
88 Name (_HID, "ATML0000")
89 Name (_DDN, "Atmel Touchpad Bootloader")
90 Name (_UID, 1)
91 Name (_S0W, 4)
92 Name (ISTP, 1) /* Touchpad */
Duncan Laurieddc3e422013-10-02 16:10:54 -070093
94 Name (_CRS, ResourceTemplate()
95 {
Duncan Laurie25c6f752014-05-22 08:25:36 -070096 I2cSerialBus (
Duncan Lauriec2531892014-06-18 14:03:08 +080097 0x26, // SlaveAddress
Duncan Laurie25c6f752014-05-22 08:25:36 -070098 ControllerInitiated, // SlaveMode
99 400000, // ConnectionSpeed
100 AddressingMode7Bit, // AddressingMode
101 "\\_SB.PCI0.I2C0", // ResourceSource
102 )
Duncan Laurieddc3e422013-10-02 16:10:54 -0700103
Duncan Laurie25c6f752014-05-22 08:25:36 -0700104 // GPIO13 is PIRQL
105 Interrupt (ResourceConsumer, Edge, ActiveLow) { 27 }
Duncan Laurieddc3e422013-10-02 16:10:54 -0700106 })
Duncan Laurie25c6f752014-05-22 08:25:36 -0700107
108 Method (_STA)
109 {
110 If (LEqual (\S1EN, 1)) {
111 Return (0xF)
112 } Else {
113 Return (0x0)
114 }
115 }
116 }
117
118 Device (ATPA)
119 {
120 Name (_HID, "ATML0000")
121 Name (_DDN, "Atmel Touchpad")
122 Name (_UID, 2)
123 Name (_S0W, 4)
124 Name (ISTP, 1) /* Touchpad */
Duncan Lauriec37dd502014-11-03 12:48:11 -0800125 Name (GPIO, 9) /* TRACKPAD_INT_L (WAKE) */
Duncan Laurie25c6f752014-05-22 08:25:36 -0700126
127 Name (_CRS, ResourceTemplate()
128 {
129 I2cSerialBus (
Duncan Lauriec2531892014-06-18 14:03:08 +0800130 0x4a, // SlaveAddress
Duncan Laurie25c6f752014-05-22 08:25:36 -0700131 ControllerInitiated, // SlaveMode
132 400000, // ConnectionSpeed
133 AddressingMode7Bit, // AddressingMode
134 "\\_SB.PCI0.I2C0", // ResourceSource
135 )
136
137 // GPIO13 is PIRQL
138 Interrupt (ResourceConsumer, Edge, ActiveLow) { 27 }
139 })
140
Duncan Laurie3b6a88e2014-09-29 09:27:13 -0700141 Name (_PRW, Package() { GPIO, 3 })
142
Duncan Laurie3b6a88e2014-09-29 09:27:13 -0700143 Method (_DSW, 3, NotSerialized)
144 {
145 If (LEqual (Arg0, 1)) {
146 // Enable GPIO as wake source
147 \_SB.PCI0.LPCB.GPIO.GWAK (^GPIO)
148 }
149 }
Duncan Laurie3b6a88e2014-09-29 09:27:13 -0700150
Duncan Laurie25c6f752014-05-22 08:25:36 -0700151 Method (_STA)
152 {
153 If (LEqual (\S1EN, 1)) {
154 Return (0xF)
155 } Else {
156 Return (0x0)
157 }
158 }
159 }
Kane Chen00aedc52014-07-11 16:24:39 -0700160
161 Device (CODC)
162 {
163 /*
164 * TODO(kane): Need official HID.
165 *
166 */
167 Name (_HID, "RT5677CE")
168 Name (_DDN, "RT5667 Codec")
169 Name (_UID, 1)
Duncan Laurie84297862014-09-29 09:30:36 -0700170 Name (WAKE, 45) /* DSP_INT (use as codec wake) */
171
Duncan Laurie88b004d2014-10-03 15:33:10 -0700172 Name (DCLK, 0) /* RT5677_DMIC_CLK1 */
173 Name (IN1, 1) /* IN1 differential */
174 Name (IN2, 0) /* IN2 not differential */
175 Name (OUT1, 1) /* LOUT1 differential */
176 Name (OUT2, 1) /* LOUT2 differential */
177 Name (OUT3, 0) /* LOUT3 differential */
178 Name (ASRC, 1) /* Enable I2S1 ASRC */
Ben Zhange1ca8a32014-10-20 17:27:42 -0700179 Name (JD1, 0) /* JackDetect1 is not used */
180 Name (JD2, 2) /* Use GPIO5 as JackDetect2 */
181 Name (JD3, 3) /* Use GPIO6 as JackDetect3 */
Duncan Laurie88b004d2014-10-03 15:33:10 -0700182
Kane Chen00aedc52014-07-11 16:24:39 -0700183 Name (_CRS, ResourceTemplate()
184 {
185 I2cSerialBus (
186 0x2c, // SlaveAddress
187 ControllerInitiated, // SlaveMode
188 400000, // ConnectionSpeed
189 AddressingMode7Bit, // AddressingMode
Paul Menzele0b6fbd2015-01-19 12:58:25 +0100190 "\\_SB.PCI0.I2C0", // ResourceSource
Kane Chen00aedc52014-07-11 16:24:39 -0700191 )
Duncan Laurie84297862014-09-29 09:30:36 -0700192
193 /* GPIO46 is PIRQO (use HOTWORD_DET as codec IRQ) */
Ben Zhangdcf2d382014-09-30 12:55:04 -0700194 Interrupt (ResourceConsumer, Edge, ActiveHigh) { 30 }
Duncan Laurie84297862014-09-29 09:30:36 -0700195
196 /*
197 * Codec GPIOs are 1-based in the schematic
198 *
199 * [0] = Jack Detect (INPUT)
200 * [1] = Mic Present (INPUT)
201 * [2] = Interrupt to the host (OUTPUT)
202 * [3] = Interrupt to the host (OUTPUT)
Ben Zhangd4161242014-09-30 17:00:05 -0700203 * [4] = Headphone amp control (OUTPUT)
Duncan Laurie84297862014-09-29 09:30:36 -0700204 */
205
206 /* Index 0: Jack Detect - PLUG_DET is GPIO5 */
207 GpioIo (Exclusive, PullUp, , , IoRestrictionInputOnly,
208 "\\_SB.PCI0.I2C0.CODC") { 4 }
209
210 /* Index 1: Mic Present - MIC_PRESENT_L is GPIO6 */
211 GpioIo (Exclusive, PullUp, , , IoRestrictionInputOnly,
212 "\\_SB.PCI0.I2C0.CODC") { 5 }
213
214 /* Index 2: Codec IRQ - HOTWORD_DET_L is GPIO1 */
215 GpioIo (Exclusive, PullUp, , , IoRestrictionOutputOnly,
216 "\\_SB.PCI0.I2C0.CODC") { 0 }
217
218 /* Index 3: Codec Wake - DSP_INT is GPIO4 */
219 GpioIo (Exclusive, PullUp, , , IoRestrictionOutputOnly,
220 "\\_SB.PCI0.I2C0.CODC") { 3 }
Ben Zhangd4161242014-09-30 17:00:05 -0700221
222 /* Index 4: Headphone amp - HP_AMP_SHDN_L is GPIO2 */
223 GpioIo (Exclusive, PullDown, , , IoRestrictionOutputOnly,
224 "\\_SB.PCI0.I2C0.CODC") { 1 }
Kane Chen00aedc52014-07-11 16:24:39 -0700225 })
Duncan Laurie84297862014-09-29 09:30:36 -0700226
227 Name (_PRW, Package() { WAKE, 3 })
228
229 Method (_DSW, 3, NotSerialized)
230 {
231 If (LEqual (Arg0, 1)) {
232 // Enable GPIO as wake source
233 \_SB.PCI0.LPCB.GPIO.GWAK (^WAKE)
234 }
235 }
236
Kane Chen00aedc52014-07-11 16:24:39 -0700237 Method (_STA)
238 {
239 If (LEqual (\S1EN, 1)) {
240 Return (0xF)
241 } Else {
242 Return (0x0)
243 }
244 }
245 }
Duncan Laurie25c6f752014-05-22 08:25:36 -0700246}
247
248Scope (\_SB.PCI0.I2C1)
249{
250 Device (ATSB)
251 {
252 Name (_HID, "ATML0001")
253 Name (_DDN, "Atmel Touchscreen Bootloader")
254 Name (_UID, 4)
255 Name (_S0W, 4)
256 Name (ISTP, 0) /* TouchScreen */
257
258 Name (_CRS, ResourceTemplate()
259 {
260 I2cSerialBus (
261 0x25, // SlaveAddress
262 ControllerInitiated, // SlaveMode
263 400000, // ConnectionSpeed
264 AddressingMode7Bit, // AddressingMode
265 "\\_SB.PCI0.I2C1", // ResourceSource
266 )
267
268 // GPIO14 is PIRQM
269 Interrupt (ResourceConsumer, Edge, ActiveLow) { 28 }
270 })
271
272 Method (_STA)
273 {
274 If (LEqual (\S2EN, 1)) {
275 Return (0xF)
276 } Else {
277 Return (0x0)
278 }
279 }
280 }
281
282 Device (ATSA)
283 {
284 Name (_HID, "ATML0001")
285 Name (_DDN, "Atmel Touchscreen")
286 Name (_UID, 5)
287 Name (_S0W, 4)
288 Name (ISTP, 0) /* TouchScreen */
Duncan Laurie3b6a88e2014-09-29 09:27:13 -0700289 Name (GPIO, 14) /* TOUCH_INT_L */
Duncan Laurie25c6f752014-05-22 08:25:36 -0700290
291 Name (_CRS, ResourceTemplate()
292 {
293 I2cSerialBus (
294 0x4b, // SlaveAddress
295 ControllerInitiated, // SlaveMode
296 400000, // ConnectionSpeed
297 AddressingMode7Bit, // AddressingMode
298 "\\_SB.PCI0.I2C1", // ResourceSource
299 )
300
301 // GPIO14 is PIRQM
302 Interrupt (ResourceConsumer, Edge, ActiveLow) { 28 }
303 })
304
Duncan Lauriec37dd502014-11-03 12:48:11 -0800305#ifdef ENABLE_TOUCH_WAKE
Duncan Laurie3b6a88e2014-09-29 09:27:13 -0700306 Name (_PRW, Package() { GPIO, 3 })
307
Duncan Laurie3b6a88e2014-09-29 09:27:13 -0700308 Method (_DSW, 3, NotSerialized)
309 {
310 If (LEqual (Arg0, 1)) {
311 // Enable GPIO as wake source
312 \_SB.PCI0.LPCB.GPIO.GWAK (^GPIO)
313 }
314 }
315#endif
316
Duncan Laurie25c6f752014-05-22 08:25:36 -0700317 Method (_STA)
318 {
319 If (LEqual (\S2EN, 1)) {
320 Return (0xF)
321 } Else {
322 Return (0x0)
323 }
324 }
Duncan Laurieddc3e422013-10-02 16:10:54 -0700325 }
326}