Skip to contentSkip to conversation

regulator: qcom-smd: Correct set_load() unit

PATCH In review Bjorn Andersson 2 participants 2 messages Oct 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: qcom-smd: Correct set_load() unit

The set_load() op deals with uA while the SMD packets used mA, so convert as we're building the packet.

---
 drivers/regulator/qcom_smd-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/qcom_smd-regulator.c +1 -1
index b72c693e29ff..6fa0c7d13290 100644
@@ -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));
 }
Signature · 1 line
2.4.2
#1 lore raw
Quoted 5 lines · Bjorn Andersson

The set_load() op deals with uA while the SMD packets used mA, so convert as we're building the packet.

---

Looks fine to me. Thanks for the fix.

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project