162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * OMAP thermal definitions 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ 662306a36Sopenharmony_ci * Contact: 762306a36Sopenharmony_ci * Eduardo Valentin <eduardo.valentin@ti.com> 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci#ifndef __TI_THERMAL_H 1062306a36Sopenharmony_ci#define __TI_THERMAL_H 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include "ti-bandgap.h" 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci/* PCB sensor calculation constants */ 1562306a36Sopenharmony_ci#define OMAP_GRADIENT_SLOPE_W_PCB_4430 0 1662306a36Sopenharmony_ci#define OMAP_GRADIENT_CONST_W_PCB_4430 20000 1762306a36Sopenharmony_ci#define OMAP_GRADIENT_SLOPE_W_PCB_4460 1142 1862306a36Sopenharmony_ci#define OMAP_GRADIENT_CONST_W_PCB_4460 -393 1962306a36Sopenharmony_ci#define OMAP_GRADIENT_SLOPE_W_PCB_4470 1063 2062306a36Sopenharmony_ci#define OMAP_GRADIENT_CONST_W_PCB_4470 -477 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#define OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU 100 2362306a36Sopenharmony_ci#define OMAP_GRADIENT_CONST_W_PCB_5430_CPU 484 2462306a36Sopenharmony_ci#define OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU 464 2562306a36Sopenharmony_ci#define OMAP_GRADIENT_CONST_W_PCB_5430_GPU -5102 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define DRA752_GRADIENT_SLOPE_W_PCB 0 2862306a36Sopenharmony_ci#define DRA752_GRADIENT_CONST_W_PCB 2000 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci/* trip points of interest in milicelsius (at hotspot level) */ 3162306a36Sopenharmony_ci#define OMAP_TRIP_COLD 100000 3262306a36Sopenharmony_ci#define OMAP_TRIP_HOT 110000 3362306a36Sopenharmony_ci#define OMAP_TRIP_SHUTDOWN 125000 3462306a36Sopenharmony_ci#define OMAP_TRIP_NUMBER 2 3562306a36Sopenharmony_ci#define OMAP_TRIP_STEP \ 3662306a36Sopenharmony_ci ((OMAP_TRIP_SHUTDOWN - OMAP_TRIP_HOT) / (OMAP_TRIP_NUMBER - 1)) 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci/* Update rates */ 3962306a36Sopenharmony_ci#define FAST_TEMP_MONITORING_RATE 250 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci#ifdef CONFIG_TI_THERMAL 4262306a36Sopenharmony_ciint ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain); 4362306a36Sopenharmony_ciint ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id); 4462306a36Sopenharmony_ciint ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id); 4562306a36Sopenharmony_ciint ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id); 4662306a36Sopenharmony_ciint ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id); 4762306a36Sopenharmony_ci#else 4862306a36Sopenharmony_cistatic inline 4962306a36Sopenharmony_ciint ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain) 5062306a36Sopenharmony_ci{ 5162306a36Sopenharmony_ci return 0; 5262306a36Sopenharmony_ci} 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_cistatic inline 5562306a36Sopenharmony_ciint ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id) 5662306a36Sopenharmony_ci{ 5762306a36Sopenharmony_ci return 0; 5862306a36Sopenharmony_ci} 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_cistatic inline 6162306a36Sopenharmony_ciint ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id) 6262306a36Sopenharmony_ci{ 6362306a36Sopenharmony_ci return 0; 6462306a36Sopenharmony_ci} 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_cistatic inline 6762306a36Sopenharmony_ciint ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id) 6862306a36Sopenharmony_ci{ 6962306a36Sopenharmony_ci return 0; 7062306a36Sopenharmony_ci} 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_cistatic inline 7362306a36Sopenharmony_ciint ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id) 7462306a36Sopenharmony_ci{ 7562306a36Sopenharmony_ci return 0; 7662306a36Sopenharmony_ci} 7762306a36Sopenharmony_ci#endif 7862306a36Sopenharmony_ci#endif 79