summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-10-23 08:13:08 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:50 -0400
commitcc8e05c21533769d78f098149edb02e1f4394398 (patch)
tree18a0d39ef5c7c20e61328cc3eaf279178581b043 /drivers/gpu/nvgpu/gk20a
parentfcf4a107996af1be341952447b0237338c0b76ea (diff)
gpu: nvgpu: Fix build without Tegra clk framework
Do not build clock code if TEGRA_CLK_FRAMEWORK is not defined. Also make GK20A_DEVFREQ depend on TEGRA_CLK_FRAMEWORK, and build scaling governor only if GK20A_DEVFREQ is enabled. Bug 1567274 Change-Id: I6ea1462e7a110fb46c9d66ceda71167cff19699e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/562475
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/clk_gk20a.h7
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.h7
3 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h
index 255c1a7c..c766fc46 100644
--- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h
@@ -77,6 +77,13 @@ struct clk_gk20a {
77 bool debugfs_set; 77 bool debugfs_set;
78}; 78};
79 79
80struct gpu_ops;
81#ifdef CONFIG_TEGRA_CLK_FRAMEWORK
82void gk20a_init_clk_ops(struct gpu_ops *gops);
83#else
84static inline void gk20a_init_clk_ops(struct gpu_ops *gops) {}
85#endif
86
80/* APIs used for both GK20A and GM20B */ 87/* APIs used for both GK20A and GM20B */
81unsigned long gk20a_clk_get_rate(struct gk20a *g); 88unsigned long gk20a_clk_get_rate(struct gk20a *g);
82int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate); 89int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 5641818e..c91a316a 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -765,7 +765,8 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
765 ret |= gk20a_fifo_suspend(g); 765 ret |= gk20a_fifo_suspend(g);
766 766
767 /* Disable GPCPLL */ 767 /* Disable GPCPLL */
768 ret |= g->ops.clk.suspend_clk_support(g); 768 if (g->ops.clk.suspend_clk_support)
769 ret |= g->ops.clk.suspend_clk_support(g);
769 770
770 g->power_on = false; 771 g->power_on = false;
771 772
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.h b/drivers/gpu/nvgpu/gk20a/gk20a_scale.h
index 561ecaed..81c23b68 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.h
@@ -37,6 +37,7 @@ struct gk20a_scale_profile {
37void gk20a_scale_init(struct platform_device *); 37void gk20a_scale_init(struct platform_device *);
38void gk20a_scale_hw_init(struct platform_device *pdev); 38void gk20a_scale_hw_init(struct platform_device *pdev);
39 39
40#ifdef CONFIG_GK20A_DEVFREQ
40/* 41/*
41 * call when performing submit to notify scaling mechanism that the module is 42 * call when performing submit to notify scaling mechanism that the module is
42 * in use 43 * in use
@@ -46,5 +47,11 @@ void gk20a_scale_notify_idle(struct platform_device *);
46 47
47void gk20a_scale_suspend(struct platform_device *); 48void gk20a_scale_suspend(struct platform_device *);
48void gk20a_scale_resume(struct platform_device *); 49void gk20a_scale_resume(struct platform_device *);
50#else
51static inline void gk20a_scale_notify_busy(struct platform_device *pdev) {}
52static inline void gk20a_scale_notify_idle(struct platform_device *pdev) {}
53static inline void gk20a_scale_suspend(struct platform_device *pdev) {}
54static inline void gk20a_scale_resume(struct platform_device *pdev) {}
55#endif
49 56
50#endif 57#endif