int340x_thermal_zone.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * int340x_thermal_zone.h
  3. * Copyright (c) 2015, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. */
  15. #ifndef __INT340X_THERMAL_ZONE_H__
  16. #define __INT340X_THERMAL_ZONE_H__
  17. #include <acpi/acpi_lpat.h>
  18. #define INT340X_THERMAL_MAX_ACT_TRIP_COUNT 10
  19. struct active_trip {
  20. int temp;
  21. int id;
  22. bool valid;
  23. };
  24. struct int34x_thermal_zone {
  25. struct acpi_device *adev;
  26. struct active_trip act_trips[INT340X_THERMAL_MAX_ACT_TRIP_COUNT];
  27. unsigned long *aux_trips;
  28. int aux_trip_nr;
  29. int psv_temp;
  30. int psv_trip_id;
  31. int crt_temp;
  32. int crt_trip_id;
  33. int hot_temp;
  34. int hot_trip_id;
  35. struct thermal_zone_device *zone;
  36. struct thermal_zone_device_ops *override_ops;
  37. void *priv_data;
  38. struct acpi_lpat_conversion_table *lpat_table;
  39. };
  40. struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
  41. struct thermal_zone_device_ops *override_ops);
  42. void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
  43. int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone);
  44. static inline void int340x_thermal_zone_set_priv_data(
  45. struct int34x_thermal_zone *tzone, void *priv_data)
  46. {
  47. tzone->priv_data = priv_data;
  48. }
  49. static inline void *int340x_thermal_zone_get_priv_data(
  50. struct int34x_thermal_zone *tzone)
  51. {
  52. return tzone->priv_data;
  53. }
  54. static inline void int340x_thermal_zone_device_update(
  55. struct int34x_thermal_zone *tzone,
  56. enum thermal_notify_event event)
  57. {
  58. thermal_zone_device_update(tzone->zone, event);
  59. }
  60. #endif