Hi @Zhiming_Liu
imx_set_alarm_temp function is below
static void imx_set_alarm_temp(struct imx_thermal_data *data,
int alarm_temp)
{
struct regmap *map = data->tempmon;
const struct thermal_soc_data *soc_data = data->socdata;
int alarm_value;
data->alarm_temp = alarm_temp;
if (data->socdata->version == TEMPMON_IMX7D)
alarm_value = alarm_temp / 1000 + data->c1 - 25;
else
alarm_value = (data->c2 - alarm_temp) / data->c1;
regmap_write(map, soc_data->high_alarm_ctrl + REG_CLR,
soc_data->high_alarm_mask);
regmap_write(map, soc_data->high_alarm_ctrl + REG_SET,
alarm_value << soc_data->high_alarm_shift);
}
I am not seeing any setting for the low temperature in this function. Writing to the Address: 20C_8000h base + 180h offset + (4d × i), where i=0d to 3d .
Low temperature is setting in the below driver part I think
/* make sure the IRQ flag is clear before enabling irq on i.MX6SX */
if (data->socdata->version == TEMPMON_IMX6SX) {
regmap_write(map, IMX6_MISC1 + REG_CLR,
IMX6_MISC1_IRQ_TEMPHIGH | IMX6_MISC1_IRQ_TEMPLOW
| IMX6_MISC1_IRQ_TEMPPANIC);
/*
* reset value of LOW ALARM is incorrect, set it to lowest
* value to avoid false trigger of low alarm.
*/
regmap_write(map, data->socdata->low_alarm_ctrl + REG_SET,
data->socdata->low_alarm_mask);
Writing to the Address: 20C_8000h base + 290h offset + (4d × i), where i=0d to 3d .
I am getting a value 0xfff while reading the address. REG_SET value is 0x4.
In this case, kernel warnings are coming below zero degree celcius.
Driver is not reading temperature zone value from dtsi file and dtsi file does not contains temperature zones also.