int340x_thermal_zone.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. static inline void int340x_thermal_zone_set_priv_data(
  44. struct int34x_thermal_zone *tzone, void *priv_data)
  45. {
  46. tzone->priv_data = priv_data;
  47. }
  48. static inline void *int340x_thermal_zone_get_priv_data(
  49. struct int34x_thermal_zone *tzone)
  50. {
  51. return tzone->priv_data;
  52. }
  53. static inline void int340x_thermal_zone_device_update(
  54. struct int34x_thermal_zone *tzone)
  55. {
  56. thermal_zone_device_update(tzone->zone);
  57. }
  58. #endif