msm_cooling_device.h 937 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021 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. unsigned int cdev_sf;
  17. };
  18. #ifdef CONFIG_THERMAL_OF
  19. struct sde_cdev *backlight_cdev_register(struct device *dev,
  20. struct backlight_device *bd,
  21. struct notifier_block *n);
  22. void backlight_cdev_unregister(struct sde_cdev *cdev);
  23. #else
  24. static inline struct sde_cdev *
  25. backlight_cdev_register(struct device *dev,
  26. struct backlight_device *bd, struct notifier_block *n)
  27. {
  28. return NULL;
  29. }
  30. static inline void backlight_cdev_unregister(struct sde_cdev *cdev)
  31. { }
  32. #endif
  33. #endif