Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla...
authorLen Brown <len.brown@intel.com>
Wed, 30 Apr 2008 17:58:00 +0000 (13:58 -0400)
committerLen Brown <len.brown@intel.com>
Wed, 30 Apr 2008 17:58:00 +0000 (13:58 -0400)
1  2  3  4  5  6  7  8  9  10  11  12  13 
arch/mips/au1000/common/power.c
arch/x86/kernel/apm_32.c
drivers/acpi/events/evgpe.c
drivers/acpi/processor_idle.c
drivers/acpi/scan.c
drivers/acpi/utilities/utxface.c
drivers/acpi/video.c
drivers/misc/Kconfig
drivers/misc/thinkpad_acpi.c

@@@@@@@@@@@@@@ -278,36 -278,36 -271,36 -278,36 -278,36 -271,36 -278,36 -271,36 -277,12 -278,36 -271,36 -271,36 -271,36 +270,12 @@@@@@@@@@@@@@ static int pm_do_sleep(ctl_table * ctl
                        p = buf;
                        sleep_ticks = simple_strtoul(p, &p, 0);
             #endif
-------- ----           retval = pm_send_all(PM_SUSPEND, (void *) 2);
-------- ----
-------- ----           if (retval)
-------- ----                   return retval;
             
                        au_sleep();
-- -- -  -              retval = pm_send_all(PM_RESUME, (void *) 0);
-- -- -  -      }
-- -- -  -      return retval;
-- -- -  -   }
-- -- -  -   
-- -- -  -   static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
-- -- -  -                       void __user *buffer, size_t * len, loff_t *ppos)
-- -- -  -   {
-- -- -  -      int retval = 0;
-- -- -  -   
-- -- -  -      if (!write) {
-- -- -  -              *len = 0;
-- -- -  -      } else {
-- -- -  -              retval = pm_send_all(PM_SUSPEND, (void *) 2);
-- -- -  -              if (retval)
-- -- -  -                      return retval;
-- -- -  -              suspend_mode = 1;
-- -- -  -   
-------- ----           retval = pm_send_all(PM_RESUME, (void *) 0);
                }
  -  - -  ---   return retval;
  -  - -  ---}
  -  - -  ---
  -  - -  ---static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
  -  - -  ---                    void __user *buffer, size_t * len, loff_t *ppos)
  -  - -  ---{
  -  - -  ---   int retval = 0;
  -  - -  ---
  -  - -  ---   if (!write) {
  -  - -  ---           *len = 0;
  -  - -  ---   } else {
  -  - -  ---           retval = pm_send_all(PM_SUSPEND, (void *) 2);
  -  - -  ---           if (retval)
  -  - -  ---                   return retval;
  -  - -  ---           suspend_mode = 1;
  -  - -  ---
  -  - -  ---           retval = pm_send_all(PM_RESUME, (void *) 0);
  -  - -  ---   }
-------- ----   return retval;
++++++++ ++++   return 0;
             }
             
