struct omap_dss_device *src = dssdev->src;
bool connected;
- if (ddata->hpd_gpio)
- connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
- else
- connected = src->ops->detect(src);
+ connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
if (!connected && src->ops->hdmi.lost_hotplug)
src->ops->hdmi.lost_hotplug(src);
return connected;
dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->owner = THIS_MODULE;
dssdev->of_ports = BIT(0);
+ dssdev->ops_flags = ddata->hpd_gpio ? OMAP_DSS_DEVICE_OP_DETECT : 0;
omapdss_display_init(dssdev);
omapdss_device_register(dssdev);
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *src = dssdev->src;
- bool connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
+ bool connected;
+ connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
if (!connected && src->ops->hdmi.lost_hotplug)
src->ops->hdmi.lost_hotplug(src);
return connected;
dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->owner = THIS_MODULE;
dssdev->of_ports = BIT(1) | BIT(0);
+ dssdev->ops_flags = OMAP_DSS_DEVICE_OP_DETECT;
dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1);
if (IS_ERR(dssdev->next)) {
struct drm_connector *connector, bool force)
{
struct omap_connector *omap_connector = to_omap_connector(connector);
- struct omap_dss_device *dssdev = omap_connector->dssdev;
- enum drm_connector_status ret;
+ struct omap_dss_device *dssdev;
+ enum drm_connector_status status;
+
+ for (dssdev = omap_connector->dssdev; dssdev; dssdev = dssdev->src) {
+ if (dssdev->ops_flags & OMAP_DSS_DEVICE_OP_DETECT)
+ break;
+ }
- if (dssdev->ops->detect) {
+ if (dssdev) {
if (dssdev->ops->detect(dssdev))
- ret = connector_status_connected;
+ status = connector_status_connected;
else
- ret = connector_status_disconnected;
- } else if (dssdev->type == OMAP_DISPLAY_TYPE_DPI ||
- dssdev->type == OMAP_DISPLAY_TYPE_DBI ||
- dssdev->type == OMAP_DISPLAY_TYPE_SDI ||
- dssdev->type == OMAP_DISPLAY_TYPE_DSI) {
- ret = connector_status_connected;
+ status = connector_status_disconnected;
} else {
- ret = connector_status_unknown;
+ switch (omap_connector->dssdev->type) {
+ case OMAP_DISPLAY_TYPE_DPI:
+ case OMAP_DISPLAY_TYPE_DBI:
+ case OMAP_DISPLAY_TYPE_SDI:
+ case OMAP_DISPLAY_TYPE_DSI:
+ status = connector_status_connected;
+ break;
+ default:
+ status = connector_status_unknown;
+ break;
+ }
}
- VERB("%s: %d (force=%d)", omap_connector->dssdev->name, ret, force);
+ VERB("%s: %d (force=%d)", omap_connector->dssdev->name, status, force);
- return ret;
+ return status;
}
static void omap_connector_destroy(struct drm_connector *connector)