aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/ac.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 1461dc9944a3..30238f6ff232 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -59,6 +59,7 @@ static int acpi_ac_open_fs(struct inode *inode, struct file *file);
59 59
60static int acpi_ac_add(struct acpi_device *device); 60static int acpi_ac_add(struct acpi_device *device);
61static int acpi_ac_remove(struct acpi_device *device, int type); 61static int acpi_ac_remove(struct acpi_device *device, int type);
62static int acpi_ac_resume(struct acpi_device *device);
62 63
63const static struct acpi_device_id ac_device_ids[] = { 64const static struct acpi_device_id ac_device_ids[] = {
64 {"ACPI0003", 0}, 65 {"ACPI0003", 0},
@@ -73,6 +74,7 @@ static struct acpi_driver acpi_ac_driver = {
73 .ops = { 74 .ops = {
74 .add = acpi_ac_add, 75 .add = acpi_ac_add,
75 .remove = acpi_ac_remove, 76 .remove = acpi_ac_remove,
77 .resume = acpi_ac_resume,
76 }, 78 },
77}; 79};
78 80
@@ -307,6 +309,21 @@ static int acpi_ac_add(struct acpi_device *device)
307 return result; 309 return result;
308} 310}
309 311
312static int acpi_ac_resume(struct acpi_device *device)
313{
314 struct acpi_ac *ac;
315 unsigned old_state;
316 if (!device || !acpi_driver_data(device))
317 return -EINVAL;
318 ac = acpi_driver_data(device);
319 old_state = ac->state;
320 if (acpi_ac_get_state(ac))
321 return 0;
322 if (old_state != ac->state)
323 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
324 return 0;
325}
326
310static int acpi_ac_remove(struct acpi_device *device, int type) 327static int acpi_ac_remove(struct acpi_device *device, int type)
311{ 328{
312 acpi_status status = AE_OK; 329 acpi_status status = AE_OK;