diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-04-21 10:08:37 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-04-21 23:30:34 -0400 |
commit | 8d376cd6543d57ef10799be02ba5f19aa6678032 (patch) | |
tree | 0e140fc7d4a6dc0cd78b12e4481f37098b44cecd /drivers/misc/thinkpad_acpi.h | |
parent | d8fd94d9f08237ffda7e44e6825b057bf20a90e3 (diff) |
ACPI: thinkpad-acpi: prepare for device model conversion
Prepare the thinkpad-acpi driver for the conversion to the device
model, by renaming variables and doing other glue work that shall
make the later patches much cleaner.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
-rw-r--r-- | drivers/misc/thinkpad_acpi.h | 40 |
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 */ | |||
108 | static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */ | 109 | static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */ |
109 | static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */ | 110 | static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */ |
110 | 111 | ||
111 | static void ibm_handle_init(char *name, | 112 | static 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 */ |
119 | static struct proc_dir_entry *proc_dir; | 120 | static struct proc_dir_entry *proc_dir; |
120 | 121 | ||
121 | /* procfs helpers */ | 122 | /* procfs helpers */ |
122 | static int dispatch_read(char *page, char **start, off_t off, int count, | 123 | static int dispatch_procfs_read(char *page, char **start, off_t off, |
123 | int *eof, void *data); | 124 | int count, int *eof, void *data); |
124 | static int dispatch_write(struct file *file, const char __user * userbuf, | 125 | static int dispatch_procfs_write(struct file *file, |
126 | const char __user * userbuf, | ||
125 | unsigned long count, void *data); | 127 | unsigned long count, void *data); |
126 | static char *next_cmd(char **cmds); | 128 | static 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 | ||
143 | struct ibm_struct { | 145 | struct ibm_struct; |
144 | char *name; | ||
145 | 146 | ||
147 | struct 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 | |||
157 | struct 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 | }; |