diff options
Diffstat (limited to 'arch/x86/include/asm/olpc.h')
-rw-r--r-- | arch/x86/include/asm/olpc.h | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/arch/x86/include/asm/olpc.h b/arch/x86/include/asm/olpc.h index 5ca6801b75f3..87bdbca72f94 100644 --- a/arch/x86/include/asm/olpc.h +++ b/arch/x86/include/asm/olpc.h | |||
@@ -13,6 +13,7 @@ struct olpc_platform_t { | |||
13 | 13 | ||
14 | #define OLPC_F_PRESENT 0x01 | 14 | #define OLPC_F_PRESENT 0x01 |
15 | #define OLPC_F_DCON 0x02 | 15 | #define OLPC_F_DCON 0x02 |
16 | #define OLPC_F_EC_WIDE_SCI 0x04 | ||
16 | 17 | ||
17 | #ifdef CONFIG_OLPC | 18 | #ifdef CONFIG_OLPC |
18 | 19 | ||
@@ -62,6 +63,13 @@ static inline int olpc_board_at_least(uint32_t rev) | |||
62 | return olpc_platform_info.boardrev >= rev; | 63 | return olpc_platform_info.boardrev >= rev; |
63 | } | 64 | } |
64 | 65 | ||
66 | extern void olpc_ec_wakeup_set(u16 value); | ||
67 | extern void olpc_ec_wakeup_clear(u16 value); | ||
68 | extern bool olpc_ec_wakeup_available(void); | ||
69 | |||
70 | extern int olpc_ec_mask_write(u16 bits); | ||
71 | extern int olpc_ec_sci_query(u16 *sci_value); | ||
72 | |||
65 | #else | 73 | #else |
66 | 74 | ||
67 | static inline int machine_is_olpc(void) | 75 | static inline int machine_is_olpc(void) |
@@ -74,6 +82,20 @@ static inline int olpc_has_dcon(void) | |||
74 | return 0; | 82 | return 0; |
75 | } | 83 | } |
76 | 84 | ||
85 | static inline void olpc_ec_wakeup_set(u16 value) { } | ||
86 | static inline void olpc_ec_wakeup_clear(u16 value) { } | ||
87 | |||
88 | static inline bool olpc_ec_wakeup_available(void) | ||
89 | { | ||
90 | return false; | ||
91 | } | ||
92 | |||
93 | #endif | ||
94 | |||
95 | #ifdef CONFIG_OLPC_XO1_PM | ||
96 | extern void do_olpc_suspend_lowlevel(void); | ||
97 | extern void olpc_xo1_pm_wakeup_set(u16 value); | ||
98 | extern void olpc_xo1_pm_wakeup_clear(u16 value); | ||
77 | #endif | 99 | #endif |
78 | 100 | ||
79 | extern int pci_olpc_init(void); | 101 | extern int pci_olpc_init(void); |
@@ -83,14 +105,19 @@ extern int pci_olpc_init(void); | |||
83 | extern int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen, | 105 | extern int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen, |
84 | unsigned char *outbuf, size_t outlen); | 106 | unsigned char *outbuf, size_t outlen); |
85 | 107 | ||
86 | extern int olpc_ec_mask_set(uint8_t bits); | ||
87 | extern int olpc_ec_mask_unset(uint8_t bits); | ||
88 | |||
89 | /* EC commands */ | 108 | /* EC commands */ |
90 | 109 | ||
91 | #define EC_FIRMWARE_REV 0x08 | 110 | #define EC_FIRMWARE_REV 0x08 |
92 | #define EC_WLAN_ENTER_RESET 0x35 | 111 | #define EC_WRITE_SCI_MASK 0x1b |
93 | #define EC_WLAN_LEAVE_RESET 0x25 | 112 | #define EC_WAKE_UP_WLAN 0x24 |
113 | #define EC_WLAN_LEAVE_RESET 0x25 | ||
114 | #define EC_READ_EB_MODE 0x2a | ||
115 | #define EC_SET_SCI_INHIBIT 0x32 | ||
116 | #define EC_SET_SCI_INHIBIT_RELEASE 0x34 | ||
117 | #define EC_WLAN_ENTER_RESET 0x35 | ||
118 | #define EC_WRITE_EXT_SCI_MASK 0x38 | ||
119 | #define EC_SCI_QUERY 0x84 | ||
120 | #define EC_EXT_SCI_QUERY 0x85 | ||
94 | 121 | ||
95 | /* SCI source values */ | 122 | /* SCI source values */ |
96 | 123 | ||
@@ -99,10 +126,12 @@ extern int olpc_ec_mask_unset(uint8_t bits); | |||
99 | #define EC_SCI_SRC_BATTERY 0x02 | 126 | #define EC_SCI_SRC_BATTERY 0x02 |
100 | #define EC_SCI_SRC_BATSOC 0x04 | 127 | #define EC_SCI_SRC_BATSOC 0x04 |
101 | #define EC_SCI_SRC_BATERR 0x08 | 128 | #define EC_SCI_SRC_BATERR 0x08 |
102 | #define EC_SCI_SRC_EBOOK 0x10 | 129 | #define EC_SCI_SRC_EBOOK 0x10 /* XO-1 only */ |
103 | #define EC_SCI_SRC_WLAN 0x20 | 130 | #define EC_SCI_SRC_WLAN 0x20 /* XO-1 only */ |
104 | #define EC_SCI_SRC_ACPWR 0x40 | 131 | #define EC_SCI_SRC_ACPWR 0x40 |
105 | #define EC_SCI_SRC_ALL 0x7F | 132 | #define EC_SCI_SRC_BATCRIT 0x80 |
133 | #define EC_SCI_SRC_GPWAKE 0x100 /* XO-1.5 only */ | ||
134 | #define EC_SCI_SRC_ALL 0x1FF | ||
106 | 135 | ||
107 | /* GPIO assignments */ | 136 | /* GPIO assignments */ |
108 | 137 | ||
@@ -116,7 +145,7 @@ extern int olpc_ec_mask_unset(uint8_t bits); | |||
116 | #define OLPC_GPIO_SMB_CLK 14 | 145 | #define OLPC_GPIO_SMB_CLK 14 |
117 | #define OLPC_GPIO_SMB_DATA 15 | 146 | #define OLPC_GPIO_SMB_DATA 15 |
118 | #define OLPC_GPIO_WORKAUX geode_gpio(24) | 147 | #define OLPC_GPIO_WORKAUX geode_gpio(24) |
119 | #define OLPC_GPIO_LID geode_gpio(26) | 148 | #define OLPC_GPIO_LID 26 |
120 | #define OLPC_GPIO_ECSCI geode_gpio(27) | 149 | #define OLPC_GPIO_ECSCI 27 |
121 | 150 | ||
122 | #endif /* _ASM_X86_OLPC_H */ | 151 | #endif /* _ASM_X86_OLPC_H */ |