summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-29 17:24:29 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-02 17:43:27 -0400
commit11e29991acd25baef5b786605e136b5e71737b8e (patch)
tree1fd738a07e172ef7cdc2882359424be246964ce3 /drivers/gpu/nvgpu/gm20b/clk_gm20b.c
parenta15e110a9b790f55a5c6e257cfbf7f7235f5a334 (diff)
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 <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1511076 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/clk_gm20b.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
index 8f770e2e..22501c64 100644
--- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
@@ -1389,7 +1389,7 @@ static int set_pll_freq(struct gk20a *g, int allow_slide)
1389 return err; 1389 return err;
1390} 1390}
1391 1391
1392static int gm20b_init_clk_support(struct gk20a *g) 1392int gm20b_init_clk_support(struct gk20a *g)
1393{ 1393{
1394 struct clk_gk20a *clk = &g->clk; 1394 struct clk_gk20a *clk = &g->clk;
1395 u32 err; 1395 u32 err;
@@ -1427,7 +1427,7 @@ static int gm20b_init_clk_support(struct gk20a *g)
1427 return err; 1427 return err;
1428} 1428}
1429 1429
1430static int gm20b_suspend_clk_support(struct gk20a *g) 1430int gm20b_suspend_clk_support(struct gk20a *g)
1431{ 1431{
1432 int ret = 0; 1432 int ret = 0;
1433 1433
@@ -1445,7 +1445,7 @@ static int gm20b_suspend_clk_support(struct gk20a *g)
1445 return ret; 1445 return ret;
1446} 1446}
1447 1447
1448static int gm20b_clk_get_voltage(struct clk_gk20a *clk, u64 *val) 1448int gm20b_clk_get_voltage(struct clk_gk20a *clk, u64 *val)
1449{ 1449{
1450 struct gk20a *g = clk->g; 1450 struct gk20a *g = clk->g;
1451 struct pll_parms *gpc_pll_params = gm20b_get_gpc_pll_parms(); 1451 struct pll_parms *gpc_pll_params = gm20b_get_gpc_pll_parms();
@@ -1472,7 +1472,7 @@ static int gm20b_clk_get_voltage(struct clk_gk20a *clk, u64 *val)
1472 return 0; 1472 return 0;
1473} 1473}
1474 1474
1475static int gm20b_clk_get_gpcclk_clock_counter(struct clk_gk20a *clk, u64 *val) 1475int gm20b_clk_get_gpcclk_clock_counter(struct clk_gk20a *clk, u64 *val)
1476{ 1476{
1477 struct gk20a *g = clk->g; 1477 struct gk20a *g = clk->g;
1478 u32 clk_slowdown, clk_slowdown_save; 1478 u32 clk_slowdown, clk_slowdown_save;
@@ -1593,16 +1593,3 @@ int gm20b_clk_get_pll_debug_data(struct gk20a *g,
1593 nvgpu_mutex_release(&g->clk.clk_mutex); 1593 nvgpu_mutex_release(&g->clk.clk_mutex);
1594 return 0; 1594 return 0;
1595} 1595}
1596
1597void gm20b_init_clk_ops(struct gpu_ops *gops)
1598{
1599 gops->clk.init_clk_support = gm20b_init_clk_support;
1600 gops->clk.suspend_clk_support = gm20b_suspend_clk_support;
1601#ifdef CONFIG_DEBUG_FS
1602 gops->clk.init_debugfs = gm20b_clk_init_debugfs;
1603#endif
1604 gops->clk.get_voltage = gm20b_clk_get_voltage;
1605 gops->clk.get_gpcclk_clock_counter = gm20b_clk_get_gpcclk_clock_counter;
1606 gops->clk.pll_reg_write = gm20b_clk_pll_reg_write;
1607 gops->clk.get_pll_debug_data = gm20b_clk_get_pll_debug_data;
1608}