Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

acpi: platform_profile - Add max-power profile option

Some devices, namely Lenovo Legion devices, have an "extreme" mode where
power draw is at the maximum limit of the cooling hardware. Add a new
"max-power" platform profile to properly reflect this operating mode.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/20251127151605.1018026-2-derekjohn.clark@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Derek J. Clark and committed by
Ilpo Järvinen
5aefbf5b 0b39ce8f

+8 -2
+2
Documentation/ABI/testing/sysfs-class-platform-profile
··· 23 23 power consumption with a slight bias 24 24 towards performance 25 25 performance High performance operation 26 + max-power Higher performance operation that may exceed 27 + internal battery draw limits when on AC power 26 28 custom Driver defined custom profile 27 29 ==================== ======================================== 28 30
+5 -2
drivers/acpi/platform_profile.c
··· 37 37 [PLATFORM_PROFILE_BALANCED] = "balanced", 38 38 [PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance", 39 39 [PLATFORM_PROFILE_PERFORMANCE] = "performance", 40 + [PLATFORM_PROFILE_MAX_POWER] = "max-power", 40 41 [PLATFORM_PROFILE_CUSTOM] = "custom", 41 42 }; 42 43 static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST); ··· 507 506 if (err) 508 507 return err; 509 508 510 - if (profile == PLATFORM_PROFILE_CUSTOM || 509 + if (profile == PLATFORM_PROFILE_MAX_POWER || 510 + profile == PLATFORM_PROFILE_CUSTOM || 511 511 profile == PLATFORM_PROFILE_LAST) 512 512 return -EINVAL; 513 513 ··· 517 515 if (err) 518 516 return err; 519 517 520 - /* never iterate into a custom if all drivers supported it */ 518 + /* never iterate into a custom or max power if all drivers supported it */ 519 + clear_bit(PLATFORM_PROFILE_MAX_POWER, data.aggregate); 521 520 clear_bit(PLATFORM_PROFILE_CUSTOM, data.aggregate); 522 521 523 522 next = find_next_bit_wrap(data.aggregate,
+1
include/linux/platform_profile.h
··· 24 24 PLATFORM_PROFILE_BALANCED, 25 25 PLATFORM_PROFILE_BALANCED_PERFORMANCE, 26 26 PLATFORM_PROFILE_PERFORMANCE, 27 + PLATFORM_PROFILE_MAX_POWER, 27 28 PLATFORM_PROFILE_CUSTOM, 28 29 PLATFORM_PROFILE_LAST, /*must always be last */ 29 30 };