[PATCH v5 4/5] thermal: devfreq_cooling: Refactor code and switch to use Energy Model