From 458981c3886133667e020900f53538f1fbc3ea1d Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 28 Nov 2011 23:19:59 +0100 Subject: fbdev: sh_mobile_lcdc: Return display connection state in display_on Return true if the display is connected and false otherwise. Set the fb info state to FBINFO_STATE_SUSPENDED in the sh_mobile_lcdc driver when the display is not connected. Signed-off-by: Laurent Pinchart --- drivers/video/sh_mobile_hdmi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/video/sh_mobile_hdmi.c') diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index c22e123ec40..1464abf81a4 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c @@ -1004,9 +1004,9 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity) { struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity); struct sh_mobile_lcdc_chan *ch = entity->lcdc; - struct fb_info *info = ch->info; - dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state); + dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, + hdmi->hp_state); /* * hp_state can be set to @@ -1021,12 +1021,13 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity) dev_dbg(hdmi->dev, "HDMI running\n"); break; case HDMI_HOTPLUG_DISCONNECTED: - info->state = FBINFO_STATE_SUSPENDED; default: hdmi->var = ch->display_var; } - return 0; + return hdmi->hp_state == HDMI_HOTPLUG_DISCONNECTED + ? SH_MOBILE_LCDC_DISPLAY_DISCONNECTED + : SH_MOBILE_LCDC_DISPLAY_CONNECTED; } static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity) -- cgit v1.2.3-18-g5258