From 11e29991acd25baef5b786605e136b5e71737b8e Mon Sep 17 00:00:00 2001 From: Sunny He Date: Thu, 29 Jun 2017 14:24:29 -0700 Subject: gpu: nvgpu: Reorg clk HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the clk and clk_arb 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: I553353df836b187b8eac61e16b63080b570c96b8 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1511076 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp106/clk_arb_gp106.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106/clk_arb_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c b/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c index 4a907521..5f9c251f 100644 --- a/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c @@ -16,13 +16,13 @@ #include "clk/clk_arb.h" #include "clk_arb_gp106.h" -static u32 gp106_get_arbiter_clk_domains(struct gk20a *g) +u32 gp106_get_arbiter_clk_domains(struct gk20a *g) { (void)g; return (CTRL_CLK_DOMAIN_MCLK|CTRL_CLK_DOMAIN_GPC2CLK); } -static int gp106_get_arbiter_clk_range(struct gk20a *g, u32 api_domain, +int gp106_get_arbiter_clk_range(struct gk20a *g, u32 api_domain, u16 *min_mhz, u16 *max_mhz) { enum nv_pmu_clk_clkwhich clkwhich; @@ -68,7 +68,7 @@ static int gp106_get_arbiter_clk_range(struct gk20a *g, u32 api_domain, return 0; } -static int gp106_get_arbiter_clk_default(struct gk20a *g, u32 api_domain, +int gp106_get_arbiter_clk_default(struct gk20a *g, u32 api_domain, u16 *default_mhz) { enum nv_pmu_clk_clkwhich clkwhich; @@ -96,11 +96,3 @@ static int gp106_get_arbiter_clk_default(struct gk20a *g, u32 api_domain, return 0; } - -void gp106_init_clk_arb_ops(struct gpu_ops *gops) -{ - gops->clk_arb.get_arbiter_clk_domains = gp106_get_arbiter_clk_domains; - gops->clk_arb.get_arbiter_clk_range = gp106_get_arbiter_clk_range; - gops->clk_arb.get_arbiter_clk_default = gp106_get_arbiter_clk_default; - gops->clk_arb.get_current_pstate = nvgpu_clk_arb_get_current_pstate; -} -- cgit v1.2.2