]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
fbdev: sh_mobile_lcdc: Return display connection state in display_on
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 28 Nov 2011 22:19:59 +0000 (23:19 +0100)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 12 Mar 2012 21:40:52 +0000 (22:40 +0100)
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 <laurent.pinchart@ideasonboard.com>
drivers/video/sh_mipi_dsi.c
drivers/video/sh_mobile_hdmi.c
drivers/video/sh_mobile_lcdcfb.c
drivers/video/sh_mobile_lcdcfb.h

index 1ede247547f9c7a2b36d488e1025fbc0185e7991..5ff3742aeb0820fd9845b248bfc68085ef326807 100644 (file)
@@ -412,7 +412,7 @@ static int mipi_display_on(struct sh_mobile_lcdc_entity *entity)
 
        sh_mipi_dsi_enable(mipi, true);
 
-       return 0;
+       return SH_MOBILE_LCDC_DISPLAY_CONNECTED;
 
 mipi_display_on_fail1:
        pm_runtime_put_sync(&mipi->pdev->dev);
index c22e123ec401736481d23c62dc542f3f2360c9f2..1464abf81a407e1de836541ce607d86da6dee27b 100644 (file)
@@ -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)
index 03ee3826fb6222cd9fee619c37de61c91fcd2452..5a19ef3f215c6373791b7811f81995a965b2ce26 100644 (file)
@@ -338,8 +338,14 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
        struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg.panel_cfg;
 
        if (ch->tx_dev) {
-               if (ch->tx_dev->ops->display_on(ch->tx_dev) < 0)
+               int ret;
+
+               ret = ch->tx_dev->ops->display_on(ch->tx_dev);
+               if (ret < 0)
                        return;
+
+               if (ret == SH_MOBILE_LCDC_DISPLAY_DISCONNECTED)
+                       ch->info->state = FBINFO_STATE_SUSPENDED;
        }
 
        /* HDMI must be enabled before LCDC configuration */
index b2cb8e6d098c6d7de4a804f326619f9fc36ace3d..6fb956c8e603ddfed5611bcb154c7135d2e8a3c1 100644 (file)
@@ -21,6 +21,9 @@ struct sh_mobile_lcdc_entity;
 struct sh_mobile_lcdc_priv;
 struct sh_mobile_lcdc_chan;
 
+#define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED    0
+#define SH_MOBILE_LCDC_DISPLAY_CONNECTED       1
+
 struct sh_mobile_lcdc_entity_ops {
        /* Display */
        int (*display_on)(struct sh_mobile_lcdc_entity *entity);