diff options
author | Thomas Renninger <trenn@suse.de> | 2011-11-03 22:33:46 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-11-06 20:48:42 -0500 |
commit | 362b646062b2073bd5c38efb42171d86e4f717e6 (patch) | |
tree | 6c98cdb7aa5d9be22e2b24ca06b822455ef4b9f5 /drivers | |
parent | c3b92c8787367a8bb53d57d9789b558f1295cc96 (diff) |
ACPI: Export FADT pm_profile integer value to userspace
There are a lot userspace approaches to detect the usage of the
platform (laptop, workstation, server, ...) and adjust kernel tunables
accordingly (io/process scheduler, power management, ...).
These approaches need constant maintaining and are ugly to implement
(detect PCMCIA controller -> laptop,
does not work on recent systems anymore, ...)
On ACPI systems there is an easy and reliable way (if implemented
in BIOS and most recent platforms have this value set).
-> export it to userspace.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/sysfs.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index c538d0ef10ff..9f66181c814e 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -706,11 +706,23 @@ static void __exit interrupt_stats_exit(void) | |||
706 | return; | 706 | return; |
707 | } | 707 | } |
708 | 708 | ||
709 | static ssize_t | ||
710 | acpi_show_profile(struct device *dev, struct device_attribute *attr, | ||
711 | char *buf) | ||
712 | { | ||
713 | return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile); | ||
714 | } | ||
715 | |||
716 | static const struct device_attribute pm_profile_attr = | ||
717 | __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL); | ||
718 | |||
709 | int __init acpi_sysfs_init(void) | 719 | int __init acpi_sysfs_init(void) |
710 | { | 720 | { |
711 | int result; | 721 | int result; |
712 | 722 | ||
713 | result = acpi_tables_sysfs_init(); | 723 | result = acpi_tables_sysfs_init(); |
714 | 724 | if (result) | |
725 | return result; | ||
726 | result = sysfs_create_file(acpi_kobj, &pm_profile_attr.attr); | ||
715 | return result; | 727 | return result; |
716 | } | 728 | } |