intel_soc_dts_iosf.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * intel_soc_dts_iosf.h
  4. * Copyright (c) 2015, Intel Corporation.
  5. */
  6. #ifndef _INTEL_SOC_DTS_IOSF_CORE_H
  7. #define _INTEL_SOC_DTS_IOSF_CORE_H
  8. #include <linux/thermal.h>
  9. /* DTS0 and DTS 1 */
  10. #define SOC_MAX_DTS_SENSORS 2
  11. /* Only 2 out of 4 is allowed for OSPM */
  12. #define SOC_MAX_DTS_TRIPS 2
  13. enum intel_soc_dts_interrupt_type {
  14. INTEL_SOC_DTS_INTERRUPT_NONE,
  15. INTEL_SOC_DTS_INTERRUPT_APIC,
  16. INTEL_SOC_DTS_INTERRUPT_MSI,
  17. INTEL_SOC_DTS_INTERRUPT_SCI,
  18. INTEL_SOC_DTS_INTERRUPT_SMI,
  19. };
  20. struct intel_soc_dts_sensors;
  21. struct intel_soc_dts_sensor_entry {
  22. int id;
  23. u32 store_status;
  24. struct thermal_zone_device *tzone;
  25. struct intel_soc_dts_sensors *sensors;
  26. };
  27. struct intel_soc_dts_sensors {
  28. u32 tj_max;
  29. spinlock_t intr_notify_lock;
  30. struct mutex dts_update_lock;
  31. enum intel_soc_dts_interrupt_type intr_type;
  32. struct intel_soc_dts_sensor_entry soc_dts[SOC_MAX_DTS_SENSORS];
  33. };
  34. struct intel_soc_dts_sensors *
  35. intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type,
  36. bool critical_trip, int crit_offset);
  37. void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors);
  38. void intel_soc_dts_iosf_interrupt_handler(
  39. struct intel_soc_dts_sensors *sensors);
  40. #endif