{
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
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)
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 */
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);