summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorHoang Pham <hopham@nvidia.com>2014-07-21 18:21:56 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:33 -0400
commitf7642ca185356f9f5593dad475a710b965d9826b (patch)
tree8053f02e6f145d6870c5a0788ce5057a7d3cba1c /drivers/gpu/nvgpu/gk20a
parentb972f8d15eca74d91b932f16b09aacb893e110a8 (diff)
gpu: nvgpu: Fork GM20B clock from GK20A clock
Bug 1450787 Change-Id: Id7fb699d9129a272286d6bc93e0e95844440a628 Signed-off-by: Hoang Pham <hopham@nvidia.com> Reviewed-on: http://git-master/r/440536 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/clk_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/clk_gk20a.h8
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
4 files changed, 8 insertions, 6 deletions
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 @@
33 gk20a_dbg(gpu_dbg_clk, fmt, ##arg) 33 gk20a_dbg(gpu_dbg_clk, fmt, ##arg)
34 34
35/* from vbios PLL info table */ 35/* from vbios PLL info table */
36struct pll_parms gpc_pll_params = { 36static struct pll_parms gpc_pll_params = {
37 144000, 2064000, /* freq */ 37 144000, 2064000, /* freq */
38 1000000, 2064000, /* vco */ 38 1000000, 2064000, /* vco */
39 12000, 38000, /* u */ 39 12000, 38000, /* u */
@@ -677,6 +677,7 @@ int gk20a_init_clk_support(struct gk20a *g)
677void gk20a_init_clk_ops(struct gpu_ops *gops) 677void gk20a_init_clk_ops(struct gpu_ops *gops)
678{ 678{
679 gops->clk.init_clk_support = gk20a_init_clk_support; 679 gops->clk.init_clk_support = gk20a_init_clk_support;
680 gops->clk.suspend_clk_support = gk20a_suspend_clk_support;
680} 681}
681 682
682unsigned long gk20a_clk_get_rate(struct gk20a *g) 683unsigned 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 {
59 bool debugfs_set; 59 bool debugfs_set;
60}; 60};
61 61
62/* APIs used for separate HAL */
62int gk20a_init_clk_support(struct gk20a *g); 63int gk20a_init_clk_support(struct gk20a *g);
64int gk20a_suspend_clk_support(struct gk20a *g);
65struct clk *gk20a_clk_get(struct gk20a *g);
63 66
67/* APIs used for both GK20A and GM20B */
64unsigned long gk20a_clk_get_rate(struct gk20a *g); 68unsigned long gk20a_clk_get_rate(struct gk20a *g);
65int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate); 69int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate);
66int gk20a_suspend_clk_support(struct gk20a *g);
67struct clk *gk20a_clk_get(struct gk20a *g);
68long gk20a_clk_round_rate(struct gk20a *g, unsigned long rate); 70long gk20a_clk_round_rate(struct gk20a *g, unsigned long rate);
69 71
70extern struct pll_parms gpc_pll_params;
71
72#define KHZ 1000 72#define KHZ 1000
73#define MHZ 1000000 73#define MHZ 1000000
74 74
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)
810 ret |= gk20a_fifo_suspend(g); 810 ret |= gk20a_fifo_suspend(g);
811 811
812 /* Disable GPCPLL */ 812 /* Disable GPCPLL */
813 ret |= gk20a_suspend_clk_support(g); 813 ret |= g->ops.clk.suspend_clk_support(g);
814 814
815 g->power_on = false; 815 g->power_on = false;
816 816
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 {
232 } pmu; 232 } pmu;
233 struct { 233 struct {
234 int (*init_clk_support)(struct gk20a *g); 234 int (*init_clk_support)(struct gk20a *g);
235 int (*suspend_clk_support)(struct gk20a *g);
235 } clk; 236 } clk;
236}; 237};
237 238