diff options
author | Thomas Fleury <tfleury@nvidia.com> | 2016-10-21 19:43:39 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:52 -0500 |
commit | 849c5317e8509b390da626bcb607e66cc5ef847f (patch) | |
tree | a50207bd32926991b1a482dd1de5a24c1d44b97f /drivers/gpu/nvgpu/volt | |
parent | 5ab254c6e84d741f56e9bcc93512f82eb7ce518c (diff) |
gpu: nvgpu: get voltage, current, power and temperature
Add ioctls to retrieve voltage, current, power and temperature.
Add flags in GPU characteristics to indicate if feature is supported.
Jira DNVGPU-166
Change-Id: Ifaafe2efdb6b09d7b28215b641814f28e894151e
Signed-off-by: David Martinez Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1241861
Tested-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1267122
Diffstat (limited to 'drivers/gpu/nvgpu/volt')
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_pmu.c | 14 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_pmu.h | 2 |
2 files changed, 3 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/volt/volt_pmu.c b/drivers/gpu/nvgpu/volt/volt_pmu.c index 4d451b65..a92eb777 100644 --- a/drivers/gpu/nvgpu/volt/volt_pmu.c +++ b/drivers/gpu/nvgpu/volt/volt_pmu.c | |||
@@ -227,17 +227,7 @@ u32 volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv, u32 sram_voltage_uv) | |||
227 | 227 | ||
228 | } | 228 | } |
229 | 229 | ||
230 | u32 volt_get_voltage(struct gk20a *g, u32 volt_domain) | 230 | u32 volt_get_voltage(struct gk20a *g, u32 volt_domain, u32 *voltage_uv) |
231 | { | 231 | { |
232 | u32 status = 0; | 232 | return volt_rail_get_voltage(g, volt_domain, voltage_uv); |
233 | u32 voltage_uv = 0; | ||
234 | |||
235 | status = volt_rail_get_voltage(g, volt_domain, &voltage_uv); | ||
236 | if (status) { | ||
237 | gk20a_err(dev_from_gk20a(g), | ||
238 | "CTRL_VOLT_DOMAIN_LOGIC get voltage failed"); | ||
239 | return 0; | ||
240 | } | ||
241 | |||
242 | return voltage_uv; | ||
243 | } | 233 | } |
diff --git a/drivers/gpu/nvgpu/volt/volt_pmu.h b/drivers/gpu/nvgpu/volt/volt_pmu.h index c98ba321..9af3fb68 100644 --- a/drivers/gpu/nvgpu/volt/volt_pmu.h +++ b/drivers/gpu/nvgpu/volt/volt_pmu.h | |||
@@ -17,6 +17,6 @@ | |||
17 | u32 volt_pmu_send_load_cmd_to_pmu(struct gk20a *g); | 17 | u32 volt_pmu_send_load_cmd_to_pmu(struct gk20a *g); |
18 | u32 volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv, | 18 | u32 volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv, |
19 | u32 sram_voltage_uv); | 19 | u32 sram_voltage_uv); |
20 | u32 volt_get_voltage(struct gk20a *g, u32 volt_domain); | 20 | u32 volt_get_voltage(struct gk20a *g, u32 volt_domain, u32 *voltage_uv); |
21 | 21 | ||
22 | #endif | 22 | #endif |