| /***************************************************************************** |
| * Copyright Statement: |
| * -------------------- |
| * This software is protected by Copyright and the information contained |
| * herein is confidential. The software may not be copied and the information |
| * contained herein may not be used or disclosed except with the written |
| * permission of MediaTek Inc. (C) 2017 |
| * |
| * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| * |
| * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| * |
| * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| * |
| *****************************************************************************/ |
| |
| /******************************************************************************* |
| * |
| * Filename: |
| * --------- |
| * tia_public.h |
| * |
| * Project: |
| * -------- |
| * VMOLY |
| * |
| * Description: |
| * ------------ |
| * TIA (Thermal Information Acquisition) driver public header for MD thermal |
| * |
| * Author: |
| * ------- |
| * ------- |
| * |
| *============================================================================ |
| * HISTORY |
| * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| *------------------------------------------------------------------------------ |
| * removed! |
| * removed! |
| * removed! |
| *------------------------------------------------------------------------------ |
| * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| *============================================================================ |
| ****************************************************************************/ |
| |
| #ifndef __TIA_PUBLIC_H__ |
| #define __TIA_PUBLIC_H__ |
| |
| #include "kal_general_types.h" |
| #include "thermal_public.h" |
| |
| #if defined(__MD_TFWK__) && defined(__MTK_TARGET__) |
| /** |
| * tia_get_temp - get tia temperature by sensor id |
| * @sensor_id: [in] sensor id, refer to THERMAL_TIA_SENSOR_ID(n=0~) @thermal_public.h |
| * @temp: [in,out] temperature in 1/10th of Celsius Degree |
| * @return: error code, refer to THERMAL_ERR_XXX |
| */ |
| kal_int32 tia_get_temp(kal_uint32 sensor_id, kal_int32 *temp); |
| |
| /** |
| * tia_get_temp_all - get tia temperature info array |
| * @ninfo: [in] temperature info number, must be THERMAL_TIA_SENSOR_NUM @thermal_public.h |
| * @infos: [in,out] pointer to thermal_temp_info_t list |
| * @return error code, refer to THERMAL_ERR_XXX |
| */ |
| kal_int32 tia_get_temp_all(kal_uint32 ninfo, thermal_temp_info_t *infos); |
| |
| /** |
| * tia_atcmd_public - tia public atcmd handler |
| * @data_len: [in] atcmd data length |
| * @data_str: [in] atcmd data array |
| * @return KAL_TRUE: success, KAL_FALSE: failure |
| */ |
| kal_bool tia_atcmd_public(kal_uint32 data_len, kal_uint8 *data_str); |
| |
| #ifndef NVRAM_NOT_PRESENT |
| #include "thermal_nvram_def.h" |
| /** |
| * tia_nvram_read_sensor_info - tia read sensor info in nvram |
| * @sensor_id: [in] sensor id, refer to THERMAL_LVTS/TIA_SENSOR_ID(n=0~) @thermal_public.h |
| * @info: [in,out] pointer to nvram_thermal_sensor_info_struct |
| * @return KAL_TRUE: success, KAL_FALSE: failure |
| */ |
| kal_bool tia_nvram_read_sensor_info(kal_uint32 sensor_id, nvram_thermal_sensor_info_struct *info); |
| #endif |
| |
| #else |
| #define tia_get_temp(...) ({THERMAL_ERR_SENSOR_ID;}) |
| #define tia_get_temp_all(...) ({THERMAL_ERR_SENSOR_ID;}) |
| #define tia_atcmd_public(...) ({KAL_FALSE;}) |
| #define tia_nvram_read_sensor_info(...) ({KAL_FALSE;}) |
| #endif |
| #endif |