All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: qcom-smd: Correct set_load() unit
@ 2015-10-13  0:49 ` Bjorn Andersson
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2015-10-13  0:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, linux-arm-msm, Andy Gross

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(-)

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));
 }
-- 
2.4.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] regulator: qcom-smd: Correct set_load() unit
@ 2015-10-13  0:49 ` Bjorn Andersson
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2015-10-13  0:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, linux-arm-msm, Andy Gross

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(-)

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));
 }
-- 
2.4.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: qcom-smd: Correct set_load() unit
  2015-10-13  0:49 ` Bjorn Andersson
  (?)
@ 2015-10-13  4:22 ` Andy Gross
  -1 siblings, 0 replies; 3+ messages in thread
From: Andy Gross @ 2015-10-13  4:22 UTC (permalink / raw)
  To: Bjorn Andersson; +Cc: Liam Girdwood, Mark Brown, linux-kernel, linux-arm-msm

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.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-13  4:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13  0:49 [PATCH] regulator: qcom-smd: Correct set_load() unit Bjorn Andersson
2015-10-13  0:49 ` Bjorn Andersson
2015-10-13  4:22 ` Andy Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.