Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits) ACPI: delete stale reference in kernel-parameters.txt ACPI: add missing _OSI strings ACPI: remove NID_INVAL thermal: make THERMAL_HWMON implementation fully internal thermal: split hwmon lookup to a separate function thermal: hide CONFIG_THERMAL_HWMON ACPI print OSI(Linux) warning only once ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX ACPI / Battery: propagate sysfs error in acpi_battery_add() ACPI / Battery: avoid acpi_battery_add() use-after-free ACPI: introduce "acpi_rsdp=" parameter for kdump ACPI: constify ops structs ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS ACPI: fix 80 char overflow ACPI / Battery: Resolve the race condition in the sysfs_remove_battery() ACPI / Battery: Add the check before refresh sysfs in the battery_notify() ACPI / Battery: Add the hibernation process in the battery_notify() ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks ACPI / Battery: Change 16-bit signed negative battery current into correct value ACPI / Battery: Add the power unit macro ...
This commit is contained in:
@@ -130,6 +130,9 @@ struct acpi_sbs {
|
||||
|
||||
#define to_acpi_sbs(x) container_of(x, struct acpi_sbs, charger)
|
||||
|
||||
static int acpi_sbs_remove(struct acpi_device *device, int type);
|
||||
static int acpi_battery_get_state(struct acpi_battery *battery);
|
||||
|
||||
static inline int battery_scale(int log)
|
||||
{
|
||||
int scale = 1;
|
||||
@@ -195,6 +198,8 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy,
|
||||
|
||||
if ((!battery->present) && psp != POWER_SUPPLY_PROP_PRESENT)
|
||||
return -ENODEV;
|
||||
|
||||
acpi_battery_get_state(battery);
|
||||
switch (psp) {
|
||||
case POWER_SUPPLY_PROP_STATUS:
|
||||
if (battery->rate_now < 0)
|
||||
@@ -225,11 +230,17 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy,
|
||||
case POWER_SUPPLY_PROP_POWER_NOW:
|
||||
val->intval = abs(battery->rate_now) *
|
||||
acpi_battery_ipscale(battery) * 1000;
|
||||
val->intval *= (acpi_battery_mode(battery)) ?
|
||||
(battery->voltage_now *
|
||||
acpi_battery_vscale(battery) / 1000) : 1;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CURRENT_AVG:
|
||||
case POWER_SUPPLY_PROP_POWER_AVG:
|
||||
val->intval = abs(battery->rate_avg) *
|
||||
acpi_battery_ipscale(battery) * 1000;
|
||||
val->intval *= (acpi_battery_mode(battery)) ?
|
||||
(battery->voltage_now *
|
||||
acpi_battery_vscale(battery) / 1000) : 1;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CAPACITY:
|
||||
val->intval = battery->state_of_charge;
|
||||
@@ -903,8 +914,6 @@ static void acpi_sbs_callback(void *context)
|
||||
}
|
||||
}
|
||||
|
||||
static int acpi_sbs_remove(struct acpi_device *device, int type);
|
||||
|
||||
static int acpi_sbs_add(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_sbs *sbs;
|
||||
|
Reference in New Issue
Block a user