disp: msm: set voltage to min before disable

This change sets the regulator voltage to zero for all
those regulators which support voltage scaling before
disabling the regulator. Failing to do so causes the regulator
vote to set to the last min value specified in the previous
set voltage call.
Additionally modified the config regulator api and renamed to
get regulator because of the above change.

Change-Id: Ie4c4842db0c08a4d98926ed79503cf84e4d5762a
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This commit is contained in:
Abhijit Kulkarni
2020-04-23 23:03:27 -07:00
parent 34df751b29
commit 96e8b6819c
5 changed files with 32 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/of.h>
@@ -179,15 +179,16 @@ static int dsi_pwr_enable_vregs(struct dsi_regulator_info *regs, bool enable)
usleep_range((pre_off_ms * 1000),
(pre_off_ms * 1000) + 10);
if (regs->vregs[i].off_min_voltage)
(void)regulator_set_voltage(regs->vregs[i].vreg,
regs->vregs[i].off_min_voltage,
regs->vregs[i].max_voltage);
(void)regulator_set_load(regs->vregs[i].vreg,
regs->vregs[i].disable_load);
(void)regulator_disable(regs->vregs[i].vreg);
num_of_v = regulator_count_voltages(vreg->vreg);
if (num_of_v > 0)
(void)regulator_set_voltage(regs->vregs[i].vreg,
regs->vregs[i].off_min_voltage,
regs->vregs[i].max_voltage);
if (post_off_ms)
usleep_range((post_off_ms * 1000),
(post_off_ms * 1000) + 10);