Commit db831886 authored by Caesar Wang's avatar Caesar Wang Committed by Eduardo Valentin

thermal: rockchip: fixes the conversion table

As Ayaka reported the thermal was abormal on rk3288 at booting time.
thermal thermal_zone1: critical temperature reached(125 C),shutting down
thermal thermal_zone2: critical temperature reached(125 C),shutting down
thermal thermal_zone1: critical temperature reached(125 C),shutting down
thermal thermal_zone2: critical temperature reached(125 C),shutting down
...
The root caused by reading the invald analogic value, the value is zero
will convert the 125 degree to trigger the critical temperature.
Fixes it with insteading of the incorrect reading now.

Fixes commit cadf29dc
("thermal: rockchip: optimize the conversion table")
Reported-by: default avatarayaka <ayaka@soulik.info>
Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 18591add
...@@ -464,7 +464,7 @@ static int rk_tsadcv2_code_to_temp(const struct chip_tsadc_table *table, ...@@ -464,7 +464,7 @@ static int rk_tsadcv2_code_to_temp(const struct chip_tsadc_table *table,
switch (table->mode) { switch (table->mode) {
case ADC_DECREMENT: case ADC_DECREMENT:
code &= table->data_mask; code &= table->data_mask;
if (code < table->id[high].code) if (code <= table->id[high].code)
return -EAGAIN; /* Incorrect reading */ return -EAGAIN; /* Incorrect reading */
while (low <= high) { while (low <= high) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment