Mass update FSF address
[dockapps.git] / wmpower / src / power_management / toshiba / sci.h
blob6f51e6ea5878850d476d77cda552e62ace182fad
1 /* sci.h -- System Configuration Interface
3 * Copyright (c) 1998 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
5 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
7 * This code is covered by the GNU GPL and you are free to make any
8 * changes you wish to it under the terms of the license. However the
9 * code has the potential to render your computer and/or someone else's
10 * unuseable. Unless you truely understand what is going on, I urge you
11 * not to make any modifications and use it as it stands.
13 * $Log: sci.h,v $
14 * Revision 1.2 2004/03/27 12:59:15 noberasco
15 * see CL
17 * Revision 1.1 2003/09/18 16:38:27 noberasco
18 * overhaul III
20 * Revision 1.1.1.1 2003/06/05 09:34:03 noberasco
21 * Initial import.
23 * Revision 1.11 2001/10/05 13:08:37 jab
24 * checked in changes for kernel module
26 * Revision 1.10 1999/12/18 14:33:44 jab
27 * removed prototype for SciGetModel
29 * Revision 1.9 1999/12/04 13:41:23 jab
30 * modified SCI_DATE macro to exclude the year and added SCI_FULLDATE macro
32 * Revision 1.8 1999/03/11 20:23:18 jab
33 * added macros to manipulate date type
34 * updated some of the enumerations and added a few more
36 * Revision 1.7 1999/03/06 16:47:12 jab
37 * removed declarations for BiosVersion and MachineID functions
39 * Revision 1.6 1998/09/07 18:15:50 jab
40 * added prototype for new model fuction
41 * added a structure for the system configuration interface registers
43 * Revision 1.5 1998/08/23 12:17:36 jab
44 * added the SCI_BATTERY/SCI_MAINS values
46 * Revision 1.4 1998/08/19 08:42:29 jab
47 * added extern "C" declaration in case anyone uses this with C++
48 * fixed the declaration of SCI_SUCSSES/SCI_FAILURE
49 * other miscellaneous tidy ups
51 * Revision 1.3 1998/08/06 08:25:36 jab
52 * changed defines to enums and prepended everything with sci_
54 * Revision 1.2 1998/08/04 08:07:46 jab
55 * added some extra information from Japanesse Libretto effort
57 * Revision 1.1 1998/05/23 08:08:17 jab
58 * Initial revision
61 * This program is free software; you can redistribute it and/or modify
62 * it under the terms of the GNU General Public License as published by
63 * the Free Software Foundation; either version 2 of the License, or
64 * (at your option) any later version.
66 * This program is distributed in the hope that it will be useful,
67 * but WITHOUT ANY WARRANTY; without even the implied warranty of
68 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69 * GNU General Public License for more details.
71 * You should have received a copy of the GNU General Public License
72 * along with this program; if not, write to the Free Software
73 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
77 #ifndef SCI_H
78 #define SCI_H
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
84 #ifndef LINUX_TOSHIBA_H
85 #define LINUX_TOSHIBA_H
86 #include<linux/toshiba.h>
87 #endif
91 * the different modes that can be changed
93 enum {
94 SCI_POWER_UP = 0x0100,
95 SCI_BATTERY_SAVE = 0x0101,
96 SCI_PROCESSING = 0x0102,
97 SCI_SLEEP_MODE = 0x0104,
98 SCI_DISPLAY_AUTO = 0x0105,
99 SCI_HDD_AUTO_OFF = 0x0106,
100 SCI_CPU_CACHE = 0x0108,
101 SCI_SPEAKER_VOLUME = 0x0109,
102 SCI_SYSTEM_BEEP = 0x010a,
103 SCI_BATTERY_ALARM = 0x010b,
104 SCI_PANEL_ALARM = 0x010c,
105 SCI_PANEL_POWER = 0x010d,
106 SCI_ALARM_DATE = 0x010e,
107 SCI_ALARM_TIME = 0x010f,
108 SCI_ALARM_POWER = 0x010f,
109 SCI_SYSTEM_AUTO = 0x0110,
110 SCI_BATTERY_PERCENT = 0x0111,
111 SCI_BATTERY_TIME = 0x0112,
112 SCI_LCD_BRIGHTNESS = 0x0115,
113 SCI_LCD_MAXBRIGHT = 0x011b,
114 SCI_BOOT_METHOD = 0x011d,
115 SCI_2ND_BATTERY = 0x011e,
116 SCI_CACHE_POLICY = 0x011f,
117 SCI_COOLING_METHOD = 0x0122,
118 SCI_STANDBY_TIME = 0x0125,
119 SCI_HIBERNATION = 0x012d,
120 SCI_LCD_BACKLIGHT = 0x0305,
121 SCI_DISPLAY_STRETCH = 0x0308,
122 SCI_PARALLEL_PORT = 0x0501,
123 SCI_POINTING_DEVICE = 0x0505,
124 SCI_INFRARED_PORT = 0x0508,
125 SCI_PASSWORD_MODE = 0x0600,
126 SCI_PASSWORD_CHECK = 0x0601,
127 SCI_PASSWORD = 0x0602,
128 SCI_PASSWORD_VERIFY = 0x0603,
129 SCI_PASSWORD_LEVEL = 0x0604
134 * the different states the various modes can be set to
137 enum {
138 SCI_BOOT = 0x0000,
139 SCI_RESUME = 0x0001,
140 SCI_HIBERNATE = 0x0002,
141 SCI_QUICK_HIBERNATE = 0x0003
144 enum {
145 SCI_USER_SETTINGS = 0x0000,
146 SCI_LOW_POWER = 0x0001,
147 SCI_FULL_POWER = 0x0002,
148 SCI_LONG_LIFE = 0x0001,
149 SCI_NORMAL_LIFE = 0x0002,
150 SCI_ECONOMY = 0x0002,
151 SCI_FULL_LIFE = 0x0003
154 enum {
155 SCI_LOW = 0x0000,
156 SCI_HIGH = 0x0001
159 enum {
160 SCI_OFF = 0x0000,
161 SCI_ON = 0x0001
164 enum {
165 SCI_DISABLED = 0x0000,
166 SCI_ENABLED = 0x0001
169 enum {
170 SCI_ALARM_ENABLED = 0x0000,
171 SCI_ALARM_DISABLED = 0x0001
174 enum {
175 SCI_TIME_DISABLED = 0x0001, /* will disable relevant settings */
176 SCI_TIME_00 = 0x0002,
177 SCI_TIME_01 = 0x0004,
178 SCI_TIME_03 = 0x0008,
179 SCI_TIME_05 = 0x0010,
180 SCI_TIME_10 = 0x0020,
181 SCI_TIME_15 = 0x0040,
182 SCI_TIME_20 = 0x0080,
183 SCI_TIME_25 = 0x0100,
184 SCI_TIME_30 = 0x0200,
185 SCI_TIME_35 = 0x0400,
186 SCI_TIME_40 = 0x0800,
187 SCI_TIME_45 = 0x1000,
188 SCI_TIME_50 = 0x2000,
189 SCI_TIME_55 = 0x4000,
190 SCI_TIME_60 = 0x8000
193 enum {
194 SCI_FD_HD = 0x0000,
195 SCI_HD_FD = 0x0001
198 enum {
199 SCI_VOLUME_OFF = 0x0000,
200 SCI_VOLUME_LOW = 0x0001,
201 SCI_VOLUME_MEDIUM = 0x0002,
202 SCI_VOLUME_HIGH = 0x0003
205 enum {
206 SCI_BRIGHT = 0x0000,
207 SCI_SEMI_BRIGHT = 0x0001,
208 SCI_SUPER_BRIGHT = 0x0002
211 enum {
212 SCI_BACK_DARK = 0x0000,
213 SCI_BACK_DIM = 0x0001,
214 SCI_BACK_SEMI = 0x0002,
215 SCI_BACK_BRIGHT = 0x0003
218 enum {
219 SCI_PERFORMANCE = 0x0000,
220 SCI_QUIET = 0x0001
223 enum {
224 SCI_PARALLEL_ECP = 0x0010,
225 SCI_PARALLEL_SPP = 0x0020, /* Libretto 20x/30x only ? */
226 SCI_PARALLEL_PS2 = 0x0040
229 enum {
230 SCI_AUTO_SELECT = 0x0000,
231 SCI_SIMULATANEOUS = 0x0001
234 enum {
235 SCI_IRDA_1_0 = 0x0001, /* These don't work on IrDA 1.1 laptops */
236 SCI_ASK = 0x0002
239 enum {
240 SCI_NOT_REGISTERED = 0x0000,
241 SCI_REGISTERED = 0x0001
244 enum {
245 SCI_USER_PASSWORD = 0x0000,
246 SCI_SUPER_PASSWORD = 0x0001
249 enum {
250 SCI_BATTERY = 0x0003,
251 SCI_MAINS = 0x0004
256 * SCI error codes
258 enum {
259 SCI_SUCCESS = 0x00,
260 SCI_FAILURE = 0x01,
261 SCI_NOT_SUPPORTED = 0x80,
262 SCI_ALREADY_OPEN = 0x81,
263 SCI_NOT_OPENED = 0x82,
264 SCI_INPUT_ERROR = 0x83,
265 SCI_WRITE_PROTECTED = 0x84,
266 SCI_NOT_PRESENT = 0x86,
267 SCI_NOT_READY = 0x8c,
268 SCI_DEVICE_ERROR = 0x8d,
269 SCI_NOT_INSTALLED = 0x8e
274 * macro's to manipulate the time and date data types
276 #define SCI_TIME(h,m) ((m & 0x3f)<<1) | ((h & 0x1f)<<7)
277 #define SCI_HOUR(t) (t & 0x7fc0)>>7
278 #define SCI_MINUTE(t) (t & 0x7e)>>1
279 #define SCI_TIME_ON(t) (t & 0x01)
280 #define SCI_DATE(m,d) ((m & 0xf)<<6) | ((d & 0x1f)<<1)
281 #define SCI_FULLDATE(y,m,d) (((y-1990) & 0x1f)<<10) | ((m & 0xf)<<6) | ((d & 0x1f)<<1)
282 #define SCI_YEAR(d) 1990+((d & 0x1fc00)>>10)
283 #define SCI_MONTH(d) (d & 0x3c0)>>6
284 #define SCI_DAY(d) (d & 0x3e)>>1
285 #define SCI_DATE_EVERYDAY(d) (d & 0x01)
288 * function prototypes
290 int SciSupportCheck(int *version);
291 int SciOpenInterface(void);
292 int SciCloseInterface(void);
293 int SciGet(SMMRegisters *reg);
294 int SciSet(SMMRegisters *reg);
295 int SciACPower(void);
297 #ifdef __cplusplus
299 #endif
301 #endif