]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/thinkpad_acpi.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / misc / thinkpad_acpi.c
index 1dcf0660d8b51971254bd50dfcf027b9a9ec4d02..4db1cf9078d9976b5206649aad3d0118272a000a 100644 (file)
@@ -158,7 +158,6 @@ enum {
 #define TPACPI_INFO   KERN_INFO   TPACPI_LOG
 #define TPACPI_DEBUG  KERN_DEBUG  TPACPI_LOG
 
-#define TPACPI_DBG_ALL         0xffff
 #define TPACPI_DBG_ALL         0xffff
 #define TPACPI_DBG_INIT                0x0001
 #define TPACPI_DBG_EXIT                0x0002
@@ -543,7 +542,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)
                return -ENODEV;
        }
 
-       acpi_driver_data(ibm->acpi->device) = ibm;
+       ibm->acpi->device->driver_data = ibm;
        sprintf(acpi_device_class(ibm->acpi->device), "%s/%s",
                TPACPI_ACPI_EVENT_PREFIX,
                ibm->name);
@@ -582,7 +581,8 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
 
        ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL);
        if (!ibm->acpi->driver) {
-               printk(TPACPI_ERR "kzalloc(ibm->driver) failed\n");
+               printk(TPACPI_ERR
+                      "failed to allocate memory for ibm->acpi->driver\n");
                return -ENOMEM;
        }
 
@@ -838,6 +838,13 @@ static int parse_strtoul(const char *buf,
        return 0;
 }
 
+static void tpacpi_disable_brightness_delay(void)
+{
+       if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0))
+               printk(TPACPI_NOTICE
+                       "ACPI backlight control delay disabled\n");
+}
+
 static int __init tpacpi_query_bcl_levels(acpi_handle handle)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -2139,6 +2146,8 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
        if (!tp_features.hotkey)
                return 1;
 
+       tpacpi_disable_brightness_delay();
+
        hotkey_dev_attributes = create_attr_set(13, NULL);
        if (!hotkey_dev_attributes)
                return -ENOMEM;
@@ -2512,6 +2521,8 @@ static void hotkey_suspend(pm_message_t state)
 
 static void hotkey_resume(void)
 {
+       tpacpi_disable_brightness_delay();
+
        if (hotkey_mask_get())
                printk(TPACPI_ERR
                       "error while trying to read hot key mask "