From f391f53c089ec12fcc501c491430380b668e3cbf Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 26 Jul 2017 18:08:00 -0700 Subject: gpu: nvgpu: Reorg therm HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the therm sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: Ic9d03304d3dcde0365cbf22af2dbe1e7eb0e04bb Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1527422 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp10b/hal_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 3a44f1ef..a2aacd2e 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -309,6 +309,10 @@ static const struct gpu_ops gp10b_ops = { .exit = gk20a_pramin_exit, .data032_r = pram_data032_r, }, + .therm = { + .init_therm_setup_hw = gp10b_init_therm_setup_hw, + .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, + }, .mc = { .intr_enable = mc_gp10b_intr_enable, .intr_unit_config = mc_gp10b_intr_unit_config, @@ -385,6 +389,7 @@ int gp10b_init_hal(struct gk20a *g) gops->gr_ctx = gp10b_ops.gr_ctx; gops->fecs_trace = gp10b_ops.fecs_trace; gops->pramin = gp10b_ops.pramin; + gops->therm = gp10b_ops.therm; gops->mc = gp10b_ops.mc; gops->debug = gp10b_ops.debug; gops->dbg_session_ops = gp10b_ops.dbg_session_ops; @@ -448,7 +453,6 @@ int gp10b_init_hal(struct gk20a *g) gp10b_init_mm(gops); gp10b_init_pmu_ops(g); gp10b_init_regops(gops); - gp10b_init_therm_ops(gops); g->name = "gp10b"; -- cgit v1.2.2