c805e5aef3e28639bb43aa7e2ff4f9ebce59c6c2
[coreboot.git] / src / mainboard / lenovo / x60 / acpi / ec.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (c) 2011 Sven Schnelle <svens@stackframe.org>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; version 2 of
9  * the License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19  * MA 02110-1301 USA
20  */
21
22 Device(EC)
23 {
24         Name (_HID, EISAID("PNP0C09"))
25         Name (_UID, 0)
26
27         Name (_GPE, 28)
28         Mutex (ECLK, 0)
29
30         OperationRegion(ERAM, EmbeddedControl, 0x00, 0x100)
31         Field (ERAM, ByteAcc, NoLock, Preserve)
32         {
33                 Offset (0x05),
34                                 HSPA, 1,
35                 Offset (0x0C),
36                                 LEDS, 8,        /* LED state */
37                 Offset (0x3B),
38                                     , 1,
39                                 KBLT, 1,        /* Keyboard Light */
40                 Offset (0x4e),
41                                WAKE, 16,
42                 Offset (0x78),
43                                 TMP0, 8,        /* Thermal Zone 0 temperature */
44                                 TMP1, 8,        /* Thermal Zone 1 temperature */
45                 Offset (0x81),
46                                 PAGE, 8         /* Information Page Selector */
47         }
48
49         Method (_CRS, 0)
50         {
51                 Name (ECMD, ResourceTemplate()
52                 {
53                         IO (Decode16, 0x62, 0x62, 1, 1)
54                         IO (Decode16, 0x66, 0x66, 1, 1)
55                 })
56                 Return (ECMD)
57         }
58
59         Method (LED, 1, NotSerialized)
60         {
61                 Store(Arg0, LEDS)
62         }
63
64         Method (_INI, 0, NotSerialized)
65         {
66         }
67
68         /* Sleep Button pressed */
69         Method(_Q13, 0, NotSerialized)
70         {
71                 Notify(\_SB.PCI0.LPCB.EC.SLPB, 0x80)
72         }
73
74         /* Brightness up GPE */
75         Method(_Q14, 0, NotSerialized)
76         {
77                 \DSPC.BRTU ()
78         }
79
80         /* Brightness down GPE */
81         Method(_Q15, 0, NotSerialized)
82         {
83                 \DSPC.BRTD()
84         }
85
86         /* AC status change: present */
87         Method(_Q26, 0, NotSerialized)
88         {
89                 Notify (AC, 0x80)
90         }
91
92         /* AC status change: not present */
93         Method(_Q27, 0, NotSerialized)
94         {
95                 Notify (AC, 0x80)
96         }
97
98
99 #include "ac.asl"
100 #include "battery.asl"
101 #include "sleepbutton.asl"
102 #include "lid.asl"
103 #include "beep.asl"
104 }