From e049967a27071c4acc0df702a76a02e1cd6fcaad Mon Sep 17 00:00:00 2001 From: Yi-Wei Wang Date: Thu, 3 Oct 2024 15:52:47 +0800 Subject: [PATCH] i2c: nvvrs11: Report power in milliWatts The unit of the voltage is in milliVolts and the current is in Amperes for VRS11. So, the power can be reported in milliWatts which provides higher resolution for better profiling. Bug 200718059 Change-Id: I0ae52dafa4c7dcc751d9c65b410205163a4fbc45 Signed-off-by: Yi-Wei Wang Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3223011 (cherry picked from commit 3741667390d68b5238ff6b7b2de01c4846557bfd) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3223041 Reviewed-by: Bitan Biswas GVS: buildbot_gerritrpt --- drivers/i2c/busses/i2c-nvvrs11.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-nvvrs11.c b/drivers/i2c/busses/i2c-nvvrs11.c index 41e0c1eb..b6eda84d 100644 --- a/drivers/i2c/busses/i2c-nvvrs11.c +++ b/drivers/i2c/busses/i2c-nvvrs11.c @@ -2,7 +2,7 @@ /* * Voltage Regulator Specification: VRS11 High Current Voltage Regulator * - * Copyright (C) 2022-2023 NVIDIA CORPORATION. All rights reserved. + * Copyright (C) 2022-2024 NVIDIA CORPORATION. All rights reserved. */ #include @@ -120,8 +120,8 @@ static ssize_t show_loopA_rail_power(struct device *dev, if (current_A < 0) return current_A; - power = (voltage_A * current_A)/1000; - return sprintf(buf, "%u W\n", power); + power = (voltage_A * current_A); + return sprintf(buf, "%u mW\n", power); } static ssize_t show_loopB_rail_name(struct device *dev, @@ -180,9 +180,9 @@ static ssize_t show_loopB_rail_power(struct device *dev, if (current_B < 0) return current_B; - power = (voltage_B * current_B)/1000; + power = (voltage_B * current_B); - return sprintf(buf, "%u W\n", power); + return sprintf(buf, "%u mW\n", power); } static DEVICE_ATTR(loopA_rail_name, S_IRUGO, show_loopA_rail_name, NULL);