summaryrefslogtreecommitdiffstats
path: root/acpi-update-battery-information-on-notification-0x81.patch
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mcmartin.ca>2010-11-02 13:06:42 -0400
committerKyle McMartin <kyle@mcmartin.ca>2010-11-02 13:06:42 -0400
commit7b2f649ec2da6640878c15298f5d3f8451dd8125 (patch)
treeb26440ffa8853847fa0625f932673c7ff2554f2c /acpi-update-battery-information-on-notification-0x81.patch
parent3daa57b3d93c5d0a795e3446850c83483df37f2e (diff)
downloadkernel-7b2f649ec2da6640878c15298f5d3f8451dd8125.tar.gz
kernel-7b2f649ec2da6640878c15298f5d3f8451dd8125.tar.xz
kernel-7b2f649ec2da6640878c15298f5d3f8451dd8125.zip
Linux 2.6.37-rc1
Diffstat (limited to 'acpi-update-battery-information-on-notification-0x81.patch')
-rw-r--r--acpi-update-battery-information-on-notification-0x81.patch39
1 files changed, 14 insertions, 25 deletions
diff --git a/acpi-update-battery-information-on-notification-0x81.patch b/acpi-update-battery-information-on-notification-0x81.patch
index 5fe34b9c0..3704b054d 100644
--- a/acpi-update-battery-information-on-notification-0x81.patch
+++ b/acpi-update-battery-information-on-notification-0x81.patch
@@ -12,14 +12,14 @@ and recreate the battery in order to populate the fields correctly.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
- drivers/acpi/battery.c | 22 +++++++++++++++++-----
- 1 files changed, 17 insertions(+), 5 deletions(-)
+ drivers/acpi/battery.c | 20 +++++++++++++++-----
+ 1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
-index dc58402..69638c4 100644
+index 95649d3..2a774a8 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
-@@ -562,9 +562,10 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
+@@ -605,9 +605,10 @@ static void acpi_battery_quirks2(struct acpi_battery *battery)
}
}
@@ -31,24 +31,22 @@ index dc58402..69638c4 100644
result = acpi_battery_get_status(battery);
if (result)
return result;
-@@ -587,6 +588,16 @@ static int acpi_battery_update(struct acpi_battery *battery)
- if (!battery->bat.dev)
+@@ -628,6 +629,14 @@ static int acpi_battery_update(struct acpi_battery *battery)
sysfs_add_battery(battery);
- #endif
+ result = acpi_battery_get_state(battery);
+ acpi_battery_quirks2(battery);
+ if (get_info) {
+ acpi_battery_get_info(battery);
-+#ifdef CONFIG_ACPI_SYSFS_POWER
+ if (old_power_unit != battery->power_unit) {
+ /* The battery has changed its reporting units */
+ sysfs_remove_battery(battery);
+ sysfs_add_battery(battery);
+ }
-+#endif
+ }
- return acpi_battery_get_state(battery);
+ return result;
}
-@@ -762,7 +773,7 @@ static print_func acpi_print_funcs[ACPI_BATTERY_NUMFILES] = {
+@@ -803,7 +812,7 @@ static print_func acpi_print_funcs[ACPI_BATTERY_NUMFILES] = {
static int acpi_battery_read(int fid, struct seq_file *seq)
{
struct acpi_battery *battery = seq->private;
@@ -57,17 +55,17 @@ index dc58402..69638c4 100644
return acpi_print_funcs[fid](seq, result);
}
-@@ -877,7 +888,8 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
- #ifdef CONFIG_ACPI_SYSFS_POWER
+@@ -914,7 +923,8 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
+ if (!battery)
+ return;
old = battery->bat.dev;
- #endif
- acpi_battery_update(battery);
+ acpi_battery_update(battery, (event == ACPI_BATTERY_NOTIFY_INFO ? true
+ : false));
acpi_bus_generate_proc_event(device, event,
acpi_battery_present(battery));
acpi_bus_generate_netlink_event(device->pnp.device_class,
-@@ -908,7 +920,7 @@ static int acpi_battery_add(struct acpi_device *device)
+@@ -943,7 +953,7 @@ static int acpi_battery_add(struct acpi_device *device)
if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle,
"_BIX", &handle)))
set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
@@ -76,7 +74,7 @@ index dc58402..69638c4 100644
#ifdef CONFIG_ACPI_PROCFS_POWER
result = acpi_battery_add_fs(device);
#endif
-@@ -951,7 +963,7 @@ static int acpi_battery_resume(struct acpi_device *device)
+@@ -984,7 +994,7 @@ static int acpi_battery_resume(struct acpi_device *device)
return -EINVAL;
battery = acpi_driver_data(device);
battery->update_time = 0;
@@ -85,12 +83,3 @@ index dc58402..69638c4 100644
return 0;
}
---
-1.7.2.1
-
---
-To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at http://vger.kernel.org/majordomo-info.html
-Please read the FAQ at http://www.tux.org/lkml/
-