Commit 8d376cd6 authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh Committed by Len Brown

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: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent d8fd94d9
This diff is collapsed.
...@@ -52,8 +52,9 @@ ...@@ -52,8 +52,9 @@
#define IBM_DESC "ThinkPad ACPI Extras" #define IBM_DESC "ThinkPad ACPI Extras"
#define IBM_FILE "thinkpad_acpi" #define IBM_FILE "thinkpad_acpi"
#define IBM_URL "http://ibm-acpi.sf.net/" #define IBM_URL "http://ibm-acpi.sf.net/"
#define IBM_MAIL "ibm-acpi-devel@lists.sourceforge.net"
#define IBM_DIR "ibm" #define IBM_PROC_DIR "ibm"
#define IBM_ACPI_EVENT_PREFIX "ibm" #define IBM_ACPI_EVENT_PREFIX "ibm"
#define IBM_LOG IBM_FILE ": " #define IBM_LOG IBM_FILE ": "
...@@ -108,20 +109,21 @@ static acpi_handle ec_handle; /* EC */ ...@@ -108,20 +109,21 @@ static acpi_handle ec_handle; /* EC */
static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */ static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */
static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */ static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */
static void ibm_handle_init(char *name, static void drv_acpi_handle_init(char *name,
acpi_handle *handle, acpi_handle parent, acpi_handle *handle, acpi_handle parent,
char **paths, int num_paths, char **path); char **paths, int num_paths, char **path);
#define IBM_HANDLE_INIT(object) \ #define IBM_ACPIHANDLE_INIT(object) \
ibm_handle_init(#object, &object##_handle, *object##_parent, \ drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \
object##_paths, ARRAY_SIZE(object##_paths), &object##_path) object##_paths, ARRAY_SIZE(object##_paths), &object##_path)
/* procfs support */ /* procfs support */
static struct proc_dir_entry *proc_dir; static struct proc_dir_entry *proc_dir;
/* procfs helpers */ /* procfs helpers */
static int dispatch_read(char *page, char **start, off_t off, int count, static int dispatch_procfs_read(char *page, char **start, off_t off,
int *eof, void *data); int count, int *eof, void *data);
static int dispatch_write(struct file *file, const char __user * userbuf, static int dispatch_procfs_write(struct file *file,
const char __user * userbuf,
unsigned long count, void *data); unsigned long count, void *data);
static char *next_cmd(char **cmds); static char *next_cmd(char **cmds);
...@@ -140,28 +142,34 @@ static void thinkpad_acpi_module_exit(void); ...@@ -140,28 +142,34 @@ static void thinkpad_acpi_module_exit(void);
* Subdrivers * Subdrivers
*/ */
struct ibm_struct { struct ibm_struct;
char *name;
struct tp_acpi_drv_struct {
char *hid; char *hid;
struct acpi_driver *driver; struct acpi_driver *driver;
int (*read) (char *);
int (*write) (char *);
void (*exit) (void);
void (*notify) (struct ibm_struct *, u32); void (*notify) (struct ibm_struct *, u32);
acpi_handle *handle; acpi_handle *handle;
int type; u32 type;
struct acpi_device *device; struct acpi_device *device;
};
struct ibm_struct {
char *name;
int (*read) (char *);
int (*write) (char *);
void (*exit) (void);
struct list_head all_drivers; struct list_head all_drivers;
struct tp_acpi_drv_struct *acpi;
struct { struct {
u8 driver_registered:1; u8 acpi_driver_registered:1;
u8 acpi_notify_installed:1;
u8 proc_created:1; u8 proc_created:1;
u8 init_called:1; u8 init_called:1;
u8 notify_installed:1;
u8 experimental:1; u8 experimental:1;
} flags; } flags;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment