diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/clk_gk20a.c | 30 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/clk_gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 16 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.h | 3 |
4 files changed, 23 insertions, 28 deletions
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) | |||
624 | return ret; | 624 | return ret; |
625 | } | 625 | } |
626 | 626 | ||
627 | int gk20a_init_clk_support(struct gk20a *g) | 627 | static int gk20a_init_clk_support(struct gk20a *g) |
628 | { | 628 | { |
629 | struct clk_gk20a *clk = &g->clk; | 629 | struct clk_gk20a *clk = &g->clk; |
630 | u32 err; | 630 | u32 err; |
@@ -674,6 +674,20 @@ int gk20a_init_clk_support(struct gk20a *g) | |||
674 | return err; | 674 | return err; |
675 | } | 675 | } |
676 | 676 | ||
677 | static int gk20a_suspend_clk_support(struct gk20a *g) | ||
678 | { | ||
679 | int ret; | ||
680 | |||
681 | clk_disable(g->clk.tegra_clk); | ||
682 | |||
683 | /* The prev call may not disable PLL if gbus is unbalanced - force it */ | ||
684 | mutex_lock(&g->clk.clk_mutex); | ||
685 | ret = clk_disable_gpcpll(g, 1); | ||
686 | g->clk.clk_hw_on = false; | ||
687 | mutex_unlock(&g->clk.clk_mutex); | ||
688 | return ret; | ||
689 | } | ||
690 | |||
677 | void gk20a_init_clk_ops(struct gpu_ops *gops) | 691 | void gk20a_init_clk_ops(struct gpu_ops *gops) |
678 | { | 692 | { |
679 | gops->clk.init_clk_support = gk20a_init_clk_support; | 693 | gops->clk.init_clk_support = gk20a_init_clk_support; |
@@ -700,20 +714,6 @@ int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate) | |||
700 | return clk_set_rate(g->clk.tegra_clk, rate); | 714 | return clk_set_rate(g->clk.tegra_clk, rate); |
701 | } | 715 | } |
702 | 716 | ||
703 | int gk20a_suspend_clk_support(struct gk20a *g) | ||
704 | { | ||
705 | int ret; | ||
706 | |||
707 | clk_disable(g->clk.tegra_clk); | ||
708 | |||
709 | /* The prev call may not disable PLL if gbus is unbalanced - force it */ | ||
710 | mutex_lock(&g->clk.clk_mutex); | ||
711 | ret = clk_disable_gpcpll(g, 1); | ||
712 | g->clk.clk_hw_on = false; | ||
713 | mutex_unlock(&g->clk.clk_mutex); | ||
714 | return ret; | ||
715 | } | ||
716 | |||
717 | #ifdef CONFIG_DEBUG_FS | 717 | #ifdef CONFIG_DEBUG_FS |
718 | 718 | ||
719 | static int rate_get(void *data, u64 *val) | 719 | 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 { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /* APIs used for separate HAL */ | 62 | /* APIs used for separate HAL */ |
63 | int gk20a_init_clk_support(struct gk20a *g); | ||
64 | int gk20a_suspend_clk_support(struct gk20a *g); | ||
65 | struct clk *gk20a_clk_get(struct gk20a *g); | 63 | struct clk *gk20a_clk_get(struct gk20a *g); |
66 | 64 | ||
67 | /* APIs used for both GK20A and GM20B */ | 65 | /* 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) | |||
623 | return ret; | 623 | return ret; |
624 | } | 624 | } |
625 | 625 | ||
626 | int gm20b_init_clk_support(struct gk20a *g) | 626 | static int gm20b_init_clk_support(struct gk20a *g) |
627 | { | 627 | { |
628 | struct clk_gk20a *clk = &g->clk; | 628 | struct clk_gk20a *clk = &g->clk; |
629 | u32 err; | 629 | u32 err; |
@@ -673,13 +673,7 @@ int gm20b_init_clk_support(struct gk20a *g) | |||
673 | return err; | 673 | return err; |
674 | } | 674 | } |
675 | 675 | ||
676 | void gm20b_init_clk_ops(struct gpu_ops *gops) | 676 | static int gm20b_suspend_clk_support(struct gk20a *g) |
677 | { | ||
678 | gops->clk.init_clk_support = gm20b_init_clk_support; | ||
679 | gops->clk.suspend_clk_support = gm20b_suspend_clk_support; | ||
680 | } | ||
681 | |||
682 | int gm20b_suspend_clk_support(struct gk20a *g) | ||
683 | { | 677 | { |
684 | int ret; | 678 | int ret; |
685 | 679 | ||
@@ -693,6 +687,12 @@ int gm20b_suspend_clk_support(struct gk20a *g) | |||
693 | return ret; | 687 | return ret; |
694 | } | 688 | } |
695 | 689 | ||
690 | void gm20b_init_clk_ops(struct gpu_ops *gops) | ||
691 | { | ||
692 | gops->clk.init_clk_support = gm20b_init_clk_support; | ||
693 | gops->clk.suspend_clk_support = gm20b_suspend_clk_support; | ||
694 | } | ||
695 | |||
696 | #ifdef CONFIG_DEBUG_FS | 696 | #ifdef CONFIG_DEBUG_FS |
697 | 697 | ||
698 | static int rate_get(void *data, u64 *val) | 698 | 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 @@ | |||
21 | 21 | ||
22 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
23 | 23 | ||
24 | /* APIs used for separate HAL */ | ||
25 | void gm20b_init_clk_ops(struct gpu_ops *gops); | 24 | void gm20b_init_clk_ops(struct gpu_ops *gops); |
26 | int gm20b_init_clk_support(struct gk20a *g); | ||
27 | int gm20b_suspend_clk_support(struct gk20a *g); | ||
28 | 25 | ||
29 | #endif /* _NVHOST_CLK_GM20B_H_ */ | 26 | #endif /* _NVHOST_CLK_GM20B_H_ */ |