• Caesar Wang's avatar
    thermal: rockchip: make temperature reporting much more accurate · 1e9a1aea
    Caesar Wang authored
    In general, the kernel should report temperature readings exactly as
    reported by the hardware. The cpu / gpu thermal driver works in 5 degree
    increments,but we ought to do more accurate. The temperature will do
    linear interpolation between the entries in the table.
    
    Test= $md5sum /dev/zero &
    $while true; do grep "" /sys/class/thermal/thermal_zone[1-2]/temp;
    sleep .5; done
    
    e.g. We can get the result as follows:
        /sys/class/thermal/thermal_zone1/temp:39994
        /sys/class/thermal/thermal_zone2/temp:39086
        /sys/class/thermal/thermal_zone1/temp:39994
        /sys/class/thermal/thermal_zone2/temp:39540
        /sys/class/thermal/thermal_zone1/temp:39540
        /sys/class/thermal/thermal_zone2/temp:39540
        /sys/class/thermal/thermal_zone1/temp:39540
        /sys/class/thermal/thermal_zone2/temp:39994
    Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    Reviewed-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
    Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
    Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
    1e9a1aea
rockchip_thermal.c 18.1 KB