3 * Copyright (c) 2015, Intel Corporation.
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.
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
16 #ifndef _INTEL_SOC_DTS_IOSF_CORE_H
17 #define _INTEL_SOC_DTS_IOSF_CORE_H
19 #include <linux/thermal.h>
22 #define SOC_MAX_DTS_SENSORS 2
24 enum intel_soc_dts_interrupt_type
{
25 INTEL_SOC_DTS_INTERRUPT_NONE
,
26 INTEL_SOC_DTS_INTERRUPT_APIC
,
27 INTEL_SOC_DTS_INTERRUPT_MSI
,
28 INTEL_SOC_DTS_INTERRUPT_SCI
,
29 INTEL_SOC_DTS_INTERRUPT_SMI
,
32 struct intel_soc_dts_sensors
;
34 struct intel_soc_dts_sensor_entry
{
41 enum thermal_trip_type trip_types
[2];
42 struct thermal_zone_device
*tzone
;
43 struct intel_soc_dts_sensors
*sensors
;
46 struct intel_soc_dts_sensors
{
48 spinlock_t intr_notify_lock
;
49 struct mutex dts_update_lock
;
50 enum intel_soc_dts_interrupt_type intr_type
;
51 struct intel_soc_dts_sensor_entry soc_dts
[SOC_MAX_DTS_SENSORS
];
54 struct intel_soc_dts_sensors
*intel_soc_dts_iosf_init(
55 enum intel_soc_dts_interrupt_type intr_type
, int trip_count
,
56 int read_only_trip_count
);
57 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors
*sensors
);
58 void intel_soc_dts_iosf_interrupt_handler(
59 struct intel_soc_dts_sensors
*sensors
);
60 int intel_soc_dts_iosf_add_read_only_critical_trip(
61 struct intel_soc_dts_sensors
*sensors
, int critical_offset
);