opp: Keep track of currently programmed OPP
The dev_pm_opp_set_rate() helper needs to know the currently programmed OPP to make few decisions and currently we try to find it on every invocation of this routine. Lets start keeping track of the current_opp programmed for the devices of the opp table, that will be quite useful going forward. If we fail to find the current OPP, we pick the first one available in the list, as the list is in ascending order of frequencies, level, or bandwidth and that's the best guess we can make anyway. Note that we used to do the frequency comparison a bit early in dev_pm_opp_set_rate() previously, and now instead we check the target opp, which shall be more accurate anyway. We need to make sure that current_opp's memory doesn't get freed while it is being used and so we keep a reference of it until the time it is used. Now that current_opp will always be set, we can drop some unnecessary checks as well. Signed-off-by:Viresh Kumar <viresh.kumar@linaro.org> Tested-by:
Dmitry Osipenko <digetx@gmail.com>
-
mentioned in commit de04241a
-
mentioned in commit 86b87270
-
mentioned in commit e01b8115
-
mentioned in commit 521a8e50
-
mentioned in commit 950b7132
-
mentioned in commit 90406541
-
mentioned in commit c34d558e
-
mentioned in commit 2d20748f
-
mentioned in commit 9a6e07c9
-
mentioned in commit c0072de1
-
mentioned in commit 4f9718d5
Please register or sign in to comment