From cc8e05c21533769d78f098149edb02e1f4394398 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 23 Oct 2014 15:13:08 +0300 Subject: 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 Reviewed-on: http://git-master/r/562475 --- drivers/gpu/nvgpu/gk20a/clk_gk20a.h | 7 +++++++ drivers/gpu/nvgpu/gk20a/gk20a.c | 3 ++- drivers/gpu/nvgpu/gk20a/gk20a_scale.h | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a') 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 { bool debugfs_set; }; +struct gpu_ops; +#ifdef CONFIG_TEGRA_CLK_FRAMEWORK +void gk20a_init_clk_ops(struct gpu_ops *gops); +#else +static inline void gk20a_init_clk_ops(struct gpu_ops *gops) {} +#endif + /* 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); 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) ret |= gk20a_fifo_suspend(g); /* Disable GPCPLL */ - ret |= g->ops.clk.suspend_clk_support(g); + if (g->ops.clk.suspend_clk_support) + ret |= g->ops.clk.suspend_clk_support(g); g->power_on = false; 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 { void gk20a_scale_init(struct platform_device *); void gk20a_scale_hw_init(struct platform_device *pdev); +#ifdef CONFIG_GK20A_DEVFREQ /* * call when performing submit to notify scaling mechanism that the module is * in use @@ -46,5 +47,11 @@ void gk20a_scale_notify_idle(struct platform_device *); void gk20a_scale_suspend(struct platform_device *); void gk20a_scale_resume(struct platform_device *); +#else +static inline void gk20a_scale_notify_busy(struct platform_device *pdev) {} +static inline void gk20a_scale_notify_idle(struct platform_device *pdev) {} +static inline void gk20a_scale_suspend(struct platform_device *pdev) {} +static inline void gk20a_scale_resume(struct platform_device *pdev) {} +#endif #endif -- cgit v1.2.2