aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2007-01-28 22:02:42 -0500
committerLen Brown <len.brown@intel.com>2007-01-28 22:33:44 -0500
commit5bb730fda8aa4e3f7e94b259c468ecd095f60770 (patch)
treeb6ae549e0a41bf06c4993e6b5501949db57bee37 /drivers/acpi
parent219c3c8e268b9307eae9fae4c765a0c589b98338 (diff)
ACPI: add ACPICA version in sysfs
Add an ACPI attribute to indicate ACPICA version. /proc/acpi/version is deprecated by /sys/module/acpi/parameters/acpica_version. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Kconfig4
-rw-r--r--drivers/acpi/system.c24
2 files changed, 27 insertions, 1 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index a3a10737d72f..df4514436ba8 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -87,7 +87,9 @@ config ACPI_PROCFS
87 and this proc interface will be removed some time later, 87 and this proc interface will be removed some time later,
88 it's marked as deprecated. 88 it's marked as deprecated.
89 ( /proc/acpi/debug_layer && debug_level are deprecated by 89 ( /proc/acpi/debug_layer && debug_level are deprecated by
90 /sys/module/acpi/parameters/debug_layer && debug_level. ) 90 /sys/module/acpi/parameters/debug_layer && debug_level.
91 /proc/acpi/info is deprecated by
92 /sys/module/acpi/parameters/acpica_version )
91 93
92config ACPI_AC 94config ACPI_AC
93 tristate "AC Adapter" 95 tristate "AC Adapter"
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index d86dcb3c2366..407b0e0281db 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -32,6 +32,11 @@
32 32
33#define _COMPONENT ACPI_SYSTEM_COMPONENT 33#define _COMPONENT ACPI_SYSTEM_COMPONENT
34ACPI_MODULE_NAME("acpi_system") 34ACPI_MODULE_NAME("acpi_system")
35#ifdef MODULE_PARAM_PREFIX
36#undef MODULE_PARAM_PREFIX
37#endif
38#define MODULE_PARAM_PREFIX "acpi."
39
35#define ACPI_SYSTEM_CLASS "system" 40#define ACPI_SYSTEM_CLASS "system"
36#define ACPI_SYSTEM_DRIVER_NAME "ACPI System Driver" 41#define ACPI_SYSTEM_DRIVER_NAME "ACPI System Driver"
37#define ACPI_SYSTEM_DEVICE_NAME "System" 42#define ACPI_SYSTEM_DEVICE_NAME "System"
@@ -41,9 +46,23 @@ ACPI_MODULE_NAME("acpi_system")
41#define ACPI_SYSTEM_FILE_FADT "fadt" 46#define ACPI_SYSTEM_FILE_FADT "fadt"
42extern struct fadt_descriptor acpi_fadt; 47extern struct fadt_descriptor acpi_fadt;
43 48
49/*
50 * Make ACPICA version work as module param
51 */
52static int param_get_acpica_version(char *buffer, struct kernel_param *kp) {
53 int result;
54
55 result = sprintf(buffer, "%x", ACPI_CA_VERSION);
56
57 return result;
58}
59
60module_param_call(acpica_version, NULL, param_get_acpica_version, NULL, 0444);
61
44/* -------------------------------------------------------------------------- 62/* --------------------------------------------------------------------------
45 FS Interface (/proc) 63 FS Interface (/proc)
46 -------------------------------------------------------------------------- */ 64 -------------------------------------------------------------------------- */
65#ifdef CONFIG_ACPI_PROCFS
47 66
48static int acpi_system_read_info(struct seq_file *seq, void *offset) 67static int acpi_system_read_info(struct seq_file *seq, void *offset)
49{ 68{
@@ -63,6 +82,7 @@ static const struct file_operations acpi_system_info_ops = {
63 .llseek = seq_lseek, 82 .llseek = seq_lseek,
64 .release = single_release, 83 .release = single_release,
65}; 84};
85#endif
66 86
67static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t, 87static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t,
68 loff_t *); 88 loff_t *);
@@ -128,6 +148,7 @@ static int __init acpi_system_init(void)
128 if (acpi_disabled) 148 if (acpi_disabled)
129 return 0; 149 return 0;
130 150
151#ifdef CONFIG_ACPI_PROCFS
131 /* 'info' [R] */ 152 /* 'info' [R] */
132 name = ACPI_SYSTEM_FILE_INFO; 153 name = ACPI_SYSTEM_FILE_INFO;
133 entry = create_proc_entry(name, S_IRUGO, acpi_root_dir); 154 entry = create_proc_entry(name, S_IRUGO, acpi_root_dir);
@@ -136,6 +157,7 @@ static int __init acpi_system_init(void)
136 else { 157 else {
137 entry->proc_fops = &acpi_system_info_ops; 158 entry->proc_fops = &acpi_system_info_ops;
138 } 159 }
160#endif
139 161
140 /* 'dsdt' [R] */ 162 /* 'dsdt' [R] */
141 name = ACPI_SYSTEM_FILE_DSDT; 163 name = ACPI_SYSTEM_FILE_DSDT;
@@ -159,7 +181,9 @@ static int __init acpi_system_init(void)
159 Error: 181 Error:
160 remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir); 182 remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
161 remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir); 183 remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
184#ifdef CONFIG_ACPI_PROCFS
162 remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir); 185 remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
186#endif
163 187
164 error = -EFAULT; 188 error = -EFAULT;
165 goto Done; 189 goto Done;