From 304c30ac23aa0181e5709d2e38bbfe1997eb25c1 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 29 Apr 2014 12:50:00 +0200 Subject: arm: tegra: dc: disable dc when framebuffer off detected Don't initialize the whole display controller (dc) when framebuffer mode is set to off. This avoids creation of the /dev/tegra_dc_x device. The tegra X driver requires for each tegra_dc_x device an framebuffer device with the same id. This patch avoids creation of both, which makes the tegra X driver load correctly. Note: Turning off tegrafb0 still leads to kernel crash due to hard coded device enumeration. --- drivers/video/tegra/dc/dc.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index d4c3f8bc9a49..d8e731999b88 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -1703,9 +1703,18 @@ static int tegra_dc_probe(struct nvhost_device *ndev, struct resource *fb_mem = NULL; int ret = 0; void __iomem *base; + char *option = NULL; + char driver[10]; int irq; int i; + /* try to use kernel cmd line specified mode */ + sprintf(driver, "tegrafb%d", ndev->id); + fb_get_options(driver, &option); + + if (option != NULL && !strcmp(option, "off")) + return -ENOENT; + if (!ndev->dev.platform_data) { dev_err(&ndev->dev, "no platform data\n"); return -ENOENT; -- cgit v1.2.3