From f7642ca185356f9f5593dad475a710b965d9826b Mon Sep 17 00:00:00 2001 From: Hoang Pham Date: Mon, 21 Jul 2014 15:21:56 -0700 Subject: gpu: nvgpu: Fork GM20B clock from GK20A clock Bug 1450787 Change-Id: Id7fb699d9129a272286d6bc93e0e95844440a628 Signed-off-by: Hoang Pham Reviewed-on: http://git-master/r/440536 Reviewed-by: Yu-Huan Hsu --- drivers/gpu/nvgpu/gk20a/clk_gk20a.c | 3 ++- drivers/gpu/nvgpu/gk20a/clk_gk20a.h | 8 ++++---- drivers/gpu/nvgpu/gk20a/gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c index 30f2b4ed..08e10901 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c @@ -33,7 +33,7 @@ gk20a_dbg(gpu_dbg_clk, fmt, ##arg) /* from vbios PLL info table */ -struct pll_parms gpc_pll_params = { +static struct pll_parms gpc_pll_params = { 144000, 2064000, /* freq */ 1000000, 2064000, /* vco */ 12000, 38000, /* u */ @@ -677,6 +677,7 @@ int gk20a_init_clk_support(struct gk20a *g) void gk20a_init_clk_ops(struct gpu_ops *gops) { gops->clk.init_clk_support = gk20a_init_clk_support; + gops->clk.suspend_clk_support = gk20a_suspend_clk_support; } unsigned long gk20a_clk_get_rate(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h index 950034a4..4226a375 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h @@ -59,16 +59,16 @@ struct clk_gk20a { bool debugfs_set; }; +/* 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 */ unsigned long gk20a_clk_get_rate(struct gk20a *g); int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate); -int gk20a_suspend_clk_support(struct gk20a *g); -struct clk *gk20a_clk_get(struct gk20a *g); long gk20a_clk_round_rate(struct gk20a *g, unsigned long rate); -extern struct pll_parms gpc_pll_params; - #define KHZ 1000 #define MHZ 1000000 diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index fb4e0886..355b2039 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -810,7 +810,7 @@ static int gk20a_pm_prepare_poweroff(struct device *dev) ret |= gk20a_fifo_suspend(g); /* Disable GPCPLL */ - ret |= gk20a_suspend_clk_support(g); + ret |= g->ops.clk.suspend_clk_support(g); g->power_on = false; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 57cc338c..aeed5838 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -232,6 +232,7 @@ struct gpu_ops { } pmu; struct { int (*init_clk_support)(struct gk20a *g); + int (*suspend_clk_support)(struct gk20a *g); } clk; }; -- cgit v1.2.2