diff options
author | Zhang Rui <rui.zhang@intel.com> | 2010-10-08 01:54:57 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-10-15 22:02:38 -0400 |
commit | 1b3d4c3b9a597e216c08bff2c59a8de872ef2d09 (patch) | |
tree | 51844bb5a61d5412e290e87bcea8a37043f2ee29 /drivers/acpi/battery.c | |
parent | cd07202cc8262e1669edff0d97715f3dd9260917 (diff) |
ACPI ac/battery/sbs: sysfs I/F always built in, procfs I/F disabled by default
ACPI AC/Battery/SBS driver has different kernel option for procfs and sysfs I/F.
This patch,
1. Change CONFIG_ACPI_PROCFS_POWER to 'n' by default so that we can remove it in the next release or two.
2. Remove CONFIG_ACPI_SYSFS_POWER and always build in the sysfs I/F of these drivers.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r-- | drivers/acpi/battery.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 98417201e9c..7b8787b490f 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -42,10 +42,7 @@ | |||
42 | 42 | ||
43 | #include <acpi/acpi_bus.h> | 43 | #include <acpi/acpi_bus.h> |
44 | #include <acpi/acpi_drivers.h> | 44 | #include <acpi/acpi_drivers.h> |
45 | |||
46 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
47 | #include <linux/power_supply.h> | 45 | #include <linux/power_supply.h> |
48 | #endif | ||
49 | 46 | ||
50 | #define PREFIX "ACPI: " | 47 | #define PREFIX "ACPI: " |
51 | 48 | ||
@@ -102,9 +99,7 @@ enum { | |||
102 | 99 | ||
103 | struct acpi_battery { | 100 | struct acpi_battery { |
104 | struct mutex lock; | 101 | struct mutex lock; |
105 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
106 | struct power_supply bat; | 102 | struct power_supply bat; |
107 | #endif | ||
108 | struct acpi_device *device; | 103 | struct acpi_device *device; |
109 | unsigned long update_time; | 104 | unsigned long update_time; |
110 | int rate_now; | 105 | int rate_now; |
@@ -141,7 +136,6 @@ inline int acpi_battery_present(struct acpi_battery *battery) | |||
141 | return battery->device->status.battery_present; | 136 | return battery->device->status.battery_present; |
142 | } | 137 | } |
143 | 138 | ||
144 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
145 | static int acpi_battery_technology(struct acpi_battery *battery) | 139 | static int acpi_battery_technology(struct acpi_battery *battery) |
146 | { | 140 | { |
147 | if (!strcasecmp("NiCd", battery->type)) | 141 | if (!strcasecmp("NiCd", battery->type)) |
@@ -281,7 +275,6 @@ static enum power_supply_property energy_battery_props[] = { | |||
281 | POWER_SUPPLY_PROP_MANUFACTURER, | 275 | POWER_SUPPLY_PROP_MANUFACTURER, |
282 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | 276 | POWER_SUPPLY_PROP_SERIAL_NUMBER, |
283 | }; | 277 | }; |
284 | #endif | ||
285 | 278 | ||
286 | #ifdef CONFIG_ACPI_PROCFS_POWER | 279 | #ifdef CONFIG_ACPI_PROCFS_POWER |
287 | inline char *acpi_battery_units(struct acpi_battery *battery) | 280 | inline char *acpi_battery_units(struct acpi_battery *battery) |
@@ -492,7 +485,6 @@ static int acpi_battery_init_alarm(struct acpi_battery *battery) | |||
492 | return acpi_battery_set_alarm(battery); | 485 | return acpi_battery_set_alarm(battery); |
493 | } | 486 | } |
494 | 487 | ||
495 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
496 | static ssize_t acpi_battery_alarm_show(struct device *dev, | 488 | static ssize_t acpi_battery_alarm_show(struct device *dev, |
497 | struct device_attribute *attr, | 489 | struct device_attribute *attr, |
498 | char *buf) | 490 | char *buf) |
@@ -552,7 +544,6 @@ static void sysfs_remove_battery(struct acpi_battery *battery) | |||
552 | power_supply_unregister(&battery->bat); | 544 | power_supply_unregister(&battery->bat); |
553 | battery->bat.dev = NULL; | 545 | battery->bat.dev = NULL; |
554 | } | 546 | } |
555 | #endif | ||
556 | 547 | ||
557 | static void acpi_battery_quirks(struct acpi_battery *battery) | 548 | static void acpi_battery_quirks(struct acpi_battery *battery) |
558 | { | 549 | { |
@@ -568,9 +559,7 @@ static int acpi_battery_update(struct acpi_battery *battery) | |||
568 | if (result) | 559 | if (result) |
569 | return result; | 560 | return result; |
570 | if (!acpi_battery_present(battery)) { | 561 | if (!acpi_battery_present(battery)) { |
571 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
572 | sysfs_remove_battery(battery); | 562 | sysfs_remove_battery(battery); |
573 | #endif | ||
574 | battery->update_time = 0; | 563 | battery->update_time = 0; |
575 | return 0; | 564 | return 0; |
576 | } | 565 | } |
@@ -582,10 +571,8 @@ static int acpi_battery_update(struct acpi_battery *battery) | |||
582 | acpi_battery_quirks(battery); | 571 | acpi_battery_quirks(battery); |
583 | acpi_battery_init_alarm(battery); | 572 | acpi_battery_init_alarm(battery); |
584 | } | 573 | } |
585 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
586 | if (!battery->bat.dev) | 574 | if (!battery->bat.dev) |
587 | sysfs_add_battery(battery); | 575 | sysfs_add_battery(battery); |
588 | #endif | ||
589 | return acpi_battery_get_state(battery); | 576 | return acpi_battery_get_state(battery); |
590 | } | 577 | } |
591 | 578 | ||
@@ -867,26 +854,20 @@ static void acpi_battery_remove_fs(struct acpi_device *device) | |||
867 | static void acpi_battery_notify(struct acpi_device *device, u32 event) | 854 | static void acpi_battery_notify(struct acpi_device *device, u32 event) |
868 | { | 855 | { |
869 | struct acpi_battery *battery = acpi_driver_data(device); | 856 | struct acpi_battery *battery = acpi_driver_data(device); |
870 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
871 | struct device *old; | 857 | struct device *old; |
872 | #endif | ||
873 | 858 | ||
874 | if (!battery) | 859 | if (!battery) |
875 | return; | 860 | return; |
876 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
877 | old = battery->bat.dev; | 861 | old = battery->bat.dev; |
878 | #endif | ||
879 | acpi_battery_update(battery); | 862 | acpi_battery_update(battery); |
880 | acpi_bus_generate_proc_event(device, event, | 863 | acpi_bus_generate_proc_event(device, event, |
881 | acpi_battery_present(battery)); | 864 | acpi_battery_present(battery)); |
882 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 865 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
883 | dev_name(&device->dev), event, | 866 | dev_name(&device->dev), event, |
884 | acpi_battery_present(battery)); | 867 | acpi_battery_present(battery)); |
885 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
886 | /* acpi_battery_update could remove power_supply object */ | 868 | /* acpi_battery_update could remove power_supply object */ |
887 | if (old && battery->bat.dev) | 869 | if (old && battery->bat.dev) |
888 | power_supply_changed(&battery->bat); | 870 | power_supply_changed(&battery->bat); |
889 | #endif | ||
890 | } | 871 | } |
891 | 872 | ||
892 | static int acpi_battery_add(struct acpi_device *device) | 873 | static int acpi_battery_add(struct acpi_device *device) |
@@ -934,9 +915,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
934 | #ifdef CONFIG_ACPI_PROCFS_POWER | 915 | #ifdef CONFIG_ACPI_PROCFS_POWER |
935 | acpi_battery_remove_fs(device); | 916 | acpi_battery_remove_fs(device); |
936 | #endif | 917 | #endif |
937 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
938 | sysfs_remove_battery(battery); | 918 | sysfs_remove_battery(battery); |
939 | #endif | ||
940 | mutex_destroy(&battery->lock); | 919 | mutex_destroy(&battery->lock); |
941 | kfree(battery); | 920 | kfree(battery); |
942 | return 0; | 921 | return 0; |