-------- ----
             static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
                              void __user *buffer, size_t * len, loff_t *ppos)
             {
Simple merge
Simple merge
@@@@@@@@@@@@@@ -418,14 -418,14 -418,13 -418,14 -418,14 -418,13 -418,14 -418,13 -418,14 -416,12 -418,13 -418,13 -418,13 +418,13 @@@@@@@@@@@@@@ static void acpi_processor_idle(void
             
                cx = pr->power.state;
                if (!cx || acpi_idle_suspend) {
-- -- - --              if (pm_idle_save)
-- -- - --                      pm_idle_save();
-- -- - --              else
++ ++ + ++              if (pm_idle_save) {
++ ++ + ++                      pm_idle_save(); /* enables IRQs */
++ ++ + ++              } else {
                                acpi_safe_halt();
-- -- - -    
-- -- - -               if (irqs_disabled())
         +                      local_irq_enable();
++ ++ + ++              }
             
         -              local_irq_enable();
                        return;
                }
             
                         *       skew otherwise.
                         */
                        sleep_ticks = 0xFFFFFFFF;
-- -- - -               if (irqs_disabled())
-- -- - -                       local_irq_enable();
         -              local_irq_enable();
         +   
                        break;
             
                case ACPI_STATE_C2:
Simple merge
Simple merge
@@@@@@@@@@@@@@ -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1366,108 -1335,79 -1337,79 -1338,79 +1336,79 @@@@@@@@@@@@@@ acpi_video_bus_write_DOS(struct file *f
             
             static int acpi_video_bus_add_fs(struct acpi_device *device)
             {
         -      long device_id;
         -      int status;
------------    struct proc_dir_entry *entry = NULL;
------------    struct acpi_video_bus *video;
--------- -- 
         -      struct device *dev;
++++++++++++    struct acpi_video_bus *video = acpi_driver_data(device);
++++++++++++    struct proc_dir_entry *device_dir;
++++++++++++    struct proc_dir_entry *entry;
             
--------- --    video = acpi_driver_data(device);
         -      status =
         -          acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
++++++++++++    device_dir = proc_mkdir(acpi_device_bid(device), acpi_video_dir);
++++++++++++    if (!device_dir)
++++++++++++            return -ENOMEM;
             
         -      if (!ACPI_SUCCESS(status))
         -              return -ENODEV;
         -   
         -      /* We need to attempt to determine whether the _ADR refers to a
         -         PCI device or not. There's no terribly good way to do this,
         -         so the best we can hope for is to assume that there'll never
         -         be a video device in the host bridge */
         -      if (device_id >= 0x10000) {
         -              /* It looks like a PCI device. Does it exist? */
         -              dev = acpi_get_physical_device(device->handle);
         -      } else {
         -              /* It doesn't look like a PCI device. Does its parent
         -                 exist? */
         -              acpi_handle phandle;
         -              if (acpi_get_parent(device->handle, &phandle))
         -                      return -ENODEV;
         -              dev = acpi_get_physical_device(phandle);
         -      }
         -      if (!dev)
         -              return -ENODEV;
         -      put_device(dev);
         -   
         -   
         -   
         -      video = acpi_driver_data(device);
         -   
------------    if (!acpi_device_dir(device)) {
------------            acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
------------                                                 acpi_video_dir);
------------            if (!acpi_device_dir(device))
------------                    return -ENODEV;
------------            video->dir = acpi_device_dir(device);
------------            acpi_device_dir(device)->owner = THIS_MODULE;
------------    }
++++++++++++    device_dir->owner = THIS_MODULE;
             
                /* 'info' [R] */
------------    entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device));
++++++++++++    entry = create_proc_entry("info", S_IRUGO, device_dir);
                if (!entry)
------------            return -ENODEV;
------------    else {
------------            entry->proc_fops = &acpi_video_bus_info_fops;
------------            entry->data = acpi_driver_data(device);
------------            entry->owner = THIS_MODULE;
------------    }
++++++++++++            goto err_remove_dir;
++++++++++++ 
++++++++++++    entry->proc_fops = &acpi_video_bus_info_fops;
++++++++++++    entry->data = acpi_driver_data(device);
++++++++++++    entry->owner = THIS_MODULE;
             
                /* 'ROM' [R] */
------------    entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device));
++++++++++++    entry = create_proc_entry("ROM", S_IRUGO, device_dir);
                if (!entry)
------------            return -ENODEV;
------------    else {
------------            entry->proc_fops = &acpi_video_bus_ROM_fops;
------------            entry->data = acpi_driver_data(device);
------------            entry->owner = THIS_MODULE;
------------    }
++++++++++++            goto err_remove_info;
++++++++++++ 
++++++++++++    entry->proc_fops = &acpi_video_bus_ROM_fops;
++++++++++++    entry->data = acpi_driver_data(device);
++++++++++++    entry->owner = THIS_MODULE;
             
                /* 'POST_info' [R] */
------------    entry =
------------        create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device));
++++++++++++    entry = create_proc_entry("POST_info", S_IRUGO, device_dir);
                if (!entry)
------------            return -ENODEV;
------------    else {
------------            entry->proc_fops = &acpi_video_bus_POST_info_fops;
------------            entry->data = acpi_driver_data(device);
------------            entry->owner = THIS_MODULE;
------------    }
++++++++++++            goto err_remove_rom;
++++++++++++ 
++++++++++++    entry->proc_fops = &acpi_video_bus_POST_info_fops;
++++++++++++    entry->data = acpi_driver_data(device);
++++++++++++    entry->owner = THIS_MODULE;
             
                /* 'POST' [R/W] */
