intel_soc_dts_iosf.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * intel_soc_dts_iosf.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 _INTEL_SOC_DTS_IOSF_CORE_H
  16. #define _INTEL_SOC_DTS_IOSF_CORE_H
  17. #include <linux/thermal.h>
  18. /* DTS0 and DTS 1 */
  19. #define SOC_MAX_DTS_SENSORS 2
  20. enum intel_soc_dts_interrupt_type {
  21. INTEL_SOC_DTS_INTERRUPT_NONE,
  22. INTEL_SOC_DTS_INTERRUPT_APIC,
  23. INTEL_SOC_DTS_INTERRUPT_MSI,
  24. INTEL_SOC_DTS_INTERRUPT_SCI,
  25. INTEL_SOC_DTS_INTERRUPT_SMI,
  26. };
  27. struct intel_soc_dts_sensors;
  28. struct intel_soc_dts_sensor_entry {
  29. int id;
  30. u32 temp_mask;
  31. u32 temp_shift;
  32. u32 store_status;
  33. u32 trip_mask;
  34. u32 trip_count;
  35. enum thermal_trip_type trip_types[2];
  36. struct thermal_zone_device *tzone;
  37. struct intel_soc_dts_sensors *sensors;
  38. };
  39. struct intel_soc_dts_sensors {
  40. u32 tj_max;
  41. spinlock_t intr_notify_lock;
  42. struct mutex dts_update_lock;
  43. enum intel_soc_dts_interrupt_type intr_type;
  44. struct intel_soc_dts_sensor_entry soc_dts[SOC_MAX_DTS_SENSORS];
  45. };
  46. struct intel_soc_dts_sensors *intel_soc_dts_iosf_init(
  47. enum intel_soc_dts_interrupt_type intr_type, int trip_count,
  48. int read_only_trip_count);
  49. void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors);
  50. void intel_soc_dts_iosf_interrupt_handler(
  51. struct intel_soc_dts_sensors *sensors);
  52. int intel_soc_dts_iosf_add_read_only_critical_trip(
  53. struct intel_soc_dts_sensors *sensors, int critical_offset);
  54. #endif