[PATCH 05/10] video: simple-panel: Add support for device tree provided nodes

Sascha Hauer s.hauer at pengutronix.de
Wed Sep 23 04:47:26 PDT 2015


This adds support for display timings provided from device tree.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/video/simple-panel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/video/simple-panel.c b/drivers/video/simple-panel.c
index 4775509..be39ff0 100644
--- a/drivers/video/simple-panel.c
+++ b/drivers/video/simple-panel.c
@@ -87,6 +87,7 @@ static int simple_panel_disable(struct simple_panel *panel)
 
 static int simple_panel_get_modes(struct simple_panel *panel, struct display_timings *timings)
 {
+	struct display_timings *modes;
 	int ret;
 
 	if (panel->ddc_node && IS_ENABLED(CONFIG_DRIVER_VIDEO_EDID) &&
@@ -111,6 +112,13 @@ static int simple_panel_get_modes(struct simple_panel *panel, struct display_tim
 		}
 	}
 
+	modes = of_get_display_timings(panel->dev->device_node);
+	if (modes) {
+		timings->modes = modes->modes;
+		timings->num_modes = modes->num_modes;
+		return 0;
+	}
+
 	dev_err(panel->dev, "No modes found\n");
 
 	return -ENOENT;
-- 
2.5.1




More information about the barebox mailing list