]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'dock' into test
authorLen Brown <len.brown@intel.com>
Thu, 23 Oct 2008 03:25:26 +0000 (23:25 -0400)
committerLen Brown <len.brown@intel.com>
Thu, 23 Oct 2008 03:25:26 +0000 (23:25 -0400)
Conflicts:
drivers/acpi/osl.c

Signed-off-by: Len Brown <len.brown@intel.com>
1  2 
MAINTAINERS
drivers/acpi/bus.c
drivers/acpi/osl.c
include/acpi/acpi_drivers.h

diff --combined MAINTAINERS
index 8dae4555f10e1b91f0c2eafb84f04fbf71812e55,7212af723147800c63e11791961a102afbf79e57..4b7d8f291cd4a043dff37ec9fd66b45269fcfc9f
@@@ -1198,7 -1198,9 +1198,7 @@@ M:      hpa@zytor.co
  S:    Maintained
  
  CPUSETS
 -P:    Paul Jackson
  P:    Paul Menage
 -M:    pj@sgi.com
  M:    menage@google.com
  L:    linux-kernel@vger.kernel.org
  W:    http://www.bullopensource.org/cpuset/
@@@ -1415,8 -1417,8 +1415,8 @@@ M:      rdunlap@xenotime.ne
  S:    Maintained
  
  DOCKING STATION DRIVER
- P:    Kristen Carlson Accardi
- M:    kristen.c.accardi@intel.com
+ P:    Shaohua Li
+ M:    shaohua.li@intel.com
  L:    linux-acpi@vger.kernel.org
  S:    Supported
  
@@@ -1982,7 -1984,7 +1982,7 @@@ S:      Maintaine
  I2C/SMBUS STUB DRIVER
  P:    Mark M. Hoffman
  M:    mhoffman@lightlink.com
 -L:    lm-sensors@lm-sensors.org
 +L:    i2c@lm-sensors.org
  S:    Maintained
  
  I2C SUBSYSTEM
@@@ -2704,7 -2706,6 +2704,7 @@@ MAN-PAGES: MANUAL PAGES FOR LINUX -- Se
  P:    Michael Kerrisk
  M:    mtk.manpages@gmail.com
  W:    http://www.kernel.org/doc/man-pages
 +L:    linux-man@vger.kernel.org
  S:    Supported
  
  MARVELL LIBERTAS WIRELESS DRIVER
@@@ -3725,7 -3726,7 +3725,7 @@@ S:      Maintaine
  SIS 96X I2C/SMBUS DRIVER
  P:    Mark M. Hoffman
  M:    mhoffman@lightlink.com
 -L:    lm-sensors@lm-sensors.org
 +L:    i2c@lm-sensors.org
  S:    Maintained
  
  SIS FRAMEBUFFER DRIVER
@@@ -3832,12 -3833,11 +3832,12 @@@ S:   Maintaine
  
  SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT
  P:    Liam Girdwood
 -M:    liam.girdwood@wolfsonmicro.com
 +M:    lrg@slimlogic.co.uk
  P:    Mark Brown
  M:    broonie@opensource.wolfsonmicro.com
  T:    git opensource.wolfsonmicro.com/linux-2.6-asoc
  L:    alsa-devel@alsa-project.org (subscribers-only)
 +W:    http://alsa-project.org/main/index.php/ASoC
  S:    Supported
  
  SPI SUBSYSTEM
diff --combined drivers/acpi/bus.c
index e9b116d2b56dbc984e408286cf5af4dc0ef9a28e,0dc44945725ef1c53e0ae0c5f9ebbbd220256675..e6311f432edf7f24d2c42fbaf73a23e65a035369
@@@ -48,23 -48,6 +48,23 @@@ EXPORT_SYMBOL(acpi_root_dir)
  
  #define STRUCT_TO_INT(s)      (*((int*)&s))
  
 +static int set_power_nocheck(const struct dmi_system_id *id)
 +{
 +      printk(KERN_NOTICE PREFIX "%s detected - "
 +              "disable power check in power transistion\n", id->ident);
 +      acpi_power_nocheck = 1;
 +      return 0;
 +}
 +static struct dmi_system_id __cpuinitdata power_nocheck_dmi_table[] = {
 +      {
 +      set_power_nocheck, "HP Pavilion 05", {
 +      DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
 +      DMI_MATCH(DMI_SYS_VENDOR, "HP Pavilion 05"),
 +      DMI_MATCH(DMI_PRODUCT_VERSION, "2001211RE101GLEND") }, NULL},
 +      {},
 +};
 +
 +
  /* --------------------------------------------------------------------------
                                  Device Management
     -------------------------------------------------------------------------- */
