Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39596
b: refs/heads/master
c: 34c4415
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Kosina authored and Len Brown committed Oct 14, 2006
1 parent 7f4f6d5 commit ed85b60
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cd5b87d96db503f69a5892b8f5350d356d18969
refs/heads/master: 34c4415ab857dc6d51db08d62bcd45d4b8513bb6
14 changes: 14 additions & 0 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);

static int acpi_battery_add(struct acpi_device *device);
static int acpi_battery_remove(struct acpi_device *device, int type);
static int acpi_battery_resume(struct acpi_device *device, int status);

static struct acpi_driver acpi_battery_driver = {
.name = ACPI_BATTERY_DRIVER_NAME,
.class = ACPI_BATTERY_CLASS,
.ids = ACPI_BATTERY_HID,
.ops = {
.add = acpi_battery_add,
.resume = acpi_battery_resume,
.remove = acpi_battery_remove,
},
};
Expand Down Expand Up @@ -753,6 +755,18 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
return 0;
}

/* this is needed to learn about changes made in suspended state */
static int acpi_battery_resume(struct acpi_device *device, int state)
{
struct acpi_battery *battery;

if (!device)
return -EINVAL;

battery = device->driver_data;
return acpi_battery_check(battery);
}

static int __init acpi_battery_init(void)
{
int result;
Expand Down

0 comments on commit ed85b60

Please sign in to comment.