d263313fadc5952e0f715f386228d05b1e89e296
[coreboot.git] / src / ec / lenovo / h8 / h8.h
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 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.
9  *
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
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #ifndef EC_LENOVO_H8_H
21 #define EC_LENOVO_H8_H
22
23 void h8_trackpoint_enable(int on);
24 void h8_wlan_enable(int on);
25 void h8_set_audio_mute(int on);
26 void h8_enable_event(int event);
27 void h8_disable_event(int event);
28
29 /* EC registers */
30 #define H8_CONFIG0 0x00
31 #define H8_CONFIG0_EVENTS_ENABLE        0x02
32 #define H8_CONFIG0_HOTKEY_ENABLE        0x04
33 #define H8_CONFIG0_SMM_H8_ENABLE        0x20
34 #define H8_CONFIG0_TC_ENABLE            0x80
35
36 #define H8_CONFIG1 0x01
37 #define H8_CONFIG1_BKLT_LID             0x01
38 #define H8_CONFIG1_UBAY_PWR             0x20
39
40 #define H8_CONFIG2 0x02
41 #define H8_CONFIG2_USB_DOCK                     0x01
42 #define H8_CONFIG2_DOCK_SPEAKER_MUTE            0x02
43 #define H8_CONFIG2_DOCK_SPEAKER_MUTE_POL        0x04
44
45 #define H8_CONFIG3 0x03
46
47 #define H8_SOUND_ENABLE0                0x04
48 #define H8_SOUND_ENABLE1                0x05
49 #define H8_SOUND_REG                    0x06
50 #define H8_SOUND_REPEAT                 0x07
51
52 #define H8_TRACKPOINT_CTRL              0x0B
53 #define H8_TRACKPOINT_AUTO              0x01
54 #define H8_TRACKPOINT_OFF               0x02
55 #define H8_TRACKPOINT_ON                0x03
56
57 #define H8_LED_CONTROL          0x0c
58 #define H8_LED_CONTROL_OFF              0x00
59 #define H8_LED_CONTROL_ON               0x80
60 #define H8_LED_CONTROL_BLINK            0xc0
61
62 #define H8_LED_CONTROL_POWER_LED        0x00
63 #define H8_LED_CONTROL_BAT0_LED 0x01
64 #define H8_LED_CONTROL_BAT1_LED 0x02
65 #define H8_LED_CONTROL_UBAY_LED 0x04
66 #define H8_LED_CONTROL_SUSPEND_LED      0x07
67 #define H8_LED_CONTROL_DOCK_LED1        0x08
68 #define H8_LED_CONTROL_DOCK_LED2        0x09
69
70 #define H8_FAN_CONTROL                  0x2f
71 #define H8_FAN_CONTROL_AUTO             0x80
72 /* Embedded controller events */
73 #define H8_EVENT_FN_F1  0x10
74 #define H8_EVENT_FN_F2  0x11
75 #define H8_EVENT_FN_F3  0x12
76 #define H8_EVENT_FN_F4  0x13
77 #define H8_EVENT_FN_HOME        0x14
78 #define H8_EVENT_FN_END 0x15
79 #define H8_EVENT_FN_F7  0x16
80 #define H8_EVENT_FN_F8  0x17
81 #define H8_EVENT_FN_F9  0x18
82 #define H8_EVENT_FN_THINKVANTAGE        0x19
83 #define H8_EVENT_FN_F11 0x1a
84 #define H8_EVENT_FN_F12 0x1b
85 #define H8_EVENT_FN_1           0x1c
86 #define H8_EVENT_FN_2           0x1d
87 #define H8_EVENT_FN_PGUP        0x1f
88
89 #define H8_EVENT_AC_ON  0x26
90 #define H8_EVENT_AC_OFF 0x27
91
92 #define H8_EVENT_PWRSW_PRESS    0x28
93 #define H8_EVENT_PWRSW_RELEASE 0x29
94
95 #define H8_EVENT_LIDSW_CLOSE    0x2a
96 #define H8_EVENT_LIDSW_PUSH     0x2b
97
98 #define H8_EVENT_UBAY_UNLOCK    0x2c
99 #define H8_EVENT_UBAY_LOCK      0x2d
100
101 #define H8_EVENT_KEYPRESS       0x33
102
103 #define H8_EVENT_FN_PRESS       0x39
104
105 #define H8_EVENT_BAT0           0x4a
106 #define H8_EVENT_BAT0_STATE     0x4b
107
108 #define H8_EVENT_BAT1           0x4c
109 #define H8_EVENT_BAT1_STATE     0x4d
110
111 #define H8_EVENT_FN_F5 0x64
112 #define H8_EVENT_FN_F6 0x65
113 #endif