Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * intel_soc_dts_iosf.h
0004  * Copyright (c) 2015, Intel Corporation.
0005  */
0006 
0007 #ifndef _INTEL_SOC_DTS_IOSF_CORE_H
0008 #define _INTEL_SOC_DTS_IOSF_CORE_H
0009 
0010 #include <linux/thermal.h>
0011 
0012 /* DTS0 and DTS 1 */
0013 #define SOC_MAX_DTS_SENSORS 2
0014 
0015 enum intel_soc_dts_interrupt_type {
0016     INTEL_SOC_DTS_INTERRUPT_NONE,
0017     INTEL_SOC_DTS_INTERRUPT_APIC,
0018     INTEL_SOC_DTS_INTERRUPT_MSI,
0019     INTEL_SOC_DTS_INTERRUPT_SCI,
0020     INTEL_SOC_DTS_INTERRUPT_SMI,
0021 };
0022 
0023 struct intel_soc_dts_sensors;
0024 
0025 struct intel_soc_dts_sensor_entry {
0026     int id;
0027     u32 store_status;
0028     u32 trip_mask;
0029     u32 trip_count;
0030     enum thermal_trip_type trip_types[2];
0031     struct thermal_zone_device *tzone;
0032     struct intel_soc_dts_sensors *sensors;
0033 };
0034 
0035 struct intel_soc_dts_sensors {
0036     u32 tj_max;
0037     spinlock_t intr_notify_lock;
0038     struct mutex dts_update_lock;
0039     enum intel_soc_dts_interrupt_type intr_type;
0040     struct intel_soc_dts_sensor_entry soc_dts[SOC_MAX_DTS_SENSORS];
0041 };
0042 
0043 struct intel_soc_dts_sensors *intel_soc_dts_iosf_init(
0044     enum intel_soc_dts_interrupt_type intr_type, int trip_count,
0045     int read_only_trip_count);
0046 void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors);
0047 void intel_soc_dts_iosf_interrupt_handler(
0048                 struct intel_soc_dts_sensors *sensors);
0049 int intel_soc_dts_iosf_add_read_only_critical_trip(
0050     struct intel_soc_dts_sensors *sensors, int critical_offset);
0051 #endif