bcd196173cdccbce71f48236ec972476bf2df417
[coreboot.git] / src / ec / lenovo / h8 / 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 #include "smi.h"
23 Device(EC)
24 {
25         Name (_HID, EISAID("PNP0C09"))
26         Name (_UID, 0)
27
28         Name (_GPE, 28)
29         Mutex (ECLK, 0)
30
31         OperationRegion(ERAM, EmbeddedControl, 0x00, 0x100)
32         Field (ERAM, ByteAcc, NoLock, Preserve)
33         {
34                 Offset (0x05),
35                                 HSPA, 1,
36                 Offset (0x0C),
37                                 LEDS, 8,        /* LED state */
38                 Offset (0x3a),
39                                 AMUT, 1,        /* Audio Mute */
40                 Offset (0x3B),
41                                     , 1,
42                                 KBLT, 1,        /* Keyboard Light */
43                 Offset (0x4e),
44                                WAKE, 16,
45                 Offset (0x78),
46                                 TMP0, 8,        /* Thermal Zone 0 temperature */
47                                 TMP1, 8,        /* Thermal Zone 1 temperature */
48                 Offset (0x81),
49                                 PAGE, 8         /* Information Page Selector */
50         }
51
52         Method (_CRS, 0)
53         {
54                 Name (ECMD, ResourceTemplate()
55                 {
56                         IO (Decode16, 0x62, 0x62, 1, 1)
57                         IO (Decode16, 0x66, 0x66, 1, 1)
58                 })
59                 Return (ECMD)
60         }
61
62         Method (LED, 1, NotSerialized)
63         {
64                 Store(Arg0, LEDS)
65         }
66
67         Method (_INI, 0, NotSerialized)
68         {
69         }
70
71         Method (MUTE, 1, NotSerialized)
72         {
73                 Store(Arg0, AMUT)
74         }
75
76         /* Sleep Button pressed */
77         Method(_Q13, 0, NotSerialized)
78         {
79                 Notify(\_SB.PCI0.LPCB.EC.SLPB, 0x80)
80         }
81
82         /* Brightness up GPE */
83         Method(_Q14, 0, NotSerialized)
84         {
85                 \DSPC.BRTU ()
86         }
87
88         /* Brightness down GPE */
89         Method(_Q15, 0, NotSerialized)
90         {
91                 \DSPC.BRTD()
92         }
93
94         /* AC status change: present */
95         Method(_Q26, 0, NotSerialized)
96         {
97                 Notify (AC, 0x80)
98         }
99
100         /* AC status change: not present */
101         Method(_Q27, 0, NotSerialized)
102         {
103                 Notify (AC, 0x80)
104         }
105
106        Method(_Q2A, 0, NotSerialized)
107        {
108                Notify(\_SB.PCI0.LPCB.EC.LID, 0x80)
109        }
110
111        Method(_Q2B, 0, NotSerialized)
112        {
113                Notify(\_SB.PCI0.LPCB.EC.LID, 0x80)
114        }
115
116
117 #include "ac.asl"
118 #include "battery.asl"
119 #include "sleepbutton.asl"
120 #include "lid.asl"
121 #include "beep.asl"
122 #include "thermal.asl"
123 }