summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2016-04-11 18:07:55 -0700
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2016-06-29 16:49:08 +0200
commit5d491c1d43f00ddf9c9414c283a96b71fff23c22 (patch)
tree182b9ce487d310f741d39f49b04dac0524a6be4c
parent74e367820da05b63c98460a9c3e91abab6d60b94 (diff)
video: tegra: fix build with enabled tegra lvds driver
This fixes the following build time error in case CONFIG_TEGRA_LVDS is enabled: drivers/video/tegra/dc/sor.h: In function 'tegra_sor_clk_enable': drivers/video/tegra/dc/sor.h:180:2: error: implicit declaration of function 'clk_prepare_enable' [-Werror=implicit-function-declaration] clk_prepare_enable(sor->sor_clk); ^ drivers/video/tegra/dc/sor.h: In function 'tegra_sor_clk_disable': drivers/video/tegra/dc/sor.h:185:2: error: implicit declaration of function 'clk_disable_unprepare' [-Werror=implicit-function-declaration] clk_disable_unprepare(sor->sor_clk); ^ In file included from drivers/video/tegra/dc/dc_priv_defs.h:26:0, from drivers/video/tegra/dc/dc_priv.h:23, from drivers/video/tegra/dc/lvds.c:23: include/linux/clk.h: At top level: include/linux/clk.h:330:19: error: static declaration of 'clk_prepare_enable' follows non-static declaration static inline int clk_prepare_enable(struct clk *clk) ^ In file included from drivers/video/tegra/dc/lvds.h:20:0, from drivers/video/tegra/dc/lvds.c:22: drivers/video/tegra/dc/sor.h:180:2: note: previous implicit declaration of 'clk_prepare_enable' was here clk_prepare_enable(sor->sor_clk); ^ In file included from drivers/video/tegra/dc/dc_priv_defs.h:26:0, from drivers/video/tegra/dc/dc_priv.h:23, from drivers/video/tegra/dc/lvds.c:23: include/linux/clk.h:345:20: error: conflicting types for 'clk_disable_unprepare' [-Werror] static inline void clk_disable_unprepare(struct clk *clk) ^ include/linux/clk.h:345:20: error: static declaration of 'clk_disable_unprepare' follows non-static declaration In file included from drivers/video/tegra/dc/lvds.h:20:0, from drivers/video/tegra/dc/lvds.c:22: drivers/video/tegra/dc/sor.h:185:2: note: previous implicit declaration of 'clk_disable_unprepare' was here clk_disable_unprepare(sor->sor_clk); ^ Final patch taken from Manoj Gupta's post on NVIDIA's public embedded systems forum: https://devtalk.nvidia.com/default/topic/822612/jetson-tk1/-issue-lvds-panel-enabled-effect-hdmi-out-image-pull-down-menu-items/post/4663817/#4663817 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Dominik Sliwa <dominik.sliwa@toradex.com>
-rw-r--r--drivers/video/tegra/dc/lvds.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/video/tegra/dc/lvds.c b/drivers/video/tegra/dc/lvds.c
index 36842cf7b4fd..e204806f8fe4 100644
--- a/drivers/video/tegra/dc/lvds.c
+++ b/drivers/video/tegra/dc/lvds.c
@@ -18,6 +18,7 @@
#include <linux/kernel.h>
#include <mach/dc.h>
+#include <linux/clk.h>
#include "lvds.h"
#include "dc_priv.h"
@@ -67,6 +68,8 @@ static void tegra_dc_lvds_enable(struct tegra_dc *dc)
tegra_dc_io_start(dc);
+ tegra_sor_clk_enable(lvds->sor);
+
/* Power on panel */
tegra_sor_pad_cal_power(lvds->sor, true);
tegra_dc_sor_set_internal_panel(lvds->sor, true);
@@ -107,12 +110,16 @@ static long tegra_dc_lvds_setup_clk(struct tegra_dc *dc, struct clk *clk)
struct tegra_dc_lvds_data *lvds = tegra_dc_get_outdata(dc);
struct clk *parent_clk;
- tegra_sor_setup_clk(lvds->sor, clk, true);
+ parent_clk = clk_get_sys(NULL, dc->out->parent_clk ? : "pll_d_out0");
- parent_clk = clk_get_parent(clk);
if (clk_get_parent(lvds->sor->sor_clk) != parent_clk)
clk_set_parent(lvds->sor->sor_clk, parent_clk);
+ if (clk_get_parent(clk) != parent_clk)
+ clk_set_parent(clk, parent_clk);
+
+ tegra_sor_setup_clk(lvds->sor, clk, true);
+
return tegra_dc_pclk_round_rate(dc, lvds->sor->dc->mode.pclk);
}