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 <yiweiw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3223011
(cherry picked from commit 3741667390)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3223041
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Yi-Wei Wang
2024-10-03 15:52:47 +08:00
committed by Jon Hunter
parent 7adb4caf5b
commit e049967a27

View File

@@ -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 <nvidia/conftest.h>
@@ -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);