Commit ee073604 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Zhang Rui

Thermal: Intel SoC: DTS thermal IOSF core

This is becoming a common feature for Intel SoCs to expose the additional
digital temperature sensors (DTSs) using side band interface (IOSF). This
change remove common IOSF DTS handler function from the existing driver
intel_soc_dts_thermal.c and creates a stand alone module, which can
be selected from the SoC specific drivers. In this way there is less
code duplication.
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
parent b787f68c
...@@ -249,6 +249,16 @@ config X86_PKG_TEMP_THERMAL ...@@ -249,6 +249,16 @@ config X86_PKG_TEMP_THERMAL
two trip points which can be set by user to get notifications via thermal two trip points which can be set by user to get notifications via thermal
notification methods. notification methods.
config INTEL_SOC_DTS_IOSF_CORE
tristate
depends on X86
select IOSF_MBI
help
This is becoming a common feature for Intel SoCs to expose the additional
digital temperature sensors (DTSs) using side band interface (IOSF). This
implements the common set of helper functions to register, get temperature
and get/set thresholds on DTSs.
config INTEL_SOC_DTS_THERMAL config INTEL_SOC_DTS_THERMAL
tristate "Intel SoCs DTS thermal driver" tristate "Intel SoCs DTS thermal driver"
depends on X86 && IOSF_MBI depends on X86 && IOSF_MBI
......
...@@ -34,6 +34,7 @@ obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o ...@@ -34,6 +34,7 @@ obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o
obj-$(CONFIG_DB8500_CPUFREQ_COOLING) += db8500_cpufreq_cooling.o obj-$(CONFIG_DB8500_CPUFREQ_COOLING) += db8500_cpufreq_cooling.o
obj-$(CONFIG_INTEL_POWERCLAMP) += intel_powerclamp.o obj-$(CONFIG_INTEL_POWERCLAMP) += intel_powerclamp.o
obj-$(CONFIG_X86_PKG_TEMP_THERMAL) += x86_pkg_temp_thermal.o obj-$(CONFIG_X86_PKG_TEMP_THERMAL) += x86_pkg_temp_thermal.o
obj-$(CONFIG_INTEL_SOC_DTS_IOSF_CORE) += intel_soc_dts_iosf.o
obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o
obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/ obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
obj-$(CONFIG_INT340X_THERMAL) += int340x_thermal/ obj-$(CONFIG_INT340X_THERMAL) += int340x_thermal/
......
This diff is collapsed.
/*
* intel_soc_dts_iosf.h
* Copyright (c) 2015, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#ifndef _INTEL_SOC_DTS_IOSF_CORE_H
#define _INTEL_SOC_DTS_IOSF_CORE_H
#include <linux/thermal.h>
/* DTS0 and DTS 1 */
#define SOC_MAX_DTS_SENSORS 2
enum intel_soc_dts_interrupt_type {
INTEL_SOC_DTS_INTERRUPT_NONE,
INTEL_SOC_DTS_INTERRUPT_APIC,
INTEL_SOC_DTS_INTERRUPT_MSI,
INTEL_SOC_DTS_INTERRUPT_SCI,
INTEL_SOC_DTS_INTERRUPT_SMI,
};
struct intel_soc_dts_sensors;
struct intel_soc_dts_sensor_entry {
int id;
u32 temp_mask;
u32 temp_shift;
u32 store_status;
u32 trip_mask;
u32 trip_count;
enum thermal_trip_type trip_types[2];
struct thermal_zone_device *tzone;
struct intel_soc_dts_sensors *sensors;
};
struct intel_soc_dts_sensors {
u32 tj_max;
spinlock_t intr_notify_lock;
struct mutex dts_update_lock;
enum intel_soc_dts_interrupt_type intr_type;
struct intel_soc_dts_sensor_entry soc_dts[SOC_MAX_DTS_SENSORS];
};
struct intel_soc_dts_sensors *intel_soc_dts_iosf_init(
enum intel_soc_dts_interrupt_type intr_type, int trip_count,
int read_only_trip_count);
void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors);
void intel_soc_dts_iosf_interrupt_handler(
struct intel_soc_dts_sensors *sensors);
int intel_soc_dts_iosf_add_read_only_critical_trip(
struct intel_soc_dts_sensors *sensors, int critical_offset);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment