1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Copyright (c) 2015, Intel Corporation.
7 #ifndef _INTEL_SOC_DTS_IOSF_CORE_H
8 #define _INTEL_SOC_DTS_IOSF_CORE_H
10 #include <linux/thermal.h>
13 #define SOC_MAX_DTS_SENSORS 2
15 /* Only 2 out of 4 is allowed for OSPM */
16 #define SOC_MAX_DTS_TRIPS 2
18 enum intel_soc_dts_interrupt_type {
19 INTEL_SOC_DTS_INTERRUPT_NONE,
20 INTEL_SOC_DTS_INTERRUPT_APIC,
21 INTEL_SOC_DTS_INTERRUPT_MSI,
22 INTEL_SOC_DTS_INTERRUPT_SCI,
23 INTEL_SOC_DTS_INTERRUPT_SMI,
26 struct intel_soc_dts_sensors;
28 struct intel_soc_dts_sensor_entry {
32 struct thermal_trip trips[SOC_MAX_DTS_TRIPS];
33 struct thermal_zone_device *tzone;
34 struct intel_soc_dts_sensors *sensors;
37 struct intel_soc_dts_sensors {
39 spinlock_t intr_notify_lock;
40 struct mutex dts_update_lock;
41 enum intel_soc_dts_interrupt_type intr_type;
42 struct intel_soc_dts_sensor_entry soc_dts[SOC_MAX_DTS_SENSORS];
46 struct intel_soc_dts_sensors *
47 intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type,
48 bool critical_trip, int crit_offset);
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);