2020-12-29 19:18:26 -05:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/*
|
|
|
|
* Platform profile sysfs interface
|
|
|
|
*
|
2021-05-19 10:51:38 +02:00
|
|
|
* See Documentation/userspace-api/sysfs-platform_profile.rst for more
|
2020-12-29 19:18:26 -05:00
|
|
|
* information.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PLATFORM_PROFILE_H_
|
|
|
|
#define _PLATFORM_PROFILE_H_
|
|
|
|
|
|
|
|
#include <linux/bitops.h>
|
|
|
|
|
|
|
|
/*
|
2021-02-11 21:17:01 +01:00
|
|
|
* If more options are added please update profile_names array in
|
|
|
|
* platform_profile.c and sysfs-platform_profile documentation.
|
2020-12-29 19:18:26 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
enum platform_profile_option {
|
|
|
|
PLATFORM_PROFILE_LOW_POWER,
|
|
|
|
PLATFORM_PROFILE_COOL,
|
|
|
|
PLATFORM_PROFILE_QUIET,
|
|
|
|
PLATFORM_PROFILE_BALANCED,
|
2021-02-11 21:17:02 +01:00
|
|
|
PLATFORM_PROFILE_BALANCED_PERFORMANCE,
|
2020-12-29 19:18:26 -05:00
|
|
|
PLATFORM_PROFILE_PERFORMANCE,
|
2024-12-05 21:19:12 -06:00
|
|
|
PLATFORM_PROFILE_CUSTOM,
|
2020-12-29 19:18:26 -05:00
|
|
|
PLATFORM_PROFILE_LAST, /*must always be last */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct platform_profile_handler {
|
2024-12-05 21:18:57 -06:00
|
|
|
const char *name;
|
2024-12-05 21:18:59 -06:00
|
|
|
struct device *dev;
|
2024-12-05 21:19:06 -06:00
|
|
|
struct device *class_dev;
|
|
|
|
int minor;
|
2020-12-29 19:18:26 -05:00
|
|
|
unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
|
2021-01-25 12:59:57 +01:00
|
|
|
int (*profile_get)(struct platform_profile_handler *pprof,
|
|
|
|
enum platform_profile_option *profile);
|
|
|
|
int (*profile_set)(struct platform_profile_handler *pprof,
|
|
|
|
enum platform_profile_option profile);
|
2020-12-29 19:18:26 -05:00
|
|
|
};
|
|
|
|
|
2021-01-25 12:59:56 +01:00
|
|
|
int platform_profile_register(struct platform_profile_handler *pprof);
|
2024-12-05 21:19:00 -06:00
|
|
|
int platform_profile_remove(struct platform_profile_handler *pprof);
|
2024-04-08 19:35:10 +02:00
|
|
|
int platform_profile_cycle(void);
|
2024-12-05 21:19:01 -06:00
|
|
|
void platform_profile_notify(struct platform_profile_handler *pprof);
|
2020-12-29 19:18:26 -05:00
|
|
|
|
|
|
|
#endif /*_PLATFORM_PROFILE_H_*/
|