diff options
author | Alex Waterman <alexw@nvidia.com> | 2018-03-12 18:44:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-05 14:24:05 -0400 |
commit | 182760476dbd1415ef9a6c0c33dba0adc4dde1ef (patch) | |
tree | a8f2ef172d16b182f04f8719be34d7c40bdb7d85 /drivers/gpu/nvgpu/pmgr/pmgrpmu.c | |
parent | d8e23112915d185deb534aa777c3f81ad6df5507 (diff) |
gpu: nvgpu: De-linuxify pmgr code
The pmgr code is in theory common code. However there were uses
of Linux stuff within this code.
This patch cleans that up by deleting the unnecessary os_linux.h
includes, usage of kfree() and adds several platform fields to
the gk20a struct. The platform data is copied to the gk20a struct
in the platform initialization code so that this common code can
access said data without requiring any knowledge of the OS platform
data.
JIRA NVGPU-525
Change-Id: Ic4bb6021f60b0a0778779ab5f3e15b7e5ca98306
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1673825
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pmgrpmu.c')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pmgrpmu.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c index ed33c08c..3398e8df 100644 --- a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c +++ b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c | |||
@@ -26,8 +26,6 @@ | |||
26 | 26 | ||
27 | #include "gk20a/gk20a.h" | 27 | #include "gk20a/gk20a.h" |
28 | #include "gp106/bios_gp106.h" | 28 | #include "gp106/bios_gp106.h" |
29 | #include "common/linux/os_linux.h" | ||
30 | #include "common/linux/platform_gk20a.h" | ||
31 | 29 | ||
32 | #include "boardobj/boardobjgrp.h" | 30 | #include "boardobj/boardobjgrp.h" |
33 | #include "boardobj/boardobjgrp_e32.h" | 31 | #include "boardobj/boardobjgrp_e32.h" |
@@ -148,8 +146,7 @@ exit: | |||
148 | static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) | 146 | static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) |
149 | { | 147 | { |
150 | struct nv_pmu_pmgr_i2c_device_desc_table i2c_desc_table; | 148 | struct nv_pmu_pmgr_i2c_device_desc_table i2c_desc_table; |
151 | struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); | 149 | u32 idx = g->ina3221_dcb_index; |
152 | u32 idx = platform->ina3221_dcb_index; | ||
153 | u32 status = 0; | 150 | u32 status = 0; |
154 | 151 | ||
155 | /* INA3221 I2C device info */ | 152 | /* INA3221 I2C device info */ |
@@ -159,9 +156,9 @@ static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) | |||
159 | i2c_desc_table.devices[idx].super.type = 0x4E; | 156 | i2c_desc_table.devices[idx].super.type = 0x4E; |
160 | 157 | ||
161 | i2c_desc_table.devices[idx].dcb_index = idx; | 158 | i2c_desc_table.devices[idx].dcb_index = idx; |
162 | i2c_desc_table.devices[idx].i2c_address = platform->ina3221_i2c_address; | 159 | i2c_desc_table.devices[idx].i2c_address = g->ina3221_i2c_address; |
163 | i2c_desc_table.devices[idx].i2c_flags = 0xC2F; | 160 | i2c_desc_table.devices[idx].i2c_flags = 0xC2F; |
164 | i2c_desc_table.devices[idx].i2c_port = platform->ina3221_i2c_port; | 161 | i2c_desc_table.devices[idx].i2c_port = g->ina3221_i2c_port; |
165 | 162 | ||
166 | /* Pass the table down the PMU as an object */ | 163 | /* Pass the table down the PMU as an object */ |
167 | status = pmgr_pmu_set_object( | 164 | status = pmgr_pmu_set_object( |
@@ -220,7 +217,7 @@ static u32 pmgr_send_pwr_device_topology_to_pmu(struct gk20a *g) | |||
220 | status); | 217 | status); |
221 | 218 | ||
222 | exit: | 219 | exit: |
223 | kfree(pwr_desc_table); | 220 | nvgpu_kfree(g, pwr_desc_table); |
224 | return status; | 221 | return status; |
225 | } | 222 | } |
226 | 223 | ||
@@ -289,7 +286,7 @@ static u32 pmgr_send_pwr_mointer_to_pmu(struct gk20a *g) | |||
289 | status); | 286 | status); |
290 | 287 | ||
291 | exit: | 288 | exit: |
292 | kfree(pwr_monitor_pack); | 289 | nvgpu_kfree(g, pwr_monitor_pack); |
293 | return status; | 290 | return status; |
294 | } | 291 | } |
295 | 292 | ||