]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/thinkpad_acpi.h
sonypi: fix ids member of struct acpi_driver
[linux-2.6-omap-h63xx.git] / drivers / misc / thinkpad_acpi.h
index 00f1bd73df8f4197b54c6d5ada289ff81ac20d57..88af089d64945b41a5150e545a5064ce1b6f0a5a 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/list.h>
 #include <linux/mutex.h>
 
+#include <linux/nvram.h>
 #include <linux/proc_fs.h>
 #include <linux/sysfs.h>
 #include <linux/backlight.h>
 #define TP_CMOS_BRIGHTNESS_UP  4
 #define TP_CMOS_BRIGHTNESS_DOWN        5
 
+/* ThinkPad CMOS NVRAM constants */
+#define TP_NVRAM_ADDR_BRIGHTNESS       0x5e
+#define TP_NVRAM_MASK_LEVEL_BRIGHTNESS 0x07
+#define TP_NVRAM_POS_LEVEL_BRIGHTNESS 0
+
 #define onoff(status,bit) ((status) & (1 << (bit)) ? "on" : "off")
 #define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
 #define strlencmp(a,b) (strncmp((a), (b), strlen(b)))
@@ -107,7 +113,6 @@ static const char *str_supported(int is_supported);
 
 /* ACPI HIDs */
 #define IBM_HKEY_HID    "IBM0068"
-#define IBM_PCI_HID     "PNP0A03"
 
 /* ACPI helpers */
 static int __must_check acpi_evalf(acpi_handle handle,
@@ -176,9 +181,7 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv);
 static int experimental;
 static u32 dbg_level;
 static int force_load;
-static char *ibm_thinkpad_ec_found;
 
-static char* check_dmi_for_ec(void);
 static int thinkpad_acpi_module_init(void);
 static void thinkpad_acpi_module_exit(void);
 
@@ -190,7 +193,7 @@ static void thinkpad_acpi_module_exit(void);
 struct ibm_struct;
 
 struct tp_acpi_drv_struct {
-       char *hid;
+       const struct acpi_device_id *hid;
        struct acpi_driver *driver;
 
        void (*notify) (struct ibm_struct *, u32);
@@ -205,6 +208,7 @@ struct ibm_struct {
        int (*read) (char *);
        int (*write) (char *);
        void (*exit) (void);
+       void (*resume) (void);
 
        struct list_head all_drivers;
 
@@ -244,6 +248,21 @@ static struct {
        u16 input_device_registered:1;
 } tp_features;
 
+struct thinkpad_id_data {
+       unsigned int vendor;    /* ThinkPad vendor:
+                                * PCI_VENDOR_ID_IBM/PCI_VENDOR_ID_LENOVO */
+
+       char *bios_version_str; /* Something like 1ZET51WW (1.03z) */
+       char *ec_version_str;   /* Something like 1ZHT51WW-1.04a */
+
+       u16 bios_model;         /* Big Endian, TP-1Y = 0x5931, 0 = unknown */
+       u16 ec_model;
+
+       char *model_str;
+};
+
+static struct thinkpad_id_data thinkpad_id;
+
 static struct list_head tpacpi_all_drivers;
 
 static struct ibm_init_struct ibms_init[];
@@ -310,6 +329,7 @@ static int bluetooth_write(char *buf);
 
 static struct backlight_device *ibm_backlight_device;
 static int brightness_offset = 0x31;
+static int brightness_mode;
 
 static int brightness_init(struct ibm_init_struct *iibm);
 static void brightness_exit(void);