Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47fbd0b9 authored by Tharun Raj Soma's avatar Tharun Raj Soma
Browse files

drm/msm/dsi-staging: add support for change in minimum voltage of regulator



Some regulators require change in their minimum voltage level
before the client removes its vote. This change checks if there is
a change in the minimum voltage level required and updates the
corresponding level before the regulator is disabled.

Change-Id: Ib62027a01c21ed12bab5cd221f39e089a3b054bb
Signed-off-by: default avatarTharun Raj Soma <tsoma@codeaurora.org>
parent 70f35db1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ Optional properties:
					-- qcom,supply-max-voltage: maximum voltage level (uV)
					-- qcom,supply-enable-load: load drawn (uA) from enabled supply
					-- qcom,supply-disable-load: load drawn (uA) from disabled supply
					-- qcom,supply-off-min-voltage: minimum voltage level (uV) when turned off
					-- qcom,supply-pre-on-sleep: time to sleep (ms) before turning on
					-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
					-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
+14 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -73,6 +73,14 @@ static int dsi_pwr_parse_supply_node(struct dsi_parser_utils *utils,
		regs->vregs[i].disable_load = tmp;

		/* Optional values */
		rc = utils->read_u32(node, "qcom,supply-off-min-voltage", &tmp);
		if (rc) {
			pr_debug("off-min-voltage not specified\n");
			rc = 0;
		} else {
			regs->vregs[i].off_min_voltage = tmp;
		}

		rc = utils->read_u32(node, "qcom,supply-pre-on-sleep", &tmp);
		if (rc) {
			pr_debug("pre-on-sleep not specified\n");
@@ -167,6 +175,11 @@ static int dsi_pwr_enable_vregs(struct dsi_regulator_info *regs, bool enable)
			if (regs->vregs[i].pre_off_sleep)
				msleep(regs->vregs[i].pre_off_sleep);

			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);
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -30,6 +30,7 @@ struct dsi_parser_utils;
 * @max_voltage:     Maximum voltage in uV.
 * @enable_load:     Load, in uA, when enabled.
 * @disable_load:    Load, in uA, when disabled.
 * @off_min_voltage: Minimum voltage in uV when regulator is disabled.
 * @pre_on_sleep:    Sleep, in ms, before enabling the regulator.
 * @post_on_sleep:   Sleep, in ms, after enabling the regulator.
 * @pre_off_sleep:   Sleep, in ms, before disabling the regulator.
@@ -42,6 +43,7 @@ struct dsi_vreg {
	u32 max_voltage;
	u32 enable_load;
	u32 disable_load;
	u32 off_min_voltage;
	u32 pre_on_sleep;
	u32 post_on_sleep;
	u32 pre_off_sleep;