clock_cooling.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * linux/include/linux/clock_cooling.h
  3. *
  4. * Copyright (C) 2014 Eduardo Valentin <edubezval@gmail.com>
  5. *
  6. * Copyright (C) 2013 Texas Instruments Inc.
  7. * Contact: Eduardo Valentin <eduardo.valentin@ti.com>
  8. *
  9. * Highly based on cpu_cooling.c.
  10. * Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
  11. * Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; version 2 of the License.
  16. *
  17. * This program is distributed in the hope that it will be useful, but
  18. * WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. * General Public License for more details.
  21. */
  22. #ifndef __CPU_COOLING_H__
  23. #define __CPU_COOLING_H__
  24. #include <linux/of.h>
  25. #include <linux/thermal.h>
  26. #include <linux/cpumask.h>
  27. #ifdef CONFIG_CLOCK_THERMAL
  28. /**
  29. * clock_cooling_register - function to create clock cooling device.
  30. * @dev: struct device pointer to the device used as clock cooling device.
  31. * @clock_name: string containing the clock used as cooling mechanism.
  32. */
  33. struct thermal_cooling_device *
  34. clock_cooling_register(struct device *dev, const char *clock_name);
  35. /**
  36. * clock_cooling_unregister - function to remove clock cooling device.
  37. * @cdev: thermal cooling device pointer.
  38. */
  39. void clock_cooling_unregister(struct thermal_cooling_device *cdev);
  40. unsigned long clock_cooling_get_level(struct thermal_cooling_device *cdev,
  41. unsigned long freq);
  42. #else /* !CONFIG_CLOCK_THERMAL */
  43. static inline struct thermal_cooling_device *
  44. clock_cooling_register(struct device *dev, const char *clock_name)
  45. {
  46. return NULL;
  47. }
  48. static inline
  49. void clock_cooling_unregister(struct thermal_cooling_device *cdev)
  50. {
  51. }
  52. static inline
  53. unsigned long clock_cooling_get_level(struct thermal_cooling_device *cdev,
  54. unsigned long freq)
  55. {
  56. return THERMAL_CSTATE_INVALID;
  57. }
  58. #endif /* CONFIG_CLOCK_THERMAL */
  59. #endif /* __CPU_COOLING_H__ */