aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/thinkpad_acpi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
-rw-r--r--drivers/misc/thinkpad_acpi.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 4d3ab4015ff2..529528c2fb5d 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -52,8 +52,9 @@
52#define IBM_DESC "ThinkPad ACPI Extras" 52#define IBM_DESC "ThinkPad ACPI Extras"
53#define IBM_FILE "thinkpad_acpi" 53#define IBM_FILE "thinkpad_acpi"
54#define IBM_URL "http://ibm-acpi.sf.net/" 54#define IBM_URL "http://ibm-acpi.sf.net/"
55#define IBM_MAIL "ibm-acpi-devel@lists.sourceforge.net"
55 56
56#define IBM_DIR "ibm" 57#define IBM_PROC_DIR "ibm"
57#define IBM_ACPI_EVENT_PREFIX "ibm" 58#define IBM_ACPI_EVENT_PREFIX "ibm"
58 59
59#define IBM_LOG IBM_FILE ": " 60#define IBM_LOG IBM_FILE ": "
@@ -108,20 +109,21 @@ static acpi_handle ec_handle; /* EC */
108static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */ 109static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */
109static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */ 110static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */
110 111
111static void ibm_handle_init(char *name, 112static void drv_acpi_handle_init(char *name,
112 acpi_handle *handle, acpi_handle parent, 113 acpi_handle *handle, acpi_handle parent,
113 char **paths, int num_paths, char **path); 114 char **paths, int num_paths, char **path);
114#define IBM_HANDLE_INIT(object) \ 115#define IBM_ACPIHANDLE_INIT(object) \
115 ibm_handle_init(#object, &object##_handle, *object##_parent, \ 116 drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \
116 object##_paths, ARRAY_SIZE(object##_paths), &object##_path) 117 object##_paths, ARRAY_SIZE(object##_paths), &object##_path)
117 118
118/* procfs support */ 119/* procfs support */
119static struct proc_dir_entry *proc_dir; 120static struct proc_dir_entry *proc_dir;
120 121
121/* procfs helpers */ 122/* procfs helpers */
122static int dispatch_read(char *page, char **start, off_t off, int count, 123static int dispatch_procfs_read(char *page, char **start, off_t off,
123 int *eof, void *data); 124 int count, int *eof, void *data);
124static int dispatch_write(struct file *file, const char __user * userbuf, 125static int dispatch_procfs_write(struct file *file,
126 const char __user * userbuf,
125 unsigned long count, void *data); 127 unsigned long count, void *data);
126static char *next_cmd(char **cmds); 128static char *next_cmd(char **cmds);
127 129
@@ -140,28 +142,34 @@ static void thinkpad_acpi_module_exit(void);
140 * Subdrivers 142 * Subdrivers
141 */ 143 */
142 144
143struct ibm_struct { 145struct ibm_struct;
144 char *name;
145 146
147struct tp_acpi_drv_struct {
146 char *hid; 148 char *hid;
147 struct acpi_driver *driver; 149 struct acpi_driver *driver;
148 150
149 int (*read) (char *);
150 int (*write) (char *);
151 void (*exit) (void);
152
153 void (*notify) (struct ibm_struct *, u32); 151 void (*notify) (struct ibm_struct *, u32);
154 acpi_handle *handle; 152 acpi_handle *handle;
155 int type; 153 u32 type;
156 struct acpi_device *device; 154 struct acpi_device *device;
155};
156
157struct ibm_struct {
158 char *name;
159
160 int (*read) (char *);
161 int (*write) (char *);
162 void (*exit) (void);
157 163
158 struct list_head all_drivers; 164 struct list_head all_drivers;
159 165
166 struct tp_acpi_drv_struct *acpi;
167
160 struct { 168 struct {
161 u8 driver_registered:1; 169 u8 acpi_driver_registered:1;
170 u8 acpi_notify_installed:1;
162 u8 proc_created:1; 171 u8 proc_created:1;
163 u8 init_called:1; 172 u8 init_called:1;
164 u8 notify_installed:1;
165 u8 experimental:1; 173 u8 experimental:1;
166 } flags; 174 } flags;
167}; 175};