[PATCH v4 15/20] ACPI: platform_profile: Add concept of a "custom" profile

Mario Limonciello posted 20 patches 2 weeks, 4 days ago
There is a newer version of this series
[PATCH v4 15/20] ACPI: platform_profile: Add concept of a "custom" profile
Posted by Mario Limonciello 2 weeks, 4 days ago
When two profile handlers don't agree on the current profile it's ambiguous
what to show to the legacy sysfs interface.

Add a "custom" profile string that userspace will be able to distinguish
this situation when using the legacy sysfs interface.

Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/acpi/platform_profile.c  | 1 +
 include/linux/platform_profile.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index 8de7c8352673e..d8c2d195106c2 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -20,6 +20,7 @@ static const char * const profile_names[] = {
 	[PLATFORM_PROFILE_BALANCED] = "balanced",
 	[PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
 	[PLATFORM_PROFILE_PERFORMANCE] = "performance",
+	[PLATFORM_PROFILE_CUSTOM] = "custom",
 };
 static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
 
diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
index f81c3afcb7575..d2a2ab4c6cee9 100644
--- a/include/linux/platform_profile.h
+++ b/include/linux/platform_profile.h
@@ -23,6 +23,7 @@ enum platform_profile_option {
 	PLATFORM_PROFILE_BALANCED,
 	PLATFORM_PROFILE_BALANCED_PERFORMANCE,
 	PLATFORM_PROFILE_PERFORMANCE,
+	PLATFORM_PROFILE_CUSTOM,
 	PLATFORM_PROFILE_LAST, /*must always be last */
 };
 
-- 
2.43.0
Re: [PATCH v4 15/20] ACPI: platform_profile: Add concept of a "custom" profile
Posted by Armin Wolf 2 weeks, 3 days ago
Am 05.11.24 um 16:33 schrieb Mario Limonciello:

> When two profile handlers don't agree on the current profile it's ambiguous
> what to show to the legacy sysfs interface.
>
> Add a "custom" profile string that userspace will be able to distinguish
> this situation when using the legacy sysfs interface.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>

> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/acpi/platform_profile.c  | 1 +
>   include/linux/platform_profile.h | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index 8de7c8352673e..d8c2d195106c2 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -20,6 +20,7 @@ static const char * const profile_names[] = {
>   	[PLATFORM_PROFILE_BALANCED] = "balanced",
>   	[PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
>   	[PLATFORM_PROFILE_PERFORMANCE] = "performance",
> +	[PLATFORM_PROFILE_CUSTOM] = "custom",
>   };
>   static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
>
> diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
> index f81c3afcb7575..d2a2ab4c6cee9 100644
> --- a/include/linux/platform_profile.h
> +++ b/include/linux/platform_profile.h
> @@ -23,6 +23,7 @@ enum platform_profile_option {
>   	PLATFORM_PROFILE_BALANCED,
>   	PLATFORM_PROFILE_BALANCED_PERFORMANCE,
>   	PLATFORM_PROFILE_PERFORMANCE,
> +	PLATFORM_PROFILE_CUSTOM,
>   	PLATFORM_PROFILE_LAST, /*must always be last */
>   };
>