@@@ -112,21 -95,21 +112,21 @@@ int acpi_bus_get_status(struct acpi_dev
        }
  
        /*
 -       * Otherwise we assume the status of our parent (unless we don't
 -       * have one, in which case status is implied).
 +       * According to ACPI spec some device can be present and functional
 +       * even if the parent is not present but functional.
 +       * In such conditions the child device should not inherit the status
 +       * from the parent.
         */
 -      else if (device->parent)
 -              device->status = device->parent->status;
        else
                STRUCT_TO_INT(device->status) =
                    ACPI_STA_DEVICE_PRESENT | ACPI_STA_DEVICE_ENABLED |
                    ACPI_STA_DEVICE_UI      | ACPI_STA_DEVICE_FUNCTIONING;
  
        if (device->status.functional && !device->status.present) {
 -              printk(KERN_WARNING PREFIX "Device [%s] status [%08x]: "
 -                     "functional but not present; setting present\n",
 -                     device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status));
 -              device->status.present = 1;
 +              ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]: "
 +                     "functional but not present;\n",
 +                      device->pnp.bus_id,
 +                      (u32) STRUCT_TO_INT(device->status)));
        }
  
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n",
@@@ -240,19 -223,7 +240,19 @@@ int acpi_bus_set_power(acpi_handle hand
        /*
         * Get device's current power state
         */
 -      acpi_bus_get_power(device->handle, &device->power.state);
 +      if (!acpi_power_nocheck) {
 +              /*
 +               * Maybe the incorrect power state is returned on the bogus
 +               * bios, which is different with the real power state.
 +               * For example: the bios returns D0 state and the real power
 +               * state is D3. OS expects to set the device to D0 state. In
 +               * such case if OS uses the power state returned by the BIOS,
 +               * the device can't be transisted to the correct power state.
 +               * So if the acpi_power_nocheck is set, it is unnecessary to
 +               * get the power state by calling acpi_bus_get_power.
 +               */
 +              acpi_bus_get_power(device->handle, &device->power.state);
 +      }
        if ((state == device->power.state) && !device->flags.force_power_state) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
                                  state));
@@@ -525,6 -496,19 +525,19 @@@ static int acpi_bus_check_scope(struct 
        return 0;
  }
  
+ static BLOCKING_NOTIFIER_HEAD(acpi_bus_notify_list);
+ int register_acpi_bus_notifier(struct notifier_block *nb)
+ {
+       return blocking_notifier_chain_register(&acpi_bus_notify_list, nb);
+ }
+ EXPORT_SYMBOL_GPL(register_acpi_bus_notifier);
+ void unregister_acpi_bus_notifier(struct notifier_block *nb)
+ {
+       blocking_notifier_chain_unregister(&acpi_bus_notify_list, nb);
+ }
+ EXPORT_SYMBOL_GPL(unregister_acpi_bus_notifier);
  /**
   * acpi_bus_notify
   * ---------------
@@@ -535,6 -519,8 +548,8 @@@ static void acpi_bus_notify(acpi_handl
        int result = 0;
        struct acpi_device *device = NULL;
  
+       blocking_notifier_call_chain(&acpi_bus_notify_list,
+               type, (void *)handle);
  
        if (acpi_bus_get_device(handle, &device))
                return;
@@@ -847,11 -833,7 +862,11 @@@ static int __init acpi_init(void
                }
        } else
                disable_acpi();
 -
 +      /*
 +       * If the laptop falls into the DMI check table, the power state check
 +       * will be disabled in the course of device power transistion.
 +       */
 +      dmi_check_system(power_nocheck_dmi_table);
        return result;
  }
  
diff --combined drivers/acpi/osl.c
index 1420a9f69e5d0cbf11014197a843bd56a6cad4a1,750e0df15604e13a979684801ffc13e0c3ce7873..6234d3e7acd33e1e4e5f5e31c1c97446454f2abd
@@@ -682,6 -682,22 +682,22 @@@ static void acpi_os_execute_deferred(st
        return;
  }
  
