2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org>
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.
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.
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
20 #ifndef EC_LENOVO_H8_H
21 #define EC_LENOVO_H8_H
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 int h8_ultrabay_device_present(void);
31 #define H8_CONFIG0 0x00
32 #define H8_CONFIG0_EVENTS_ENABLE 0x02
33 #define H8_CONFIG0_HOTKEY_ENABLE 0x04
34 #define H8_CONFIG0_SMM_H8_ENABLE 0x20
35 #define H8_CONFIG0_TC_ENABLE 0x80
37 #define H8_CONFIG1 0x01
38 #define H8_CONFIG1_BKLT_LID 0x01
39 #define H8_CONFIG1_UBAY_PWR 0x20
41 #define H8_CONFIG2 0x02
42 #define H8_CONFIG2_USB_DOCK 0x01
43 #define H8_CONFIG2_DOCK_SPEAKER_MUTE 0x02
44 #define H8_CONFIG2_DOCK_SPEAKER_MUTE_POL 0x04
46 #define H8_CONFIG3 0x03
48 #define H8_SOUND_ENABLE0 0x04
49 #define H8_SOUND_ENABLE1 0x05
50 #define H8_SOUND_REG 0x06
51 #define H8_SOUND_REPEAT 0x07
53 #define H8_TRACKPOINT_CTRL 0x0B
54 #define H8_TRACKPOINT_AUTO 0x01
55 #define H8_TRACKPOINT_OFF 0x02
56 #define H8_TRACKPOINT_ON 0x03
58 #define H8_LED_CONTROL 0x0c
59 #define H8_LED_CONTROL_OFF 0x00
60 #define H8_LED_CONTROL_ON 0x80
61 #define H8_LED_CONTROL_BLINK 0xc0
63 #define H8_LED_CONTROL_POWER_LED 0x00
64 #define H8_LED_CONTROL_BAT0_LED 0x01
65 #define H8_LED_CONTROL_BAT1_LED 0x02
66 #define H8_LED_CONTROL_UBAY_LED 0x04
67 #define H8_LED_CONTROL_SUSPEND_LED 0x07
68 #define H8_LED_CONTROL_DOCK_LED1 0x08
69 #define H8_LED_CONTROL_DOCK_LED2 0x09
71 #define H8_FAN_CONTROL 0x2f
72 #define H8_FAN_CONTROL_AUTO 0x80
73 /* Embedded controller events */
74 #define H8_EVENT_FN_F1 0x10
75 #define H8_EVENT_FN_F2 0x11
76 #define H8_EVENT_FN_F3 0x12
77 #define H8_EVENT_FN_F4 0x13
78 #define H8_EVENT_FN_HOME 0x14
79 #define H8_EVENT_FN_END 0x15
80 #define H8_EVENT_FN_F7 0x16
81 #define H8_EVENT_FN_F8 0x17
82 #define H8_EVENT_FN_F9 0x18
83 #define H8_EVENT_FN_THINKVANTAGE 0x19
84 #define H8_EVENT_FN_F11 0x1a
85 #define H8_EVENT_FN_F12 0x1b
86 #define H8_EVENT_FN_1 0x1c
87 #define H8_EVENT_FN_2 0x1d
88 #define H8_EVENT_FN_PGUP 0x1f
90 #define H8_EVENT_AC_ON 0x26
91 #define H8_EVENT_AC_OFF 0x27
93 #define H8_EVENT_PWRSW_PRESS 0x28
94 #define H8_EVENT_PWRSW_RELEASE 0x29
96 #define H8_EVENT_LIDSW_CLOSE 0x2a
97 #define H8_EVENT_LIDSW_PUSH 0x2b
99 #define H8_EVENT_UBAY_UNLOCK 0x2c
100 #define H8_EVENT_UBAY_LOCK 0x2d
102 #define H8_EVENT_KEYPRESS 0x33
104 #define H8_EVENT_FN_PRESS 0x39
106 #define H8_STATUS0 0x46
107 #define H8_STATUS1 0x47
108 #define H8_STATUS2 0x48
110 #define H8_EVENT_BAT0 0x4a
111 #define H8_EVENT_BAT0_STATE 0x4b
113 #define H8_EVENT_BAT1 0x4c
114 #define H8_EVENT_BAT1_STATE 0x4d
116 #define H8_EVENT_FN_F5 0x64
117 #define H8_EVENT_FN_F6 0x65