summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index 3b9c444d..6bc4f3b0 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -43,13 +43,12 @@ static int clk_gp106_debugfs_init(struct gk20a *g);
43 43
44 44
45static u32 gp106_get_rate_cntr(struct gk20a *g, struct namemap_cfg *); 45static u32 gp106_get_rate_cntr(struct gk20a *g, struct namemap_cfg *);
46static u16 gp106_clk_get_rate(struct gk20a *g, u32 api_domain);
47static u32 gp106_crystal_clk_hz(struct gk20a *g) 46static u32 gp106_crystal_clk_hz(struct gk20a *g)
48{ 47{
49 return (XTAL4X_KHZ * 1000); 48 return (XTAL4X_KHZ * 1000);
50} 49}
51 50
52static u16 gp106_clk_get_rate(struct gk20a *g, u32 api_domain) 51static unsigned long gp106_clk_measure_freq(struct gk20a *g, u32 api_domain)
53{ 52{
54 struct clk_gk20a *clk = &g->clk; 53 struct clk_gk20a *clk = &g->clk;
55 u32 freq_khz; 54 u32 freq_khz;
@@ -69,8 +68,8 @@ static u16 gp106_clk_get_rate(struct gk20a *g, u32 api_domain)
69 freq_khz = c->is_counter ? c->scale * gp106_get_rate_cntr(g, c) : 68 freq_khz = c->is_counter ? c->scale * gp106_get_rate_cntr(g, c) :
70 0; /* TODO: PLL read */ 69 0; /* TODO: PLL read */
71 70
72 /* Convert to MHZ */ 71 /* Convert to HZ */
73 return (u16) (freq_khz/1000); 72 return freq_khz * 1000UL;
74} 73}
75 74
76static int gp106_init_clk_support(struct gk20a *g) { 75static int gp106_init_clk_support(struct gk20a *g) {
@@ -270,5 +269,5 @@ err_out:
270void gp106_init_clk_ops(struct gpu_ops *gops) { 269void gp106_init_clk_ops(struct gpu_ops *gops) {
271 gops->clk.init_clk_support = gp106_init_clk_support; 270 gops->clk.init_clk_support = gp106_init_clk_support;
272 gops->clk.get_crystal_clk_hz = gp106_crystal_clk_hz; 271 gops->clk.get_crystal_clk_hz = gp106_crystal_clk_hz;
273 gops->clk.get_rate = gp106_clk_get_rate; 272 gops->clk.measure_freq = gp106_clk_measure_freq;
274} 273}