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

Commit cdb64c25 authored by Kiran Gunda's avatar Kiran Gunda
Browse files

regulator: rpm-smd-regulator: Correct the get_optimum_mode function



Do not set the "CURRENT" KVP param in the "get_optimum_mode" function.
Because of this, when the consumers call the "regulator_set_load"
function the set_mode callback which actually sends the "CURRENT"
KVP to RPM subsystem is not getting invoked. Hence, remove it from
get_optimum_mode function as the same KVP is set in the the set_mode
callback.

Change-Id: I3d0a7c37a78c844459d864d92c96e02e4362d160
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent 67474db3
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 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
@@ -933,10 +933,6 @@ static unsigned int rpm_vreg_get_optimum_mode(struct regulator_dev *rdev,
	if (load_mA > params[RPM_REGULATOR_PARAM_CURRENT].max)
		load_mA = params[RPM_REGULATOR_PARAM_CURRENT].max;

	rpm_vreg_lock(reg->rpm_vreg);
	RPM_VREG_SET_PARAM(reg, CURRENT, load_mA);
	rpm_vreg_unlock(reg->rpm_vreg);

	return (load_uA >= reg->rpm_vreg->hpm_min_load)
		? REGULATOR_MODE_NORMAL : REGULATOR_MODE_IDLE;
}