2012-07-13 00:02:30 +08:00
|
|
|
/*
|
|
|
|
* OMAP thermal definitions
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
|
|
|
|
* Contact:
|
|
|
|
* Eduardo Valentin <eduardo.valentin@ti.com>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
2013-03-19 22:54:20 +08:00
|
|
|
#ifndef __TI_THERMAL_H
|
|
|
|
#define __TI_THERMAL_H
|
2012-07-13 00:02:30 +08:00
|
|
|
|
2013-03-19 22:54:19 +08:00
|
|
|
#include "ti-bandgap.h"
|
2012-07-13 00:02:30 +08:00
|
|
|
|
|
|
|
/* PCB sensor calculation constants */
|
2013-04-08 20:19:10 +08:00
|
|
|
#define OMAP_GRADIENT_SLOPE_W_PCB_4430 0
|
|
|
|
#define OMAP_GRADIENT_CONST_W_PCB_4430 20000
|
2012-07-13 00:02:30 +08:00
|
|
|
#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
|
|
|
|
|
2013-04-08 20:19:11 +08:00
|
|
|
#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
|
2012-07-13 00:02:30 +08:00
|
|
|
|
2013-06-04 04:31:55 +08:00
|
|
|
#define DRA752_GRADIENT_SLOPE_W_PCB 0
|
|
|
|
#define DRA752_GRADIENT_CONST_W_PCB 2000
|
|
|
|
|
2012-07-13 00:02:30 +08:00
|
|
|
/* 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 */
|
|
|
|
/**
|
2013-03-19 22:54:21 +08:00
|
|
|
* ti_thermal_get_trip_value - returns trip temperature based on index
|
2012-07-13 00:02:30 +08:00
|
|
|
* @i: trip index
|
|
|
|
*/
|
2013-03-19 22:54:21 +08:00
|
|
|
#define ti_thermal_get_trip_value(i) \
|
2012-07-13 00:02:30 +08:00
|
|
|
(OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP))
|
|
|
|
|
|
|
|
/**
|
2013-03-19 22:54:21 +08:00
|
|
|
* ti_thermal_is_valid_trip - check for trip index
|
2012-07-13 00:02:30 +08:00
|
|
|
* @i: trip index
|
|
|
|
*/
|
2013-03-19 22:54:21 +08:00
|
|
|
#define ti_thermal_is_valid_trip(trip) \
|
2012-07-13 00:02:30 +08:00
|
|
|
((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
|
|
|
|
|
2013-03-19 22:54:20 +08:00
|
|
|
#ifdef CONFIG_TI_THERMAL
|
2013-03-19 22:54:21 +08:00
|
|
|
int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain);
|
|
|
|
int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id);
|
2013-04-02 00:04:35 +08:00
|
|
|
int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id);
|
2013-03-19 22:54:21 +08:00
|
|
|
int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id);
|
|
|
|
int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id);
|
2012-07-13 00:02:30 +08:00
|
|
|
#else
|
|
|
|
static inline
|
2013-03-19 22:54:21 +08:00
|
|
|
int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain)
|
2012-07-13 00:02:30 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline
|
2013-03-19 22:54:21 +08:00
|
|
|
int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
|
2012-07-13 00:02:30 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-04-02 00:04:35 +08:00
|
|
|
static inline
|
|
|
|
int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-07-13 00:02:30 +08:00
|
|
|
static inline
|
2013-03-19 22:54:21 +08:00
|
|
|
int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
|
2012-07-13 00:02:30 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline
|
2013-03-19 22:54:21 +08:00
|
|
|
int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
|
2012-07-13 00:02:30 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|