Lenovo H8 EC: add usb_power_enable()
[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                                     , 2,
44                                 USPW, 1,        /* USB Power enable */
45                 Offset (0x4e),
46                                WAKE, 16,
47                 Offset (0x78),
48                                 TMP0, 8,        /* Thermal Zone 0 temperature */
49                                 TMP1, 8,        /* Thermal Zone 1 temperature */
50                 Offset (0x81),
51                                 PAGE, 8         /* Information Page Selector */
52         }
53
54         Method (_CRS, 0)
55         {
56                 Name (ECMD, ResourceTemplate()
57                 {
58                         IO (Decode16, 0x62, 0x62, 1, 1)
59                         IO (Decode16, 0x66, 0x66, 1, 1)
60                 })
61                 Return (ECMD)
62         }
63
64         Method (LED, 1, NotSerialized)
65         {
66                 Store(Arg0, LEDS)
67         }
68
69         Method (_INI, 0, NotSerialized)
70         {
71         }
72
73         Method (MUTE, 1, NotSerialized)
74         {
75                 Store(Arg0, AMUT)
76         }
77
78         Method (USBP, 1, NotSerialized)
79         {
80                 Store(Arg0, USPW)
81         }
82
83
84         /* Sleep Button pressed */
85         Method(_Q13, 0, NotSerialized)
86         {
87                 Notify(\_SB.PCI0.LPCB.EC.SLPB, 0x80)
88         }
89
90         /* Brightness up GPE */
91         Method(_Q14, 0, NotSerialized)
92         {
93                 \DSPC.BRTU ()
94         }
95
96         /* Brightness down GPE */
97         Method(_Q15, 0, NotSerialized)
98         {
99                 \DSPC.BRTD()
100         }
101
102         /* AC status change: present */
103         Method(_Q26, 0, NotSerialized)
104         {
105                 Notify (AC, 0x80)
106         }
107
108         /* AC status change: not present */
109         Method(_Q27, 0, NotSerialized)
110         {
111                 Notify (AC, 0x80)
112         }
113
114        Method(_Q2A, 0, NotSerialized)
115        {
116                Notify(\_SB.PCI0.LPCB.EC.LID, 0x80)
117        }
118
119        Method(_Q2B, 0, NotSerialized)
120        {
121                Notify(\_SB.PCI0.LPCB.EC.LID, 0x80)
122        }
123
124
125 #include "ac.asl"
126 #include "battery.asl"
127 #include "sleepbutton.asl"
128 #include "lid.asl"
129 #include "beep.asl"
130 #include "thermal.asl"
131 #include "systemstatus.asl"
132 }