]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'async-battery' into release
authorLen Brown <len.brown@intel.com>
Sun, 5 Apr 2009 05:48:46 +0000 (01:48 -0400)
committerLen Brown <len.brown@intel.com>
Sun, 5 Apr 2009 05:48:46 +0000 (01:48 -0400)
Conflicts:
drivers/acpi/Makefile

Signed-off-by: Len Brown <len.brown@intel.com>
1  2 
drivers/acpi/Makefile
drivers/acpi/battery.c

diff --combined drivers/acpi/Makefile
index 4d4e3e02fcb777d8b019bfec6f9aef6f143cfcbd,298caf6862b6de6eee9f210d3810ab6da3cdda4d..03a985be3fe3c6554c13b6549fa7b56aac474e49
@@@ -14,50 -14,48 +14,50 @@@ obj-$(CONFIG_X86)          += blacklist.
  #
  # ACPI Core Subsystem (Interpreter)
  #
 -obj-y                         += osl.o utils.o reboot.o\
 +obj-y                         += acpi.o \
                                        acpica/
  
 +# All the builtin files are in the "acpi." module_param namespace.
 +acpi-y                                += osl.o utils.o reboot.o
 +
  # sleep related files
 -obj-y                         += wakeup.o
 -obj-y                         += sleep.o
 -obj-$(CONFIG_ACPI_SLEEP)      += proc.o
 +acpi-y                                += wakeup.o
 +acpi-y                                += sleep.o
 +acpi-$(CONFIG_ACPI_SLEEP)     += proc.o
  
  
  #
  # ACPI Bus and Device Drivers
  #
 -processor-objs        += processor_core.o processor_throttling.o \
 -                              processor_idle.o processor_thermal.o
 -ifdef CONFIG_CPU_FREQ
 -processor-objs        += processor_perflib.o
 +acpi-y                                += bus.o glue.o
 +acpi-y                                += scan.o
 +acpi-y                                += ec.o
 +acpi-$(CONFIG_ACPI_DOCK)      += dock.o
 +acpi-y                                += pci_root.o pci_link.o pci_irq.o pci_bind.o
 +acpi-y                                += power.o
 +acpi-y                                += system.o event.o
 +acpi-$(CONFIG_ACPI_DEBUG)     += debug.o
 +acpi-$(CONFIG_ACPI_NUMA)      += numa.o
 +acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
 +ifdef CONFIG_ACPI_VIDEO
 +acpi-y                                += video_detect.o
  endif
  
 -obj-y                         += bus.o glue.o
 -obj-y                         += scan.o
 -# Keep EC driver first. Initialization of others depend on it.
 -obj-y                         += ec.o
 +# These are (potentially) separate modules
  obj-$(CONFIG_ACPI_AC)                 += ac.o
- obj-$(CONFIG_ACPI_BATTERY)    += battery.o
  obj-$(CONFIG_ACPI_BUTTON)     += button.o
  obj-$(CONFIG_ACPI_FAN)                += fan.o
 -obj-$(CONFIG_ACPI_DOCK)               += dock.o
  obj-$(CONFIG_ACPI_VIDEO)      += video.o
 -ifdef CONFIG_ACPI_VIDEO
 -obj-y                         += video_detect.o
 -endif
 -
 -obj-y                         += pci_root.o pci_link.o pci_irq.o pci_bind.o
  obj-$(CONFIG_ACPI_PCI_SLOT)   += pci_slot.o
  obj-$(CONFIG_ACPI_PROCESSOR)  += processor.o
  obj-$(CONFIG_ACPI_CONTAINER)  += container.o
  obj-$(CONFIG_ACPI_THERMAL)    += thermal.o
 -obj-y                         += power.o
 -obj-y                         += system.o event.o
 -obj-$(CONFIG_ACPI_DEBUG)      += debug.o
 -obj-$(CONFIG_ACPI_NUMA)               += numa.o
 -obj-$(CONFIG_ACPI_HOTPLUG_MEMORY)     += acpi_memhotplug.o
 -obj-$(CONFIG_ACPI_PROCFS_POWER)       += cm_sbs.o
 +obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
