diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2019-12-18 21:55:35 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2020-01-10 17:42:58 +0300 |
commit | 45f019a684253910064699395649c7869a203777 (patch) | |
tree | 2d4821ecda3d5ea448a7007326ffa01da65ed51c /drivers/soc/tegra/regulators-tegra20.c | |
parent | 19d41e5e9c6863ada69e4f6d006634e60987c7ac (diff) | |
download | linux-45f019a684253910064699395649c7869a203777.tar.xz |
soc/tegra: regulators: Do nothing if voltage is unchanged
There is no need to re-apply the same voltage. This change is just a minor
cleanup.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc/tegra/regulators-tegra20.c')
-rw-r--r-- | drivers/soc/tegra/regulators-tegra20.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/soc/tegra/regulators-tegra20.c b/drivers/soc/tegra/regulators-tegra20.c index ea0eede48802..367a71a3cd10 100644 --- a/drivers/soc/tegra/regulators-tegra20.c +++ b/drivers/soc/tegra/regulators-tegra20.c @@ -162,6 +162,9 @@ static int tegra20_core_rtc_update(struct tegra_regulator_coupler *tegra, core_target_uV = max(rtc_uV - max_spread, core_target_uV); } + if (core_uV == core_target_uV) + goto update_rtc; + err = regulator_set_voltage_rdev(core_rdev, core_target_uV, core_max_uV, @@ -170,7 +173,7 @@ static int tegra20_core_rtc_update(struct tegra_regulator_coupler *tegra, return err; core_uV = core_target_uV; - +update_rtc: if (rtc_uV < rtc_min_uV) { rtc_target_uV = min(rtc_uV + max_spread, rtc_min_uV); rtc_target_uV = min(core_uV + max_spread, rtc_target_uV); @@ -179,6 +182,9 @@ static int tegra20_core_rtc_update(struct tegra_regulator_coupler *tegra, rtc_target_uV = max(core_uV - max_spread, rtc_target_uV); } + if (rtc_uV == rtc_target_uV) + continue; + err = regulator_set_voltage_rdev(rtc_rdev, rtc_target_uV, rtc_max_uV, |