From 54693cbdca5724b8946d0522a736e8a49fa14c0c Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 19 Apr 2016 16:19:30 -0600 Subject: video: tegra: refuse to bind to disabled dcs This prevents the following boot-time message on any board where only the first DC is in use, yet the DC's DT node is enabled: stdio_add_devices: Video device failed (ret=-22) (This happens on at least Harmony, Ventana, and likely any other Tegra20 board with display enabled other than Seaboard). The Tegra DC's DT node represents a display controller. It may itself drive an integrated RGB display output, or be used by some other display controller such as HDMI. For this reason the DC node itself is not enabled/disabled in DT; the DC itself is considered a shared resource, not the final (board-specific) display output. The node should instantiate a display output driver only if the rgb subnode is enabled. Other output drivers are free to use the DC if they are enabled and their DT node references the DC's DT node. Adapt the Tegra display drivers' bind() routine to only bind to the DC's DT node if the RGB subnode is enabled. Now that the display driver does the right thing, remove the workaround for this issue from Seaboard's DT file. Cc: Thierry Reding Signed-off-by: Stephen Warren Acked-by: Thierry Reding Reviewed-by: Simon Glass --- drivers/video/tegra.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/video/tegra.c') diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c index 7fd10e6af3..c01809e89e 100644 --- a/drivers/video/tegra.c +++ b/drivers/video/tegra.c @@ -620,6 +620,13 @@ static int tegra_lcd_ofdata_to_platdata(struct udevice *dev) static int tegra_lcd_bind(struct udevice *dev) { struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); + const void *blob = gd->fdt_blob; + int node = dev->of_offset; + int rgb; + + rgb = fdt_subnode_offset(blob, node, "rgb"); + if ((rgb < 0) || !fdtdec_get_is_enabled(blob, rgb)) + return -ENODEV; plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT * (1 << LCD_MAX_LOG2_BPP) / 8; -- cgit v1.2.1