From fd21f1db102535853258a0e1a43c00d47daa26ee Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Thu, 5 May 2011 03:07:37 -0300 Subject: OMAP: DSS2: Avoid enabling panel if none is around Signed-off-by: Ricardo Salveti de Araujo --- drivers/video/omap2/displays/panel-generic-dpi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c index 54f1884ff5b..fdeeda158c8 100644 --- a/drivers/video/omap2/displays/panel-generic-dpi.c +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -192,6 +192,9 @@ struct panel_drv_data { struct panel_config *panel_config; }; +static bool generic_dpi_panel_is_detected(struct omap_dss_device *dssdev, + bool force); + static inline struct panel_generic_dpi_data *get_panel_data(const struct omap_dss_device *dssdev) { @@ -302,6 +305,13 @@ static int generic_dpi_panel_enable(struct omap_dss_device *dssdev) { int r = 0; + /* Avoid enabling the panel if there is none around */ + if (!generic_dpi_panel_is_detected(dssdev, false)) { + printk(KERN_ERR "Not enabling generic panel as no " + "connector is detected\n"); + return 1; + } + r = generic_dpi_panel_power_on(dssdev); if (r) return r; -- cgit v1.2.3