• Daniel Lezcano's avatar
    thermal/drivers/hisi: Remove costly sensor inspection · 10d7e9a9
    Daniel Lezcano authored
    The sensor is all setup, bind, resetted, acked, etc... every single second.
    
    That was the way to workaround a problem with the interrupt bouncing again and
    again.
    
    With the following changes, we fix all in one:
    
     - Do the setup, one time, at probe time
    
     - Add the IRQF_ONESHOT, ack the interrupt in the threaded handler
    
     - Remove the interrupt handler
    
     - Set the correct value for the LAG register
    
     - Remove all the irq_enabled stuff in the code as the interruption
       handling is fixed
    
     - Remove the 3ms delay
    
     - Reorder the initialization routine to be in the right order
    
    It ends up to a nicer code and more efficient, the 3-5ms delay is removed from
    the get_temp() path.
    Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
    Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
    Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
    Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
    10d7e9a9
hisi_thermal.c 11.6 KB