mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
parent
c3b92c8787
commit
362b646062
2 changed files with 35 additions and 1 deletions
|
|
@ -706,11 +706,23 @@ static void __exit interrupt_stats_exit(void)
|
|||
return;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
acpi_show_profile(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
|
||||
}
|
||||
|
||||
static const struct device_attribute pm_profile_attr =
|
||||
__ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);
|
||||
|
||||
int __init acpi_sysfs_init(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = acpi_tables_sysfs_init();
|
||||
|
||||
if (result)
|
||||
return result;
|
||||
result = sysfs_create_file(acpi_kobj, &pm_profile_attr.attr);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue