提交 5bb730fd 编写于 作者: Z Zhang Rui 提交者: Len Brown

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: NZhang Rui <rui.zhang@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 219c3c8e
...@@ -87,7 +87,9 @@ config ACPI_PROCFS ...@@ -87,7 +87,9 @@ config ACPI_PROCFS
and this proc interface will be removed some time later, and this proc interface will be removed some time later,
it's marked as deprecated. it's marked as deprecated.
( /proc/acpi/debug_layer && debug_level are deprecated by ( /proc/acpi/debug_layer && debug_level are deprecated by
/sys/module/acpi/parameters/debug_layer && debug_level. ) /sys/module/acpi/parameters/debug_layer && debug_level.
/proc/acpi/info is deprecated by
/sys/module/acpi/parameters/acpica_version )
config ACPI_AC config ACPI_AC
tristate "AC Adapter" tristate "AC Adapter"
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
#define _COMPONENT ACPI_SYSTEM_COMPONENT #define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME("acpi_system") ACPI_MODULE_NAME("acpi_system")
#ifdef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#endif
#define MODULE_PARAM_PREFIX "acpi."
#define ACPI_SYSTEM_CLASS "system" #define ACPI_SYSTEM_CLASS "system"
#define ACPI_SYSTEM_DRIVER_NAME "ACPI System Driver" #define ACPI_SYSTEM_DRIVER_NAME "ACPI System Driver"
#define ACPI_SYSTEM_DEVICE_NAME "System" #define ACPI_SYSTEM_DEVICE_NAME "System"
...@@ -41,9 +46,23 @@ ACPI_MODULE_NAME("acpi_system") ...@@ -41,9 +46,23 @@ ACPI_MODULE_NAME("acpi_system")
#define ACPI_SYSTEM_FILE_FADT "fadt" #define ACPI_SYSTEM_FILE_FADT "fadt"
extern struct fadt_descriptor acpi_fadt; extern struct fadt_descriptor acpi_fadt;
/*
* Make ACPICA version work as module param
*/
static int param_get_acpica_version(char *buffer, struct kernel_param *kp) {
int result;
result = sprintf(buffer, "%x", ACPI_CA_VERSION);
return result;
}
module_param_call(acpica_version, NULL, param_get_acpica_version, NULL, 0444);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
FS Interface (/proc) FS Interface (/proc)
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCFS
static int acpi_system_read_info(struct seq_file *seq, void *offset) static int acpi_system_read_info(struct seq_file *seq, void *offset)
{ {
...@@ -63,6 +82,7 @@ static const struct file_operations acpi_system_info_ops = { ...@@ -63,6 +82,7 @@ static const struct file_operations acpi_system_info_ops = {
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
}; };
#endif
static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t, static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t,
loff_t *); loff_t *);
...@@ -128,6 +148,7 @@ static int __init acpi_system_init(void) ...@@ -128,6 +148,7 @@ static int __init acpi_system_init(void)
if (acpi_disabled) if (acpi_disabled)
return 0; return 0;
#ifdef CONFIG_ACPI_PROCFS
/* 'info' [R] */ /* 'info' [R] */
name = ACPI_SYSTEM_FILE_INFO; name = ACPI_SYSTEM_FILE_INFO;
entry = create_proc_entry(name, S_IRUGO, acpi_root_dir); entry = create_proc_entry(name, S_IRUGO, acpi_root_dir);
...@@ -136,6 +157,7 @@ static int __init acpi_system_init(void) ...@@ -136,6 +157,7 @@ static int __init acpi_system_init(void)
else { else {
entry->proc_fops = &acpi_system_info_ops; entry->proc_fops = &acpi_system_info_ops;
} }
#endif
/* 'dsdt' [R] */ /* 'dsdt' [R] */
name = ACPI_SYSTEM_FILE_DSDT; name = ACPI_SYSTEM_FILE_DSDT;
...@@ -159,7 +181,9 @@ static int __init acpi_system_init(void) ...@@ -159,7 +181,9 @@ static int __init acpi_system_init(void)
Error: Error:
remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
#ifdef CONFIG_ACPI_PROCFS
remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir); remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
#endif
error = -EFAULT; error = -EFAULT;
goto Done; goto Done;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册