platform_profile.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Platform profile sysfs interface
  4. *
  5. * See Documentation/userspace-api/sysfs-platform_profile.rst for more
  6. * information.
  7. */
  8. #ifndef _PLATFORM_PROFILE_H_
  9. #define _PLATFORM_PROFILE_H_
  10. #include <linux/bitops.h>
  11. /*
  12. * If more options are added please update profile_names array in
  13. * platform_profile.c and sysfs-platform_profile documentation.
  14. */
  15. enum platform_profile_option {
  16. PLATFORM_PROFILE_LOW_POWER,
  17. PLATFORM_PROFILE_COOL,
  18. PLATFORM_PROFILE_QUIET,
  19. PLATFORM_PROFILE_BALANCED,
  20. PLATFORM_PROFILE_BALANCED_PERFORMANCE,
  21. PLATFORM_PROFILE_PERFORMANCE,
  22. PLATFORM_PROFILE_LAST, /*must always be last */
  23. };
  24. struct platform_profile_handler {
  25. unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
  26. int (*profile_get)(struct platform_profile_handler *pprof,
  27. enum platform_profile_option *profile);
  28. int (*profile_set)(struct platform_profile_handler *pprof,
  29. enum platform_profile_option profile);
  30. };
  31. int platform_profile_register(struct platform_profile_handler *pprof);
  32. int platform_profile_remove(void);
  33. void platform_profile_notify(void);
  34. #endif /*_PLATFORM_PROFILE_H_*/