Commit 2b77a291 authored by Yakir Yang's avatar Yakir Yang

drm: bridge: analogix/dp: move hpd detect to connector detect function

This change just make a little clean to make code more like
drm core expect, move hdp detect code from bridge->enable(),
and place them into connector->detect().

Note: Gustavo Padovan try to remove the controller and phy
power on function in bind time at bellow commit:
	drm/exynos: do not start enabling DP at bind() phase

But for now the connector status don't hardcode to connected,
need to operate dp phy in .detect function, so we need to revert
parts if Gustavo Padovan's changes, add phy poweron
function in bind time.
Tested-by: default avatarCaesar Wang <wxt@rock-chips.com>
Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarYakir Yang <ykk@rock-chips.com>
parent 5cff007c
...@@ -904,12 +904,6 @@ static void analogix_dp_commit(struct analogix_dp_device *dp) ...@@ -904,12 +904,6 @@ static void analogix_dp_commit(struct analogix_dp_device *dp)
DRM_ERROR("failed to disable the panel\n"); DRM_ERROR("failed to disable the panel\n");
} }
ret = analogix_dp_detect_hpd(dp);
if (ret) {
/* Cable has been disconnected, we're done */
return;
}
ret = analogix_dp_handle_edid(dp); ret = analogix_dp_handle_edid(dp);
if (ret) { if (ret) {
dev_err(dp->dev, "unable to handle edid\n"); dev_err(dp->dev, "unable to handle edid\n");
...@@ -972,6 +966,11 @@ static const struct drm_connector_helper_funcs analogix_dp_connector_helper_func ...@@ -972,6 +966,11 @@ static const struct drm_connector_helper_funcs analogix_dp_connector_helper_func
enum drm_connector_status enum drm_connector_status
analogix_dp_detect(struct drm_connector *connector, bool force) analogix_dp_detect(struct drm_connector *connector, bool force)
{ {
struct analogix_dp_device *dp = to_dp(connector);
if (analogix_dp_detect_hpd(dp))
return connector_status_disconnected;
return connector_status_connected; return connector_status_connected;
} }
...@@ -1051,13 +1050,6 @@ static void analogix_dp_bridge_enable(struct drm_bridge *bridge) ...@@ -1051,13 +1050,6 @@ static void analogix_dp_bridge_enable(struct drm_bridge *bridge)
pm_runtime_get_sync(dp->dev); pm_runtime_get_sync(dp->dev);
if (dp->plat_data->panel) {
if (drm_panel_prepare(dp->plat_data->panel)) {
DRM_ERROR("failed to setup the panel\n");
return;
}
}
if (dp->plat_data->power_on) if (dp->plat_data->power_on)
dp->plat_data->power_on(dp->plat_data); dp->plat_data->power_on(dp->plat_data);
...@@ -1090,11 +1082,6 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) ...@@ -1090,11 +1082,6 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->plat_data->power_off) if (dp->plat_data->power_off)
dp->plat_data->power_off(dp->plat_data); dp->plat_data->power_off(dp->plat_data);
if (dp->plat_data->panel) {
if (drm_panel_unprepare(dp->plat_data->panel))
DRM_ERROR("failed to turnoff the panel\n");
}
pm_runtime_put_sync(dp->dev); pm_runtime_put_sync(dp->dev);
dp->dpms_mode = DRM_MODE_DPMS_OFF; dp->dpms_mode = DRM_MODE_DPMS_OFF;
...@@ -1352,6 +1339,15 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, ...@@ -1352,6 +1339,15 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
pm_runtime_enable(dev); pm_runtime_enable(dev);
phy_power_on(dp->phy);
if (dp->plat_data->panel) {
if (drm_panel_prepare(dp->plat_data->panel)) {
DRM_ERROR("failed to setup the panel\n");
return -EBUSY;
}
}
ret = devm_request_irq(&pdev->dev, dp->irq, analogix_dp_irq_handler, ret = devm_request_irq(&pdev->dev, dp->irq, analogix_dp_irq_handler,
irq_flags, "analogix-dp", dp); irq_flags, "analogix-dp", dp);
if (ret) { if (ret) {
...@@ -1385,6 +1381,12 @@ void analogix_dp_unbind(struct device *dev, struct device *master, ...@@ -1385,6 +1381,12 @@ void analogix_dp_unbind(struct device *dev, struct device *master,
struct analogix_dp_device *dp = dev_get_drvdata(dev); struct analogix_dp_device *dp = dev_get_drvdata(dev);
analogix_dp_bridge_disable(dp->bridge); analogix_dp_bridge_disable(dp->bridge);
if (dp->plat_data->panel) {
if (drm_panel_unprepare(dp->plat_data->panel))
DRM_ERROR("failed to turnoff the panel\n");
}
pm_runtime_disable(dev); pm_runtime_disable(dev);
} }
EXPORT_SYMBOL_GPL(analogix_dp_unbind); EXPORT_SYMBOL_GPL(analogix_dp_unbind);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment