forked from luck/tmp_suning_uos_patched
2b27bdcc20
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that 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 you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 246 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
94 lines
2.5 KiB
C
94 lines
2.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* OMAP thermal definitions
|
|
*
|
|
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
|
|
* Contact:
|
|
* Eduardo Valentin <eduardo.valentin@ti.com>
|
|
*/
|
|
#ifndef __TI_THERMAL_H
|
|
#define __TI_THERMAL_H
|
|
|
|
#include "ti-bandgap.h"
|
|
|
|
/* PCB sensor calculation constants */
|
|
#define OMAP_GRADIENT_SLOPE_W_PCB_4430 0
|
|
#define OMAP_GRADIENT_CONST_W_PCB_4430 20000
|
|
#define OMAP_GRADIENT_SLOPE_W_PCB_4460 1142
|
|
#define OMAP_GRADIENT_CONST_W_PCB_4460 -393
|
|
#define OMAP_GRADIENT_SLOPE_W_PCB_4470 1063
|
|
#define OMAP_GRADIENT_CONST_W_PCB_4470 -477
|
|
|
|
#define OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU 100
|
|
#define OMAP_GRADIENT_CONST_W_PCB_5430_CPU 484
|
|
#define OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU 464
|
|
#define OMAP_GRADIENT_CONST_W_PCB_5430_GPU -5102
|
|
|
|
#define DRA752_GRADIENT_SLOPE_W_PCB 0
|
|
#define DRA752_GRADIENT_CONST_W_PCB 2000
|
|
|
|
/* trip points of interest in milicelsius (at hotspot level) */
|
|
#define OMAP_TRIP_COLD 100000
|
|
#define OMAP_TRIP_HOT 110000
|
|
#define OMAP_TRIP_SHUTDOWN 125000
|
|
#define OMAP_TRIP_NUMBER 2
|
|
#define OMAP_TRIP_STEP \
|
|
((OMAP_TRIP_SHUTDOWN - OMAP_TRIP_HOT) / (OMAP_TRIP_NUMBER - 1))
|
|
|
|
/* Update rates */
|
|
#define FAST_TEMP_MONITORING_RATE 250
|
|
|
|
/* helper macros */
|
|
/**
|
|
* ti_thermal_get_trip_value - returns trip temperature based on index
|
|
* @i: trip index
|
|
*/
|
|
#define ti_thermal_get_trip_value(i) \
|
|
(OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP))
|
|
|
|
/**
|
|
* ti_thermal_is_valid_trip - check for trip index
|
|
* @i: trip index
|
|
*/
|
|
#define ti_thermal_is_valid_trip(trip) \
|
|
((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
|
|
|
|
#ifdef CONFIG_TI_THERMAL
|
|
int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain);
|
|
int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id);
|
|
int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id);
|
|
int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id);
|
|
int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id);
|
|
#else
|
|
static inline
|
|
int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline
|
|
int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline
|
|
int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline
|
|
int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline
|
|
int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
#endif
|