------------    entry =
------------        create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR,
------------                          acpi_device_dir(device));
++++++++++++    entry = create_proc_entry("POST", S_IFREG | S_IRUGO | S_IWUSR,
++++++++++++                              device_dir);
                if (!entry)
------------            return -ENODEV;
------------    else {
------------            acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
------------            entry->proc_fops = &acpi_video_bus_POST_fops;
------------            entry->data = acpi_driver_data(device);
------------            entry->owner = THIS_MODULE;
------------    }
++++++++++++            goto err_remove_post_info;
++++++++++++ 
++++++++++++    acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
++++++++++++    entry->proc_fops = &acpi_video_bus_POST_fops;
++++++++++++    entry->data = acpi_driver_data(device);
++++++++++++    entry->owner = THIS_MODULE;
             
                /* 'DOS' [R/W] */
------------    entry =
------------        create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR,
------------                          acpi_device_dir(device));
++++++++++++    entry = create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IWUSR,
++++++++++++                          device_dir);
                if (!entry)
------------            return -ENODEV;
------------    else {
------------            acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
------------            entry->proc_fops = &acpi_video_bus_DOS_fops;
------------            entry->data = acpi_driver_data(device);
------------            entry->owner = THIS_MODULE;
------------    }
++++++++++++            goto err_remove_post;
++++++++++ + 
++++++++++++    acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
++++++++++++    entry->proc_fops = &acpi_video_bus_DOS_fops;
++++++++++++    entry->data = acpi_driver_data(device);
++++++++++++    entry->owner = THIS_MODULE;
          +  
++++++++++++    video->dir = acpi_device_dir(device) = device_dir;
                return 0;
++++++++++++ 
++++++++++++  err_remove_post:
++++++++++++    remove_proc_entry("POST", device_dir);
++++++++++++  err_remove_post_info:
++++++++++++    remove_proc_entry("POST_info", device_dir);
++++++++++++  err_remove_rom:
++++++++++++    remove_proc_entry("ROM", device_dir);
++++++++++++  err_remove_info:
++++++++++++    remove_proc_entry("info", device_dir);
++++++++++++  err_remove_dir:
++++++++++++    remove_proc_entry(acpi_device_bid(device), acpi_video_dir);
++++++++++++    return -ENOMEM;
             }
             
             static int acpi_video_bus_remove_fs(struct acpi_device *device)
@@@@@@@@@@@@@@ -107,8 -107,8 -140,8 -140,8 -107,8 -140,8 -107,8 -140,9 -107,8 -107,7 -140,8 -140,8 -140,8 +140,9 @@@@@@@@@@@@@@ config ACER_WM
                depends on EXPERIMENTAL
                depends on ACPI
                depends on LEDS_CLASS
+++++++ +++++   depends on NEW_LEDS
                depends on BACKLIGHT_CLASS_DEVICE
         +      depends on SERIO_I8042
                select ACPI_WMI
                ---help---
                  This is a driver for newer Acer (and Wistron) laptops. It adds
@@@@@@@@@@@@@@ -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4265,106 -4266,106 -4697,23 -4266,106 +4697,23 @@@@@@@@@@@@@@ static int brightness_update_status(str
                                        bd->props.brightness : 0);
             }
             
----------- -static struct backlight_ops ibm_backlight_data = {
----------- -   .get_brightness = brightness_get,
----------- -   .update_status  = brightness_update_status,
----------- -};
----------- -
----------- -/* --------------------------------------------------------------------- */
----------- -
----------- -static int __init tpacpi_query_bcll_levels(acpi_handle handle)
----------- -{
----------- -   struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
----------- -   union acpi_object *obj;
----------- -   int rc;
----------- -
----------- -   if (ACPI_SUCCESS(acpi_evaluate_object(handle, NULL, NULL, &buffer))) {
----------- -           obj = (union acpi_object *)buffer.pointer;
----------- -           if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
----------- -                   printk(TPACPI_ERR "Unknown BCLL data, "
----------- -                          "please report this to %s\n", TPACPI_MAIL);
----------- -                   rc = 0;
----------- -           } else {
----------- -                   rc = obj->package.count;
----------- -           }
----------- -   } else {
----------- -           return 0;
----------- -   }
----------- -
----------- -   kfree(buffer.pointer);
----------- -   return rc;
----------- -}
----------- -
----------- -static acpi_status __init brightness_find_bcll(acpi_handle handle, u32 lvl,
----------- -                                   void *context, void **rv)
--------- - -{
--------- - -   char name[ACPI_PATH_SEGMENT_LENGTH];
--------- - -   struct acpi_buffer buffer = { sizeof(name), &name };
--------- - -
--------- - -   if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) &&
--------- - -       !strncmp("BCLL", name, sizeof(name) - 1)) {
--------- - -           if (tpacpi_query_bcll_levels(handle) == 16) {
--------- - -                   *rv = handle;
--------- - -                   return AE_CTRL_TERMINATE;
--------- - -           } else {
--------- - -                   return AE_OK;
--------- - -           }
--------- - -   } else {
--------- - -           return AE_OK;
--------- - -   }
--------- - -}
--------- - -
--------- - -static int __init brightness_check_levels(void)
+++++++++++ +static int brightness_get(struct backlight_device *bd)
             {
--------- - -   int status;
--------- - -   void *found_node = NULL;
         -      char name[ACPI_PATH_SEGMENT_LENGTH];
         -      struct acpi_buffer buffer = { sizeof(name), &name };
+++++++++++ +   int status, res;
             
         -      if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) &&
         -          !strncmp("BCLL", name, sizeof(name) - 1)) {
         -              if (tpacpi_query_bcll_levels(handle) == 16) {
         -                      *rv = handle;
         -                      return AE_CTRL_TERMINATE;
         -              } else {
         -                      return AE_OK;
         -              }
         -      } else {
         -              return AE_OK;
         -      }
         -   }
         -   
         -   static int __init brightness_check_levels(void)
         -   {
         -      int status;
         -      void *found_node = NULL;
         -   
----------- -   if (!vid_handle) {
----------- -           TPACPI_ACPIHANDLE_INIT(vid);
----------- -   }
----------- -   if (!vid_handle)
----------- -           return 0;
----------- -
----------- -   /* Search for a BCLL package with 16 levels */
----------- -   status = acpi_walk_namespace(ACPI_TYPE_PACKAGE, vid_handle, 3,
----------- -                                   brightness_find_bcll, NULL,
----------- -                                   &found_node);
----------- -
----------- -   return (ACPI_SUCCESS(status) && found_node != NULL);
----------- -}
----------- -
----------- -static acpi_status __init brightness_find_bcl(acpi_handle handle, u32 lvl,
----------- -                                   void *context, void **rv)
----------- -{
----------- -   char name[ACPI_PATH_SEGMENT_LENGTH];
----------- -   struct acpi_buffer buffer = { sizeof(name), &name };
+++++++++++ +   res = brightness_get_raw(&status);
+++++++++++ +   if (res < 0)
+++++++++++ +           return 0; /* FIXME: teach backlight about error handling */
             
----------- -   if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) &&
----------- -       !strncmp("_BCL", name, sizeof(name) - 1)) {
----------- -           *rv = handle;
----------- -           return AE_CTRL_TERMINATE;
----------- -   } else {
----------- -           return AE_OK;
----------- -   }
+++++++++++ +   return status & TP_EC_BACKLIGHT_LVLMSK;
             }
             
----------- -static int __init brightness_check_std_acpi_support(void)
----------- -{
----------- -   int status;
----------- -   void *found_node = NULL;
----------- -
----------- -   if (!vid_handle) {
----------- -           TPACPI_ACPIHANDLE_INIT(vid);
----------- -   }
----------- -   if (!vid_handle)
----------- -           return 0;
----------- -
----------- -   /* Search for a _BCL method, but don't execute it */
----------- -   status = acpi_walk_namespace(ACPI_TYPE_METHOD, vid_handle, 3,
----------- -                                brightness_find_bcl, NULL, &found_node);
+++++++++++ +static struct backlight_ops ibm_backlight_data = {
+++++++++++ +   .get_brightness = brightness_get,
+++++++++++ +   .update_status  = brightness_update_status,
+++++++++++ +};
             
----------- -   return (ACPI_SUCCESS(status) && found_node != NULL);
----------- -}
+++++++++++ +/* --------------------------------------------------------------------- */
             
             static int __init brightness_init(struct ibm_init_struct *iibm)
             {