From ea530792c4bead6059fcb56541c7b57162ea0e0e Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Wed, 23 Jul 2014 23:42:35 -0700 Subject: gpu: nvgpu: Make clock operations static Made GK20A and GM20B clock operations static, since they are invoked only via HAL interfaces. Bug 1450787 Change-Id: Ia30218ad4244bd8790b5ef96d1963678d0ba39e1 Signed-off-by: Alex Frid Reviewed-on: http://git-master/r/441710 Reviewed-by: Bo Yan Tested-by: Bo Yan --- drivers/gpu/nvgpu/gk20a/clk_gk20a.c | 30 +++++++++++++++--------------- drivers/gpu/nvgpu/gk20a/clk_gk20a.h | 2 -- drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 16 ++++++++-------- drivers/gpu/nvgpu/gm20b/clk_gm20b.h | 3 --- 4 files changed, 23 insertions(+), 28 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c index 08e10901..517e8e49 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c @@ -624,7 +624,7 @@ static int gk20a_clk_register_export_ops(struct gk20a *g) return ret; } -int gk20a_init_clk_support(struct gk20a *g) +static int gk20a_init_clk_support(struct gk20a *g) { struct clk_gk20a *clk = &g->clk; u32 err; @@ -674,6 +674,20 @@ int gk20a_init_clk_support(struct gk20a *g) return err; } +static int gk20a_suspend_clk_support(struct gk20a *g) +{ + int ret; + + clk_disable(g->clk.tegra_clk); + + /* The prev call may not disable PLL if gbus is unbalanced - force it */ + mutex_lock(&g->clk.clk_mutex); + ret = clk_disable_gpcpll(g, 1); + g->clk.clk_hw_on = false; + mutex_unlock(&g->clk.clk_mutex); + return ret; +} + void gk20a_init_clk_ops(struct gpu_ops *gops) { gops->clk.init_clk_support = gk20a_init_clk_support; @@ -700,20 +714,6 @@ int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate) return clk_set_rate(g->clk.tegra_clk, rate); } -int gk20a_suspend_clk_support(struct gk20a *g) -{ - int ret; - - clk_disable(g->clk.tegra_clk); - - /* The prev call may not disable PLL if gbus is unbalanced - force it */ - mutex_lock(&g->clk.clk_mutex); - ret = clk_disable_gpcpll(g, 1); - g->clk.clk_hw_on = false; - mutex_unlock(&g->clk.clk_mutex); - return ret; -} - #ifdef CONFIG_DEBUG_FS static int rate_get(void *data, u64 *val) diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h index 4226a375..debd6fbc 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h @@ -60,8 +60,6 @@ struct clk_gk20a { }; /* APIs used for separate HAL */ -int gk20a_init_clk_support(struct gk20a *g); -int gk20a_suspend_clk_support(struct gk20a *g); struct clk *gk20a_clk_get(struct gk20a *g); /* APIs used for both GK20A and GM20B */ diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index e13c7a51..f22d4c10 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c @@ -623,7 +623,7 @@ static int gm20b_clk_register_export_ops(struct gk20a *g) return ret; } -int gm20b_init_clk_support(struct gk20a *g) +static int gm20b_init_clk_support(struct gk20a *g) { struct clk_gk20a *clk = &g->clk; u32 err; @@ -673,13 +673,7 @@ int gm20b_init_clk_support(struct gk20a *g) return err; } -void gm20b_init_clk_ops(struct gpu_ops *gops) -{ - gops->clk.init_clk_support = gm20b_init_clk_support; - gops->clk.suspend_clk_support = gm20b_suspend_clk_support; -} - -int gm20b_suspend_clk_support(struct gk20a *g) +static int gm20b_suspend_clk_support(struct gk20a *g) { int ret; @@ -693,6 +687,12 @@ int gm20b_suspend_clk_support(struct gk20a *g) return ret; } +void gm20b_init_clk_ops(struct gpu_ops *gops) +{ + gops->clk.init_clk_support = gm20b_init_clk_support; + gops->clk.suspend_clk_support = gm20b_suspend_clk_support; +} + #ifdef CONFIG_DEBUG_FS static int rate_get(void *data, u64 *val) diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.h b/drivers/gpu/nvgpu/gm20b/clk_gm20b.h index 8615a4c1..cac5708c 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.h @@ -21,9 +21,6 @@ #include -/* APIs used for separate HAL */ void gm20b_init_clk_ops(struct gpu_ops *gops); -int gm20b_init_clk_support(struct gk20a *g); -int gm20b_suspend_clk_support(struct gk20a *g); #endif /* _NVHOST_CLK_GM20B_H_ */ -- cgit v1.2.2