aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/ac.c')
-rw-r--r--drivers/acpi/ac.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 56205a0b85df..ba9afeaa23ac 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -32,9 +32,7 @@
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#endif 34#endif
35#ifdef CONFIG_ACPI_SYSFS_POWER
36#include <linux/power_supply.h> 35#include <linux/power_supply.h>
37#endif
38#include <acpi/acpi_bus.h> 36#include <acpi/acpi_bus.h>
39#include <acpi/acpi_drivers.h> 37#include <acpi/acpi_drivers.h>
40 38
@@ -86,9 +84,7 @@ static struct acpi_driver acpi_ac_driver = {
86}; 84};
87 85
88struct acpi_ac { 86struct acpi_ac {
89#ifdef CONFIG_ACPI_SYSFS_POWER
90 struct power_supply charger; 87 struct power_supply charger;
91#endif
92 struct acpi_device * device; 88 struct acpi_device * device;
93 unsigned long long state; 89 unsigned long long state;
94}; 90};
@@ -104,7 +100,6 @@ static const struct file_operations acpi_ac_fops = {
104 .release = single_release, 100 .release = single_release,
105}; 101};
106#endif 102#endif
107#ifdef CONFIG_ACPI_SYSFS_POWER
108static int get_ac_property(struct power_supply *psy, 103static int get_ac_property(struct power_supply *psy,
109 enum power_supply_property psp, 104 enum power_supply_property psp,
110 union power_supply_propval *val) 105 union power_supply_propval *val)
@@ -123,7 +118,6 @@ static int get_ac_property(struct power_supply *psy,
123static enum power_supply_property ac_props[] = { 118static enum power_supply_property ac_props[] = {
124 POWER_SUPPLY_PROP_ONLINE, 119 POWER_SUPPLY_PROP_ONLINE,
125}; 120};
126#endif
127/* -------------------------------------------------------------------------- 121/* --------------------------------------------------------------------------
128 AC Adapter Management 122 AC Adapter Management
129 -------------------------------------------------------------------------- */ 123 -------------------------------------------------------------------------- */
@@ -247,9 +241,7 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
247 dev_name(&device->dev), event, 241 dev_name(&device->dev), event,
248 (u32) ac->state); 242 (u32) ac->state);
249 acpi_notifier_call_chain(device, event, (u32) ac->state); 243 acpi_notifier_call_chain(device, event, (u32) ac->state);
250#ifdef CONFIG_ACPI_SYSFS_POWER
251 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); 244 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
252#endif
253 } 245 }
254 246
255 return; 247 return;
@@ -282,14 +274,12 @@ static int acpi_ac_add(struct acpi_device *device)
282#endif 274#endif
283 if (result) 275 if (result)
284 goto end; 276 goto end;
285#ifdef CONFIG_ACPI_SYSFS_POWER
286 ac->charger.name = acpi_device_bid(device); 277 ac->charger.name = acpi_device_bid(device);
287 ac->charger.type = POWER_SUPPLY_TYPE_MAINS; 278 ac->charger.type = POWER_SUPPLY_TYPE_MAINS;
288 ac->charger.properties = ac_props; 279 ac->charger.properties = ac_props;
289 ac->charger.num_properties = ARRAY_SIZE(ac_props); 280 ac->charger.num_properties = ARRAY_SIZE(ac_props);
290 ac->charger.get_property = get_ac_property; 281 ac->charger.get_property = get_ac_property;
291 power_supply_register(&ac->device->dev, &ac->charger); 282 power_supply_register(&ac->device->dev, &ac->charger);
292#endif
293 283
294 printk(KERN_INFO PREFIX "%s [%s] (%s)\n", 284 printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
295 acpi_device_name(device), acpi_device_bid(device), 285 acpi_device_name(device), acpi_device_bid(device),
@@ -316,10 +306,8 @@ static int acpi_ac_resume(struct acpi_device *device)
316 old_state = ac->state; 306 old_state = ac->state;
317 if (acpi_ac_get_state(ac)) 307 if (acpi_ac_get_state(ac))
318 return 0; 308 return 0;
319#ifdef CONFIG_ACPI_SYSFS_POWER
320 if (old_state != ac->state) 309 if (old_state != ac->state)
321 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); 310 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
322#endif
323 return 0; 311 return 0;
324} 312}
325 313
@@ -333,10 +321,8 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
333 321
334 ac = acpi_driver_data(device); 322 ac = acpi_driver_data(device);
335 323
336#ifdef CONFIG_ACPI_SYSFS_POWER
337 if (ac->charger.dev) 324 if (ac->charger.dev)
338 power_supply_unregister(&ac->charger); 325 power_supply_unregister(&ac->charger);
339#endif
340#ifdef CONFIG_ACPI_PROCFS_POWER 326#ifdef CONFIG_ACPI_PROCFS_POWER
341 acpi_ac_remove_fs(device); 327 acpi_ac_remove_fs(device);
342#endif 328#endif