+ static void acpi_os_execute_hp_deferred(struct work_struct *work)
+ {
+       struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
+       if (!dpc) {
+               printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
+               return;
+       }
+       acpi_os_wait_events_complete(NULL);
+       dpc->function(dpc->context);
+       kfree(dpc);
+       return;
+ }
  /*******************************************************************************
   *
   * FUNCTION:    acpi_os_execute
   *
   ******************************************************************************/
  
acpi_status acpi_os_execute(acpi_execute_type type,
-                           acpi_osd_exec_callback function, void *context)
static acpi_status __acpi_os_execute(acpi_execute_type type,
+       acpi_osd_exec_callback function, void *context, int hp)
  {
        acpi_status status = AE_OK;
        struct acpi_os_dpc *dpc;
        struct workqueue_struct *queue;
+       int ret;
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                          "Scheduling function [%p(%p)] for deferred execution.\n",
                          function, context));
        dpc->function = function;
        dpc->context = context;
  
-       INIT_WORK(&dpc->work, acpi_os_execute_deferred);
-       queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq;
-       if (!queue_work(queue, &dpc->work)) {
+       if (!hp) {
+               INIT_WORK(&dpc->work, acpi_os_execute_deferred);
+               queue = (type == OSL_NOTIFY_HANDLER) ?
+                       kacpi_notify_wq : kacpid_wq;
+               ret = queue_work(queue, &dpc->work);
+       } else {
+               INIT_WORK(&dpc->work, acpi_os_execute_hp_deferred);
+               ret = schedule_work(&dpc->work);
+       }
+       if (!ret) {
 -              ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
 -                        "Call to queue_work() failed.\n"));
 +              printk(KERN_ERR PREFIX
 +                        "Call to queue_work() failed.\n");
                status = AE_ERROR;
                kfree(dpc);
        }
        return_ACPI_STATUS(status);
  }
  
+ acpi_status acpi_os_execute(acpi_execute_type type,
+                           acpi_osd_exec_callback function, void *context)
+ {
+       return __acpi_os_execute(type, function, context, 0);
+ }
  EXPORT_SYMBOL(acpi_os_execute);
  
+ acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function,
+       void *context)
+ {
+       return __acpi_os_execute(0, function, context, 1);
+ }
  void acpi_os_wait_events_complete(void *context)
  {
        flush_workqueue(kacpid_wq);
index efbaa271ee11517b66f0d764df3a297f115dc72b,4f5042a0ef80e9da1b7e99eaa1aa9ea20e671911..a35c9597d5b136d76a3e417a26bf1da279da6022
@@@ -93,7 -93,6 +93,7 @@@ int acpi_enable_wakeup_device_power(str
  int acpi_disable_wakeup_device_power(struct acpi_device *dev);
  int acpi_power_get_inferred_state(struct acpi_device *device);
  int acpi_power_transition(struct acpi_device *device, int state);
 +extern int acpi_power_nocheck;
  #endif
  
  /* --------------------------------------------------------------------------
@@@ -116,12 -115,17 +116,17 @@@ int acpi_processor_set_thermal_limit(ac
  /*--------------------------------------------------------------------------
                                    Dock Station
    -------------------------------------------------------------------------- */
+ struct acpi_dock_ops {
+       acpi_notify_handler handler;
+       acpi_notify_handler uevent;
+ };
  #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
  extern int is_dock_device(acpi_handle handle);
  extern int register_dock_notifier(struct notifier_block *nb);
  extern void unregister_dock_notifier(struct notifier_block *nb);
  extern int register_hotplug_dock_device(acpi_handle handle,
-                                       acpi_notify_handler handler,
+                                       struct acpi_dock_ops *ops,
                                        void *context);
  extern void unregister_hotplug_dock_device(acpi_handle handle);
  #else
@@@ -137,7 -141,7 +142,7 @@@ static inline void unregister_dock_noti
  {
  }
  static inline int register_hotplug_dock_device(acpi_handle handle,
-                                              acpi_notify_handler handler,
+                                              struct acpi_dock_ops *ops,
                                               void *context)
  {
        return -ENODEV;