msm_cooling_device.h 910 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SDE_THERMAL_CORE_H__
  6. #define __SDE_THERMAL_CORE_H__
  7. #include <linux/device.h>
  8. #include <linux/backlight.h>
  9. #include <linux/thermal.h>
  10. #include <linux/notifier.h>
  11. struct sde_cdev {
  12. struct blocking_notifier_head notifier_head;
  13. struct thermal_cooling_device *cdev;
  14. struct backlight_device *bd;
  15. unsigned long thermal_state;
  16. };
  17. #ifdef CONFIG_THERMAL_OF
  18. struct sde_cdev *backlight_cdev_register(struct device *dev,
  19. struct backlight_device *bd,
  20. struct notifier_block *n);
  21. void backlight_cdev_unregister(struct sde_cdev *cdev);
  22. #else
  23. static inline struct sde_cdev *
  24. backlight_cdev_register(struct device *dev,
  25. struct backlight_device *bd, struct notifier_block *n)
  26. {
  27. return NULL;
  28. }
  29. static inline void backlight_cdev_unregister(struct sde_cdev *cdev)
  30. { }
  31. #endif
  32. #endif