msm_cooling_device.h 1.0 KB

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