Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Platform profile sysfs interface
0004  *
0005  * See Documentation/userspace-api/sysfs-platform_profile.rst for more
0006  * information.
0007  */
0008 
0009 #ifndef _PLATFORM_PROFILE_H_
0010 #define _PLATFORM_PROFILE_H_
0011 
0012 #include <linux/bitops.h>
0013 
0014 /*
0015  * If more options are added please update profile_names array in
0016  * platform_profile.c and sysfs-platform_profile documentation.
0017  */
0018 
0019 enum platform_profile_option {
0020     PLATFORM_PROFILE_LOW_POWER,
0021     PLATFORM_PROFILE_COOL,
0022     PLATFORM_PROFILE_QUIET,
0023     PLATFORM_PROFILE_BALANCED,
0024     PLATFORM_PROFILE_BALANCED_PERFORMANCE,
0025     PLATFORM_PROFILE_PERFORMANCE,
0026     PLATFORM_PROFILE_LAST, /*must always be last */
0027 };
0028 
0029 struct platform_profile_handler {
0030     unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
0031     int (*profile_get)(struct platform_profile_handler *pprof,
0032                 enum platform_profile_option *profile);
0033     int (*profile_set)(struct platform_profile_handler *pprof,
0034                 enum platform_profile_option profile);
0035 };
0036 
0037 int platform_profile_register(struct platform_profile_handler *pprof);
0038 int platform_profile_remove(void);
0039 void platform_profile_notify(void);
0040 
0041 #endif  /*_PLATFORM_PROFILE_H_*/