summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/dc.c
diff options
context:
space:
mode:
authorMursalin Akon <makon@nvidia.com>2011-09-15 11:09:18 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:52:32 -0800
commitc7ade8da9db92bbb436e953fb55ad32ae3f40b62 (patch)
tree809118ee620b6ec6c62e59869e057f44bbf26c42 /drivers/video/tegra/dc/dc.c
parent5c19b07d71b3435ae90274e14a6a391d53c4cb99 (diff)
driver: video: terga: dc: fix switch class dependencies
Mark the dependencies of dc driver on switch class explicit, using proper pre-processors. Bug 877239 Change-Id: Ie5931aaf4f279e6379b85a00a30bd3cb910614d0 Signed-off-by: Mursalin Akon <makon@nvidia.com> Reviewed-on: http://git-master/r/55774 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R229bab237a55cacd22f5071eaca1a60503fdbb0d
Diffstat (limited to 'drivers/video/tegra/dc/dc.c')
-rw-r--r--drivers/video/tegra/dc/dc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 9b3f3a3..fbdf82d 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -33,9 +33,12 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/backlight.h>
-#include <linux/switch.h>
#include <video/tegrafb.h>
#include <drm/drm_fixed.h>
+#ifdef CONFIG_SWITCH
+#include <linux/switch.h>
+#endif
+
#include <mach/clk.h>
#include <mach/dc.h>
@@ -1656,8 +1659,10 @@ static int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode
tegra_dc_writel(dc, PIXEL_CLK_DIVIDER_PCD1 | SHIFT_CLK_DIVIDER(div),
DC_DISP_DISP_CLOCK_CONTROL);
+#ifdef CONFIG_SWITCH
switch_set_state(&dc->modeset_switch,
(mode->h_active << 16) | mode->v_active);
+#endif
dc->pixel_clk = dc->mode.pclk;
@@ -2558,7 +2563,9 @@ void tegra_dc_disable(struct tegra_dc *dc)
_tegra_dc_disable(dc);
}
+#ifdef CONFIG_SWITCH
switch_set_state(&dc->modeset_switch, 0);
+#endif
mutex_unlock(&dc->lock);
}
@@ -2609,6 +2616,7 @@ unlock:
}
#endif
+#ifdef CONFIG_SWITCH
static ssize_t switch_modeset_print_mode(struct switch_dev *sdev, char *buf)
{
struct tegra_dc *dc =
@@ -2619,6 +2627,7 @@ static ssize_t switch_modeset_print_mode(struct switch_dev *sdev, char *buf)
return sprintf(buf, "%dx%d\n", dc->mode.h_active, dc->mode.v_active);
}
+#endif
static int tegra_dc_probe(struct nvhost_device *ndev)
{
@@ -2734,10 +2743,12 @@ static int tegra_dc_probe(struct nvhost_device *ndev)
nvhost_set_drvdata(ndev, dc);
+#ifdef CONFIG_SWITCH
dc->modeset_switch.name = dev_name(&ndev->dev);
dc->modeset_switch.state = 0;
dc->modeset_switch.print_state = switch_modeset_print_mode;
switch_dev_register(&dc->modeset_switch);
+#endif
if (dc->pdata->default_out)
tegra_dc_set_out(dc, dc->pdata->default_out);
@@ -2851,7 +2862,9 @@ static int tegra_dc_remove(struct nvhost_device *ndev)
if (dc->enabled)
_tegra_dc_disable(dc);
+#ifdef CONFIG_SWITCH
switch_dev_unregister(&dc->modeset_switch);
+#endif
free_irq(dc->irq, dc);
clk_put(dc->emc_clk);
clk_put(dc->clk);