2 * acpi.h - ACPI driver interface
4 * Copyright (C) 1999 Andrew Henroid
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; either version 2 of the License, or
9 * (at your option) any later version.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/types.h>
25 #include <linux/ioctl.h>
27 #include <linux/sched.h>
28 #include <linux/wait.h>
29 #endif /* __KERNEL__ */
36 ACPI_S0
, /* working */
40 ACPI_S4
, /* non-volatile sleep */
41 ACPI_S5
, /* soft-off */
44 typedef int acpi_sstate_t
;
51 ACPI_D0
, /* fully-on */
52 ACPI_D1
, /* partial-on */
53 ACPI_D2
, /* partial-on */
54 ACPI_D3
, /* fully-off */
57 typedef int acpi_dstate_t
;
60 #define ACPI_BIOS_ROM_BASE (0x0e0000)
61 #define ACPI_BIOS_ROM_END (0x100000)
63 /* Table signatures */
64 #define ACPI_RSDP1_SIG 0x20445352 /* 'RSD ' */
65 #define ACPI_RSDP2_SIG 0x20525450 /* 'PTR ' */
66 #define ACPI_RSDT_SIG 0x54445352 /* 'RSDT' */
67 #define ACPI_FACP_SIG 0x50434146 /* 'FACP' */
68 #define ACPI_DSDT_SIG 0x54445344 /* 'DSDT' */
69 #define ACPI_FACS_SIG 0x53434146 /* 'FACS' */
71 /* PM1_STS/EN flags */
72 #define ACPI_TMR 0x0001
73 #define ACPI_BM 0x0010
74 #define ACPI_GBL 0x0020
75 #define ACPI_PWRBTN 0x0100
76 #define ACPI_SLPBTN 0x0200
77 #define ACPI_RTC 0x0400
78 #define ACPI_WAK 0x8000
81 #define ACPI_SCI_EN 0x0001
82 #define ACPI_BM_RLD 0x0002
83 #define ACPI_GBL_RLS 0x0004
84 #define ACPI_SLP_TYP0 0x0400
85 #define ACPI_SLP_TYP1 0x0800
86 #define ACPI_SLP_TYP2 0x1000
87 #define ACPI_SLP_EN 0x2000
89 #define ACPI_SLP_TYP_MASK 0x1c00
90 #define ACPI_SLP_TYP_SHIFT 10
93 #define ACPI_TMR_MASK 0x00ffffff
94 #define ACPI_TMR_HZ 3580000 /* 3.58 MHz */
96 /* strangess to avoid integer overflow */
97 #define ACPI_uS_TO_TMR_TICKS(val) \
98 (((val) * (ACPI_TMR_HZ / 10000)) / 100)
99 #define ACPI_TMR_TICKS_TO_uS(ticks) \
100 (((ticks) * 100) / (ACPI_TMR_HZ / 10000))
103 #define ACPI_ARB_DIS 0x01
106 #define ACPI_WBINVD 0x00000001
107 #define ACPI_WBINVD_FLUSH 0x00000002
108 #define ACPI_PROC_C1 0x00000004
109 #define ACPI_P_LVL2_UP 0x00000008
110 #define ACPI_PWR_BUTTON 0x00000010
111 #define ACPI_SLP_BUTTON 0x00000020
112 #define ACPI_FIX_RTC 0x00000040
113 #define ACPI_RTC_64 0x00000080
114 #define ACPI_TMR_VAL_EXT 0x00000100
115 #define ACPI_DCK_CAP 0x00000200
117 /* FACP BOOT_ARCH flags */
118 #define FACP_BOOT_ARCH_LEGACY_DEVICES 0x0001
119 #define FACP_BOOT_ARCH_KBD_CONTROLLER 0x0002
122 #define ACPI_S4BIOS 0x00000001
124 /* processor block offsets */
125 #define ACPI_P_CNT 0x00000000
126 #define ACPI_P_LVL2 0x00000004
127 #define ACPI_P_LVL3 0x00000005
129 /* C-state latencies (microseconds) */
130 #define ACPI_MAX_P_LVL2_LAT 100
131 #define ACPI_MAX_P_LVL3_LAT 1000
132 #define ACPI_INFINITE_LAT (~0UL)
140 } __attribute__ ((packed
));
152 } __attribute__ ((packed
));
155 struct acpi_table hdr
;
194 } __attribute__ ((packed
));
200 __u32 fw_wake_vector
;
203 } __attribute__ ((packed
));
206 * Sysctl declarations
237 #define ACPI_SLP_TYP_DISABLED (~0UL)
240 * PIIX4-specific ACPI info (for systems with PIIX4 but no ACPI tables)
243 #define ACPI_PIIX4_INT_MODEL 0x00
244 #define ACPI_PIIX4_SCI_INT 0x0009
246 #define ACPI_PIIX4_SMI_CMD 0x00b2
247 #define ACPI_PIIX4_ACPI_ENABLE 0xf0
248 #define ACPI_PIIX4_ACPI_DISABLE 0xf1
249 #define ACPI_PIIX4_S4BIOS_REQ 0xf2
251 #define ACPI_PIIX4_PM1_EVT 0x0000
252 #define ACPI_PIIX4_PM1_CNT 0x0004
253 #define ACPI_PIIX4_S0_MASK (0x0005 << 10)
254 #define ACPI_PIIX4_S1_MASK (0x0004 << 10)
255 #define ACPI_PIIX4_S2_MASK (0x0003 << 10)
256 #define ACPI_PIIX4_S3_MASK (0x0002 << 10)
257 #define ACPI_PIIX4_S4_MASK (0x0001 << 10)
258 #define ACPI_PIIX4_S5_MASK (0x0000 << 10)
259 #define ACPI_PIIX4_PM_TMR 0x0008
260 #define ACPI_PIIX4_GPE0 0x000c
261 #define ACPI_PIIX4_P_BLK 0x0010
263 #define ACPI_PIIX4_PM1_EVT_LEN 0x04
264 #define ACPI_PIIX4_PM1_CNT_LEN 0x02
265 #define ACPI_PIIX4_PM_TM_LEN 0x04
266 #define ACPI_PIIX4_GPE0_LEN 0x04
268 #define ACPI_PIIX4_PM2_CNT 0x0022
269 #define ACPI_PIIX4_PM2_CNT_LEN 0x01
271 #define ACPI_PIIX4_PMREGMISC 0x80
272 #define ACPI_PIIX4_PMIOSE 0x01
275 * VIA-specific ACPI info (for systems with VT82C586B but no ACPI tables)
278 #define ACPI_VIA_INT_MODEL 0x00
280 #define ACPI_VIA_SMI_CMD 0x002f
281 #define ACPI_VIA_ACPI_ENABLE 0xa1
282 #define ACPI_VIA_ACPI_DISABLE 0xa0
284 #define ACPI_VIA_PM1_EVT 0x0000
285 #define ACPI_VIA_PM1_CNT 0x0004
286 #define ACPI_VIA_PM_TMR 0x0008
287 #define ACPI_VIA_GPE0 0x0020
288 #define ACPI_VIA_P_BLK 0x0010
290 #define ACPI_VIA_PM1_EVT_LEN 0x04
291 #define ACPI_VIA_PM1_CNT_LEN 0x02
292 #define ACPI_VIA_PM_TM_LEN 0x04
293 #define ACPI_VIA_GPE0_LEN 0x04
295 #define ACPI_VIA_DUTY_OFFSET 1
296 #define ACPI_VIA_DUTY_WIDTH 3
298 #define ACPI_VIA_DAY_ALARM 0x7d
299 #define ACPI_VIA_MON_ALARM 0x7e
300 #define ACPI_VIA_CENTURY 0x7f
302 #endif /* _LINUX_ACPI_H */