/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2019 MediaTek Inc. */ #ifndef __TSPMIC_SETTINGS_H__ #define __TSPMIC_SETTINGS_H__ //#include /*#include */ #include #include #include #include /*============================================================= * Genernal *============================================================= */ #define MIN(_a_, _b_) ((_a_) > (_b_) ? (_b_) : (_a_)) #define MAX(_a_, _b_) ((_a_) > (_b_) ? (_a_) : (_b_)) #define _BIT_(_bit_) (unsigned int)(1 << (_bit_)) #define _BITMASK_(_bits_) (((unsigned int) -1 >> (31 - ((1) ? \ _bits_))) & ~((1U << ((0) ? _bits_)) - 1)) #define mtktspmic_TEMP_CRIT 150000 /* 150.000 degree Celsius */ #define y_pmic_repeat_times 1 #define mtktspmic_info(fmt, args...) \ pr_notice("[Thermal/TZ/PMIC] " fmt, ##args) #define mtktspmic_dprintk(fmt, args...) \ do { \ if (mtktspmic_debug_log == 1) { \ pr_notice("[Thermal/TZ/PMIC] " fmt, ##args); \ } \ } while (0) #define THERMAL_USE_IIO_CHANNEL extern int mtktspmic_debug_log; void mtktspmic_cali_prepare(struct regmap *pmic_map); extern void mtktspmic_cali_prepare2(void); extern void mtktspmic_get_from_dts(struct platform_device *pdev); extern int mtktspmic_get_hw_temp(void); extern int mt6357tsbuck1_get_hw_temp(void); extern int mt6357tsbuck2_get_hw_temp(void); extern u32 pmic_Read_Efuse_HPOffset(int i); #endif /* __TSPMIC_SETTINGS_H__ */