cyan/strago: disable Ambient Light Sensor device
[coreboot.git] / src / mainboard / intel / strago / acpi / mainboard.asl
blobeefa005cc38bb6c62dd8bb8b121bf906c3613095
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2012 Google Inc.
5  * Copyright (C) 2015 Intel Corp.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; version 2 of
10  * the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc.
20  */
22 #include "onboard.h"
24 Scope (\_SB)
26         Device (LID0)
27         {
28                 Name (_HID, EisaId ("PNP0C0D"))
29                 Method (_LID, 0)
30                 {
31                         Store (\_SB.PCI0.LPCB.EC0.LIDS, \LIDS)
32                         Return (\LIDS)
33                 }
34         }
36         Device (PWRB)
37         {
38                 Name (_HID, EisaId ("PNP0C0C"))
39                 Name (_UID, 1)
40         }
44  * LPC Trusted Platform Module
45  */
46 Scope (\_SB.PCI0.LPCB)
48         #include <drivers/pc80/tpm/acpi/tpm.asl>
50 Scope (\_SB.I2C1)
52         Device (ATSB)
53         {
54                 Name (_HID, "ATML0001")
55                 Name (_DDN, "Atmel Touchscreen Bootloader")
56                 Name (_UID, 4)
57                 Name (ISTP, 0) /* TouchScreen */
59                 Method(_CRS, 0x0, NotSerialized)
60                 {
61                         Name (BUF0, ResourceTemplate ()
62                         {
63                                 I2cSerialBus(
64                                         0x26,                     /* SlaveAddress */
65                                         ControllerInitiated,      /* SlaveMode */
66                                         400000,                   /* ConnectionSpeed */
67                                         AddressingMode7Bit,       /* AddressingMode */
68                                         "\\_SB.I2C1",             /* ResourceSource */
69                                 )
70                                 Interrupt (ResourceConsumer, Edge, ActiveLow)
71                                 {
72                                         BOARD_TOUCH_IRQ
73                                 }
74                         })
75                         Name (BUF1, ResourceTemplate ()
76                         {
77                                 I2cSerialBus(
78                                         0x26,                     /* SlaveAddress */
79                                         ControllerInitiated,      /* SlaveMode */
80                                         400000,                   /* ConnectionSpeed */
81                                         AddressingMode7Bit,       /* AddressingMode */
82                                         "\\_SB.I2C1",             /* ResourceSource */
83                                 )
84                                 Interrupt (ResourceConsumer, Edge, ActiveLow)
85                                 {
86                                         BOARD_DVT_TOUCH_IRQ
87                                 }
88                         })
89                         If (LEqual (\BDID, BOARD_EVT)) {
90                                 Return (BUF0)
91                         } Else {
92                                 Return (BUF1)
93                         }
94                 }
96                 Method (_STA)
97                 {
98                         If (LEqual (\S1EN, 1)) {
99                                 Return (0xF)
100                         } Else {
101                                 Return (0x0)
102                         }
103                 }
105                 /* Allow device to power off in S0 */
106                 Name (_S0W, 4)
107         }
109         Device (ATSA)
110         {
111                 Name (_HID, "ATML0001")
112                 Name (_DDN, "Atmel Touchscreen")
113                 Name (_UID, 5)
114                 Name (ISTP, 0) /* TouchScreen */
116                 Method(_CRS, 0x0, NotSerialized)
117                 {
118                         Name (BUF0, ResourceTemplate ()
119                         {
120                                 I2cSerialBus(
121                                         0x4b,                     /* SlaveAddress */
122                                         ControllerInitiated,      /* SlaveMode */
123                                         400000,                   /* ConnectionSpeed */
124                                         AddressingMode7Bit,       /* AddressingMode */
125                                         "\\_SB.I2C1",             /* ResourceSource */
126                                 )
127                                 Interrupt (ResourceConsumer, Edge, ActiveLow)
128                                 {
129                                         BOARD_TOUCH_IRQ
130                                 }
131                         })
132                         Name (BUF1, ResourceTemplate ()
133                         {
134                                 I2cSerialBus(
135                                         0x4b,                     /* SlaveAddress */
136                                         ControllerInitiated,      /* SlaveMode */
137                                         400000,                   /* ConnectionSpeed */
138                                         AddressingMode7Bit,       /* AddressingMode */
139                                         "\\_SB.I2C1",             /* ResourceSource */
140                                 )
141                                 Interrupt (ResourceConsumer, Edge, ActiveLow)
142                                 {
143                                         BOARD_DVT_TOUCH_IRQ
144                                 }
145                         })
146                         If (LEqual (\BDID, BOARD_EVT)) {
147                                 Return (BUF0)
148                         } Else {
149                                 Return (BUF1)
150                         }
151                 }
153                 Method (_STA)
154                 {
155                         If (LEqual (\S1EN, 1)) {
156                                 Return (0xF)
157                         } Else {
158                                 Return (0x0)
159                         }
160                 }
162                 Name (_PRW, Package() { BOARD_TOUCHSCREEN_WAKE_GPIO, 0x3 })
164                 /* Allow device to power off in S0 */
165                 Name (_S0W, 4)
166         }
169 Scope (\_SB.I2C5)
172         /* Realtek Audio Codec */
173         Device (RTEK)   /* Audio Codec driver I2C */
174         {
175                 Name (_ADR, 0)
176                 Name (_HID, AUDIO_CODEC_HID)
177                 Name (_CID, AUDIO_CODEC_CID)
178                 Name (_DDN, AUDIO_CODEC_DDN)
179                 Name (_UID, 1)
181                 Method(_CRS, 0x0, NotSerialized)
182                 {
183                         Name(SBUF,ResourceTemplate ()
184                         {
185                                 I2CSerialBus(
186                                         AUDIO_CODEC_I2C_ADDR,   /* SlaveAddress: bus address */
187                                         ControllerInitiated,    /* SlaveMode: default to ControllerInitiated */
188                                         400000,                 /* ConnectionSpeed: in Hz */
189                                         AddressingMode7Bit,     /* Addressing Mode: default to 7 bit */
190                                         "\\_SB.I2C5",           /* ResourceSource: I2C bus controller name */
191                                 )
194                          /* Jack Detect (index 0) */
195                          GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
196                                   "\\_SB.GPSW") { JACK_DETECT_GPIO_INDEX }
197                         } )
198                         Return (SBUF)
199                 }
201                 Method (_STA)
202                 {
203                         If (LEqual (\S5EN, 1)) {
204                                 If (LEqual (\BDID, BOARD_BCRD2)) {
205                                         Return (0xF)
206                                 }
207                         }
208                         Return (0x0)
209                 }
210         }
213 Scope (\_SB.I2C6)
215         Device (ETPA)
216         {
217                 Name (_HID, "ELAN0000")
218                 Name (_DDN, "Elan Touchpad")
219                 Name (_UID, 3)
220                 Name (ISTP, 1) /* Touchpad */
222                 Name (_CRS, ResourceTemplate()
223                 {
224                         I2cSerialBus (
225                                 0x15,                     /* SlaveAddress */
226                                 ControllerInitiated,      /* SlaveMode */
227                                 400000,                   /* ConnectionSpeed */
228                                 AddressingMode7Bit,       /* AddressingMode */
229                                 "\\_SB.I2C6",             /* ResourceSource */
230                         )
231                         GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
232                                  "\\_SB.GPNC") { BOARD_TRACKPAD_GPIO_INDEX }
233                 })
235                 Method (_STA)
236                 {
237                         If (LEqual (\S6EN, 1)) {
238                                 Return (0xF)
239                         } Else {
240                                 Return (0x0)
241                         }
242                 }
244                 Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 })
245                 /* Allow device to power off in S0 */
246                 Name (_S0W, 4)
247         }
250 Scope (\_SB.LPEA)
252         Name (GBUF, ResourceTemplate ()
253         {
254                 /* Jack Detect (index 0) */
255                 GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
256                          "\\_SB.GPSW") { JACK_DETECT_GPIO_INDEX }
257         })
260 Scope (\_SB.GPNC)
262         Method (_AEI, 0, NotSerialized)  // _AEI: ACPI Event Interrupts
263         {
264                 Name (RBUF, ResourceTemplate ()
265                 {
266                         GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
267                                 "\\_SB.GPNC") { BOARD_SCI_GPIO_INDEX }
268                 })
269                 Return (RBUF)
270         }
272         Method (_E0F, 0, NotSerialized)  // _Exx: Edge-Triggered GPE
273         {
274         }