diff mbox

regulator: qcom-smd: Correct set_load() unit

Message ID 1444697392-5454-1-git-send-email-bjorn.andersson@sonymobile.com (mailing list archive)
State Accepted, archived
Delegated to: Andy Gross
Headers show

Commit Message

Bjorn Andersson Oct. 13, 2015, 12:49 a.m. UTC
The set_load() op deals with uA while the SMD packets used mA, so
convert as we're building the packet.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---
 drivers/regulator/qcom_smd-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Gross Oct. 13, 2015, 4:22 a.m. UTC | #1
On Mon, Oct 12, 2015 at 05:49:52PM -0700, Bjorn Andersson wrote:
> The set_load() op deals with uA while the SMD packets used mA, so
> convert as we're building the packet.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> ---

Looks fine to me.  Thanks for the fix.
diff mbox

Patch

diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
index b72c693e29ff..6fa0c7d13290 100644
--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -131,7 +131,7 @@  static int rpm_reg_set_load(struct regulator_dev *rdev, int load_uA)
 
 	req.key = cpu_to_le32(RPM_KEY_MA);
 	req.nbytes = cpu_to_le32(sizeof(u32));
-	req.value = cpu_to_le32(load_uA);
+	req.value = cpu_to_le32(load_uA / 1000);
 
 	return rpm_reg_write_active(vreg, &req, sizeof(req));
 }