+ obj-$(CONFIG_ACPI_BATTERY)    += battery.o
  obj-$(CONFIG_ACPI_SBS)                += sbshc.o
  obj-$(CONFIG_ACPI_SBS)                += sbs.o
 +
 +# processor has its own "processor." module_param namespace
 +processor-y                   := processor_core.o processor_throttling.o
 +processor-y                   += processor_idle.o processor_thermal.o
 +processor-$(CONFIG_CPU_FREQ)  += processor_perflib.o
diff --combined drivers/acpi/battery.c
index 09a2240d5605291ea37db1b0320bfa1b698d045f,0f1c8190c1d31ac90af7ce810795794214d44ab4..5dfe18bf24cbbea35d1894a78bf14f035eb98fde
@@@ -30,6 -30,7 +30,7 @@@
  #include <linux/init.h>
  #include <linux/types.h>
  #include <linux/jiffies.h>
+ #include <linux/async.h>
  
  #ifdef CONFIG_ACPI_PROCFS_POWER
  #include <linux/proc_fs.h>
@@@ -92,7 -93,7 +93,7 @@@ struct acpi_battery 
  #endif
        struct acpi_device *device;
        unsigned long update_time;
 -      int current_now;
 +      int rate_now;
        int capacity_now;
        int voltage_now;
        int design_capacity;
@@@ -196,8 -197,7 +197,8 @@@ static int acpi_battery_get_property(st
                val->intval = battery->voltage_now * 1000;
                break;
        case POWER_SUPPLY_PROP_CURRENT_NOW:
 -              val->intval = battery->current_now * 1000;
 +      case POWER_SUPPLY_PROP_POWER_NOW:
 +              val->intval = battery->rate_now * 1000;
                break;
        case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
        case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
@@@ -248,7 -248,6 +249,7 @@@ static enum power_supply_property energ
        POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
        POWER_SUPPLY_PROP_VOLTAGE_NOW,
        POWER_SUPPLY_PROP_CURRENT_NOW,
 +      POWER_SUPPLY_PROP_POWER_NOW,
        POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
        POWER_SUPPLY_PROP_ENERGY_FULL,
        POWER_SUPPLY_PROP_ENERGY_NOW,
@@@ -275,7 -274,7 +276,7 @@@ struct acpi_offsets 
  
  static struct acpi_offsets state_offsets[] = {
        {offsetof(struct acpi_battery, state), 0},
 -      {offsetof(struct acpi_battery, current_now), 0},
 +      {offsetof(struct acpi_battery, rate_now), 0},
        {offsetof(struct acpi_battery, capacity_now), 0},
        {offsetof(struct acpi_battery, voltage_now), 0},
  };
@@@ -607,11 -606,11 +608,11 @@@ static int acpi_battery_print_state(str
        else
                seq_printf(seq, "charging state:          charged\n");
  
 -      if (battery->current_now == ACPI_BATTERY_VALUE_UNKNOWN)
 +      if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
                seq_printf(seq, "present rate:            unknown\n");
        else
                seq_printf(seq, "present rate:            %d %s\n",
 -                         battery->current_now, acpi_battery_units(battery));
 +                         battery->rate_now, acpi_battery_units(battery));
  
        if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN)
                seq_printf(seq, "remaining capacity:      unknown\n");
@@@ -903,21 -902,27 +904,27 @@@ static struct acpi_driver acpi_battery_
                },
  };
  
- static int __init acpi_battery_init(void)
+ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
  {
        if (acpi_disabled)
-               return -ENODEV;
+               return;
  #ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_battery_dir = acpi_lock_battery_dir();
        if (!acpi_battery_dir)
-               return -ENODEV;
+               return;
  #endif
        if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
  #ifdef CONFIG_ACPI_PROCFS_POWER
                acpi_unlock_battery_dir(acpi_battery_dir);
  #endif
-               return -ENODEV;
+               return;
        }
+       return;
+ }
+ static int __init acpi_battery_init(void)
+ {
+       async_schedule(acpi_battery_init_async, NULL);
        return 0;
  }