• Viresh Kumar's avatar
    thermal: cpu_cooling: Store frequencies in descending order · f6859014
    Viresh Kumar authored
    CPUFreq framework *doesn't* guarantee that frequencies present in cpufreq table
    will be in ascending or descending order. But cpu_cooling somehow assumes that.
    
    Probably because most of current users are creating this list from DT, which is
    done with the help of OPP layer. And OPP layer creates the list in ascending
    order of frequencies.
    
    But cpu_cooling can be used for other platforms too, which don't have
    frequencies arranged in any order.
    
    This patch tries to fix this issue by creating another list of valid frequencies
    in descending order. Care is also taken to throw warnings for duplicate entries.
    
    Later patches would use it to simplify code.
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
    f6859014
cpu_cooling.c 15.8 KB