aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/Kconfig18
-rw-r--r--drivers/acpi/Makefile2
-rw-r--r--drivers/acpi/ac.c20
-rw-r--r--drivers/acpi/battery.c20
-rw-r--r--drivers/acpi/sbs.c20
5 files changed, 46 insertions, 34 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 087a7028ae84..b9f923ef173d 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -50,7 +50,6 @@ config ACPI_SLEEP
50config ACPI_PROCFS 50config ACPI_PROCFS
51 bool "Deprecated /proc/acpi files" 51 bool "Deprecated /proc/acpi files"
52 depends on PROC_FS 52 depends on PROC_FS
53 default y
54 ---help--- 53 ---help---
55 For backwards compatibility, this option allows 54 For backwards compatibility, this option allows
56 deprecated /proc/acpi/ files to exist, even when 55 deprecated /proc/acpi/ files to exist, even when
@@ -61,7 +60,6 @@ config ACPI_PROCFS
61 /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) 60 /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version)
62 /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) 61 /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT)
63 /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) 62 /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP)
64 /proc/acpi/battery (/sys/class/power_supply)
65 /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) 63 /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer)
66 /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) 64 /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level)
67 65
@@ -69,7 +67,21 @@ config ACPI_PROCFS
69 and functions which do not yet exist in /sys. 67 and functions which do not yet exist in /sys.
70 68
71 Say N to delete /proc/acpi/ files that have moved to /sys/ 69 Say N to delete /proc/acpi/ files that have moved to /sys/
72 70config ACPI_PROCFS_POWER
71 bool "Deprecated power /proc/acpi folders"
72 depends on PROC_FS
73 default y
74 ---help---
75 For backwards compatibility, this option allows
76 deprecated power /proc/acpi/ folders to exist, even when
77 they have been replaced by functions in /sys.
78 The deprecated folders (and their replacements) include:
79 /proc/acpi/battery/* (/sys/class/power_supply/*)
80 /proc/acpi/ac_adapter/* (sys/class/power_supply/*)
81 This option has no effect on /proc/acpi/ folders
82 and functions, which do not yet exist in /sys
83
84 Say N to delete power /proc/acpi/ folders that have moved to /sys/
73config ACPI_PROC_EVENT 85config ACPI_PROC_EVENT
74 bool "Deprecated /proc/acpi/event support" 86 bool "Deprecated /proc/acpi/event support"
75 depends on PROC_FS 87 depends on PROC_FS
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 54e3ab0e5fc0..456446f90077 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -58,6 +58,6 @@ obj-$(CONFIG_ACPI_NUMA) += numa.o
58obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o 58obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o
59obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o 59obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
60obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o 60obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
61obj-y += cm_sbs.o 61obj-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
62obj-$(CONFIG_ACPI_SBS) += sbs.o 62obj-$(CONFIG_ACPI_SBS) += sbs.o
63obj-$(CONFIG_ACPI_SBS) += sbshc.o 63obj-$(CONFIG_ACPI_SBS) += sbshc.o
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 30238f6ff232..76ed4f52bebd 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -27,7 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef CONFIG_ACPI_PROCFS 30#ifdef CONFIG_ACPI_PROCFS_POWER
31#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
32#include <linux/seq_file.h> 32#include <linux/seq_file.h>
33#endif 33#endif
@@ -51,7 +51,7 @@ MODULE_AUTHOR("Paul Diefenbaugh");
51MODULE_DESCRIPTION("ACPI AC Adapter Driver"); 51MODULE_DESCRIPTION("ACPI AC Adapter Driver");
52MODULE_LICENSE("GPL"); 52MODULE_LICENSE("GPL");
53 53
54#ifdef CONFIG_ACPI_PROCFS 54#ifdef CONFIG_ACPI_PROCFS_POWER
55extern struct proc_dir_entry *acpi_lock_ac_dir(void); 55extern struct proc_dir_entry *acpi_lock_ac_dir(void);
56extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); 56extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
57static int acpi_ac_open_fs(struct inode *inode, struct file *file); 57static int acpi_ac_open_fs(struct inode *inode, struct file *file);
@@ -86,7 +86,7 @@ struct acpi_ac {
86 86
87#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); 87#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
88 88
89#ifdef CONFIG_ACPI_PROCFS 89#ifdef CONFIG_ACPI_PROCFS_POWER
90static const struct file_operations acpi_ac_fops = { 90static const struct file_operations acpi_ac_fops = {
91 .open = acpi_ac_open_fs, 91 .open = acpi_ac_open_fs,
92 .read = seq_read, 92 .read = seq_read,
@@ -136,7 +136,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
136 return 0; 136 return 0;
137} 137}
138 138
139#ifdef CONFIG_ACPI_PROCFS 139#ifdef CONFIG_ACPI_PROCFS_POWER
140/* -------------------------------------------------------------------------- 140/* --------------------------------------------------------------------------
141 FS Interface (/proc) 141 FS Interface (/proc)
142 -------------------------------------------------------------------------- */ 142 -------------------------------------------------------------------------- */
@@ -275,7 +275,7 @@ static int acpi_ac_add(struct acpi_device *device)
275 if (result) 275 if (result)
276 goto end; 276 goto end;
277 277
278#ifdef CONFIG_ACPI_PROCFS 278#ifdef CONFIG_ACPI_PROCFS_POWER
279 result = acpi_ac_add_fs(device); 279 result = acpi_ac_add_fs(device);
280#endif 280#endif
281 if (result) 281 if (result)
@@ -300,7 +300,7 @@ static int acpi_ac_add(struct acpi_device *device)
300 300
301 end: 301 end:
302 if (result) { 302 if (result) {
303#ifdef CONFIG_ACPI_PROCFS 303#ifdef CONFIG_ACPI_PROCFS_POWER
304 acpi_ac_remove_fs(device); 304 acpi_ac_remove_fs(device);
305#endif 305#endif
306 kfree(ac); 306 kfree(ac);
@@ -339,7 +339,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
339 ACPI_ALL_NOTIFY, acpi_ac_notify); 339 ACPI_ALL_NOTIFY, acpi_ac_notify);
340 if (ac->charger.dev) 340 if (ac->charger.dev)
341 power_supply_unregister(&ac->charger); 341 power_supply_unregister(&ac->charger);
342#ifdef CONFIG_ACPI_PROCFS 342#ifdef CONFIG_ACPI_PROCFS_POWER
343 acpi_ac_remove_fs(device); 343 acpi_ac_remove_fs(device);
344#endif 344#endif
345 345
@@ -355,7 +355,7 @@ static int __init acpi_ac_init(void)
355 if (acpi_disabled) 355 if (acpi_disabled)
356 return -ENODEV; 356 return -ENODEV;
357 357
358#ifdef CONFIG_ACPI_PROCFS 358#ifdef CONFIG_ACPI_PROCFS_POWER
359 acpi_ac_dir = acpi_lock_ac_dir(); 359 acpi_ac_dir = acpi_lock_ac_dir();
360 if (!acpi_ac_dir) 360 if (!acpi_ac_dir)
361 return -ENODEV; 361 return -ENODEV;
@@ -363,7 +363,7 @@ static int __init acpi_ac_init(void)
363 363
364 result = acpi_bus_register_driver(&acpi_ac_driver); 364 result = acpi_bus_register_driver(&acpi_ac_driver);
365 if (result < 0) { 365 if (result < 0) {
366#ifdef CONFIG_ACPI_PROCFS 366#ifdef CONFIG_ACPI_PROCFS_POWER
367 acpi_unlock_ac_dir(acpi_ac_dir); 367 acpi_unlock_ac_dir(acpi_ac_dir);
368#endif 368#endif
369 return -ENODEV; 369 return -ENODEV;
@@ -377,7 +377,7 @@ static void __exit acpi_ac_exit(void)
377 377
378 acpi_bus_unregister_driver(&acpi_ac_driver); 378 acpi_bus_unregister_driver(&acpi_ac_driver);
379 379
380#ifdef CONFIG_ACPI_PROCFS 380#ifdef CONFIG_ACPI_PROCFS_POWER
381 acpi_unlock_ac_dir(acpi_ac_dir); 381 acpi_unlock_ac_dir(acpi_ac_dir);
382#endif 382#endif
383 383
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 2e8e790c1180..7d6be23eff89 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -31,7 +31,7 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/jiffies.h> 32#include <linux/jiffies.h>
33 33
34#ifdef CONFIG_ACPI_PROCFS 34#ifdef CONFIG_ACPI_PROCFS_POWER
35#include <linux/proc_fs.h> 35#include <linux/proc_fs.h>
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
@@ -63,7 +63,7 @@ static unsigned int cache_time = 1000;
63module_param(cache_time, uint, 0644); 63module_param(cache_time, uint, 0644);
64MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); 64MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
65 65
66#ifdef CONFIG_ACPI_PROCFS 66#ifdef CONFIG_ACPI_PROCFS_POWER
67extern struct proc_dir_entry *acpi_lock_battery_dir(void); 67extern struct proc_dir_entry *acpi_lock_battery_dir(void);
68extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); 68extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
69 69
@@ -223,7 +223,7 @@ static enum power_supply_property energy_battery_props[] = {
223 POWER_SUPPLY_PROP_MANUFACTURER, 223 POWER_SUPPLY_PROP_MANUFACTURER,
224}; 224};
225 225
226#ifdef CONFIG_ACPI_PROCFS 226#ifdef CONFIG_ACPI_PROCFS_POWER
227inline char *acpi_battery_units(struct acpi_battery *battery) 227inline char *acpi_battery_units(struct acpi_battery *battery)
228{ 228{
229 return (battery->power_unit)?"mA":"mW"; 229 return (battery->power_unit)?"mA":"mW";
@@ -481,7 +481,7 @@ static int acpi_battery_update(struct acpi_battery *battery)
481 FS Interface (/proc) 481 FS Interface (/proc)
482 -------------------------------------------------------------------------- */ 482 -------------------------------------------------------------------------- */
483 483
484#ifdef CONFIG_ACPI_PROCFS 484#ifdef CONFIG_ACPI_PROCFS_POWER
485static struct proc_dir_entry *acpi_battery_dir; 485static struct proc_dir_entry *acpi_battery_dir;
486 486
487static int acpi_battery_print_info(struct seq_file *seq, int result) 487static int acpi_battery_print_info(struct seq_file *seq, int result)
@@ -788,7 +788,7 @@ static int acpi_battery_add(struct acpi_device *device)
788 acpi_driver_data(device) = battery; 788 acpi_driver_data(device) = battery;
789 mutex_init(&battery->lock); 789 mutex_init(&battery->lock);
790 acpi_battery_update(battery); 790 acpi_battery_update(battery);
791#ifdef CONFIG_ACPI_PROCFS 791#ifdef CONFIG_ACPI_PROCFS_POWER
792 result = acpi_battery_add_fs(device); 792 result = acpi_battery_add_fs(device);
793 if (result) 793 if (result)
794 goto end; 794 goto end;
@@ -806,7 +806,7 @@ static int acpi_battery_add(struct acpi_device *device)
806 device->status.battery_present ? "present" : "absent"); 806 device->status.battery_present ? "present" : "absent");
807 end: 807 end:
808 if (result) { 808 if (result) {
809#ifdef CONFIG_ACPI_PROCFS 809#ifdef CONFIG_ACPI_PROCFS_POWER
810 acpi_battery_remove_fs(device); 810 acpi_battery_remove_fs(device);
811#endif 811#endif
812 kfree(battery); 812 kfree(battery);
@@ -825,7 +825,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
825 status = acpi_remove_notify_handler(device->handle, 825 status = acpi_remove_notify_handler(device->handle,
826 ACPI_ALL_NOTIFY, 826 ACPI_ALL_NOTIFY,
827 acpi_battery_notify); 827 acpi_battery_notify);
828#ifdef CONFIG_ACPI_PROCFS 828#ifdef CONFIG_ACPI_PROCFS_POWER
829 acpi_battery_remove_fs(device); 829 acpi_battery_remove_fs(device);
830#endif 830#endif
831 sysfs_remove_battery(battery); 831 sysfs_remove_battery(battery);
@@ -861,13 +861,13 @@ static int __init acpi_battery_init(void)
861{ 861{
862 if (acpi_disabled) 862 if (acpi_disabled)
863 return -ENODEV; 863 return -ENODEV;
864#ifdef CONFIG_ACPI_PROCFS 864#ifdef CONFIG_ACPI_PROCFS_POWER
865 acpi_battery_dir = acpi_lock_battery_dir(); 865 acpi_battery_dir = acpi_lock_battery_dir();
866 if (!acpi_battery_dir) 866 if (!acpi_battery_dir)
867 return -ENODEV; 867 return -ENODEV;
868#endif 868#endif
869 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { 869 if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
870#ifdef CONFIG_ACPI_PROCFS 870#ifdef CONFIG_ACPI_PROCFS_POWER
871 acpi_unlock_battery_dir(acpi_battery_dir); 871 acpi_unlock_battery_dir(acpi_battery_dir);
872#endif 872#endif
873 return -ENODEV; 873 return -ENODEV;
@@ -878,7 +878,7 @@ static int __init acpi_battery_init(void)
878static void __exit acpi_battery_exit(void) 878static void __exit acpi_battery_exit(void)
879{ 879{
880 acpi_bus_unregister_driver(&acpi_battery_driver); 880 acpi_bus_unregister_driver(&acpi_battery_driver);
881#ifdef CONFIG_ACPI_PROCFS 881#ifdef CONFIG_ACPI_PROCFS_POWER
882 acpi_unlock_battery_dir(acpi_battery_dir); 882 acpi_unlock_battery_dir(acpi_battery_dir);
883#endif 883#endif
884} 884}
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 73c1ba314299..6045cdbe176b 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -29,7 +29,7 @@
29#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31 31
32#ifdef CONFIG_ACPI_PROCFS 32#ifdef CONFIG_ACPI_PROCFS_POWER
33#include <linux/proc_fs.h> 33#include <linux/proc_fs.h>
34#include <linux/seq_file.h> 34#include <linux/seq_file.h>
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
@@ -88,7 +88,7 @@ MODULE_DEVICE_TABLE(acpi, sbs_device_ids);
88struct acpi_battery { 88struct acpi_battery {
89 struct power_supply bat; 89 struct power_supply bat;
90 struct acpi_sbs *sbs; 90 struct acpi_sbs *sbs;
91#ifdef CONFIG_ACPI_PROCFS 91#ifdef CONFIG_ACPI_PROCFS_POWER
92 struct proc_dir_entry *proc_entry; 92 struct proc_dir_entry *proc_entry;
93#endif 93#endif
94 unsigned long update_time; 94 unsigned long update_time;
@@ -123,7 +123,7 @@ struct acpi_sbs {
123 struct acpi_device *device; 123 struct acpi_device *device;
124 struct acpi_smb_hc *hc; 124 struct acpi_smb_hc *hc;
125 struct mutex lock; 125 struct mutex lock;
126#ifdef CONFIG_ACPI_PROCFS 126#ifdef CONFIG_ACPI_PROCFS_POWER
127 struct proc_dir_entry *charger_entry; 127 struct proc_dir_entry *charger_entry;
128#endif 128#endif
129 struct acpi_battery battery[MAX_SBS_BAT]; 129 struct acpi_battery battery[MAX_SBS_BAT];
@@ -469,7 +469,7 @@ static struct device_attribute alarm_attr = {
469 FS Interface (/proc/acpi) 469 FS Interface (/proc/acpi)
470 -------------------------------------------------------------------------- */ 470 -------------------------------------------------------------------------- */
471 471
472#ifdef CONFIG_ACPI_PROCFS 472#ifdef CONFIG_ACPI_PROCFS_POWER
473/* Generic Routines */ 473/* Generic Routines */
474static int 474static int
475acpi_sbs_add_fs(struct proc_dir_entry **dir, 475acpi_sbs_add_fs(struct proc_dir_entry **dir,
@@ -790,7 +790,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
790 return result; 790 return result;
791 791
792 sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id); 792 sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id);
793#ifdef CONFIG_ACPI_PROCFS 793#ifdef CONFIG_ACPI_PROCFS_POWER
794 acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir, 794 acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir,
795 battery->name, &acpi_battery_info_fops, 795 battery->name, &acpi_battery_info_fops,
796 &acpi_battery_state_fops, &acpi_battery_alarm_fops, 796 &acpi_battery_state_fops, &acpi_battery_alarm_fops,
@@ -831,7 +831,7 @@ static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
831 device_remove_file(battery->bat.dev, &alarm_attr); 831 device_remove_file(battery->bat.dev, &alarm_attr);
832 power_supply_unregister(&battery->bat); 832 power_supply_unregister(&battery->bat);
833 } 833 }
834#ifdef CONFIG_ACPI_PROCFS 834#ifdef CONFIG_ACPI_PROCFS_POWER
835 if (battery->proc_entry) 835 if (battery->proc_entry)
836 acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); 836 acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir);
837#endif 837#endif
@@ -844,7 +844,7 @@ static int acpi_charger_add(struct acpi_sbs *sbs)
844 result = acpi_ac_get_present(sbs); 844 result = acpi_ac_get_present(sbs);
845 if (result) 845 if (result)
846 goto end; 846 goto end;
847#ifdef CONFIG_ACPI_PROCFS 847#ifdef CONFIG_ACPI_PROCFS_POWER
848 result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir, 848 result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir,
849 ACPI_AC_DIR_NAME, NULL, 849 ACPI_AC_DIR_NAME, NULL,
850 &acpi_ac_state_fops, NULL, sbs); 850 &acpi_ac_state_fops, NULL, sbs);
@@ -868,7 +868,7 @@ static void acpi_charger_remove(struct acpi_sbs *sbs)
868{ 868{
869 if (sbs->charger.dev) 869 if (sbs->charger.dev)
870 power_supply_unregister(&sbs->charger); 870 power_supply_unregister(&sbs->charger);
871#ifdef CONFIG_ACPI_PROCFS 871#ifdef CONFIG_ACPI_PROCFS_POWER
872 if (sbs->charger_entry) 872 if (sbs->charger_entry)
873 acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); 873 acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir);
874#endif 874#endif
@@ -974,7 +974,7 @@ static int acpi_sbs_remove(struct acpi_device *device, int type)
974 974
975static void acpi_sbs_rmdirs(void) 975static void acpi_sbs_rmdirs(void)
976{ 976{
977#ifdef CONFIG_ACPI_PROCFS 977#ifdef CONFIG_ACPI_PROCFS_POWER
978 if (acpi_ac_dir) { 978 if (acpi_ac_dir) {
979 acpi_unlock_ac_dir(acpi_ac_dir); 979 acpi_unlock_ac_dir(acpi_ac_dir);
980 acpi_ac_dir = NULL; 980 acpi_ac_dir = NULL;
@@ -1013,7 +1013,7 @@ static int __init acpi_sbs_init(void)
1013 1013
1014 if (acpi_disabled) 1014 if (acpi_disabled)
1015 return -ENODEV; 1015 return -ENODEV;
1016#ifdef CONFIG_ACPI_PROCFS 1016#ifdef CONFIG_ACPI_PROCFS_POWER
1017 acpi_ac_dir = acpi_lock_ac_dir(); 1017 acpi_ac_dir = acpi_lock_ac_dir();
1018 if (!acpi_ac_dir) 1018 if (!acpi_ac_dir)
1019 return -ENODEV; 1019 return -ENODEV;