cpu_cooling.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * linux/include/linux/cpu_cooling.h
  3. *
  4. * Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
  5. * Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>
  6. *
  7. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; version 2 of the License.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  20. *
  21. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. */
  23. #ifndef __CPU_COOLING_H__
  24. #define __CPU_COOLING_H__
  25. #include <linux/thermal.h>
  26. #define CPUFREQ_COOLING_START 0
  27. #define CPUFREQ_COOLING_STOP 1
  28. #if defined(CONFIG_CPU_THERMAL) || defined(CONFIG_CPU_THERMAL_MODULE)
  29. /**
  30. * cpufreq_cooling_register - function to create cpufreq cooling device.
  31. * @clip_cpus: cpumask of cpus where the frequency constraints will happen
  32. */
  33. struct thermal_cooling_device *cpufreq_cooling_register(
  34. const struct cpumask *clip_cpus);
  35. /**
  36. * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
  37. * @cdev: thermal cooling device pointer.
  38. */
  39. void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
  40. unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int);
  41. #else /* !CONFIG_CPU_THERMAL */
  42. static inline struct thermal_cooling_device *cpufreq_cooling_register(
  43. const struct cpumask *clip_cpus)
  44. {
  45. return NULL;
  46. }
  47. static inline void cpufreq_cooling_unregister(
  48. struct thermal_cooling_device *cdev)
  49. {
  50. return;
  51. }
  52. static inline unsigned long cpufreq_cooling_get_level(unsigned int,
  53. unsigned int)
  54. {
  55. return THERMAL_CSTATE_INVALID;
  56. }
  57. #endif /* CONFIG_CPU_THERMAL */
  58. #endif /* __CPU_COOLING_H__ */