drm/bridge: analogix_dp: add missing calls to drm_panel_{prepare,unprepare}

If the enable-gpios property of a simple panel in device tree is set,
the GPIO is not toggled on/off because of missing calls to
drm_panel_prepare and drm_panel_unprepare.

Change-Id: I0a191c8bdd05ef8c2d3d41259937cb5ad0b29f08
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
This commit is contained in:
Wyon Bi
2018-12-06 11:20:54 +08:00
committed by Tao Huang
parent 31bc0dca0d
commit 8a1a974a86

View File

@@ -811,12 +811,6 @@ static void analogix_dp_commit(struct analogix_dp_device *dp)
struct video_info *video = &dp->video_info;
int ret;
/* Keep the panel disabled while we configure video */
if (dp->plat_data->panel) {
if (drm_panel_disable(dp->plat_data->panel))
DRM_ERROR("failed to disable the panel\n");
}
ret = analogix_dp_set_link_train(dp, dp->video_info.max_lane_count,
dp->video_info.max_link_rate);
if (ret) {
@@ -837,12 +831,6 @@ static void analogix_dp_commit(struct analogix_dp_device *dp)
ret = analogix_dp_config_video(dp);
if (ret)
dev_err(dp->dev, "unable to config video\n");
/* Safe to enable the panel now */
if (dp->plat_data->panel) {
if (drm_panel_enable(dp->plat_data->panel))
DRM_ERROR("failed to enable the panel\n");
}
}
static int analogix_dp_get_modes(struct drm_connector *connector)
@@ -997,6 +985,9 @@ static void analogix_dp_bridge_enable(struct drm_bridge *bridge)
if (dp->dpms_mode == DRM_MODE_DPMS_ON)
return;
if (dp->plat_data->panel)
drm_panel_prepare(dp->plat_data->panel);
pm_runtime_get_sync(dp->dev);
if (dp->plat_data->power_on)
@@ -1007,6 +998,9 @@ static void analogix_dp_bridge_enable(struct drm_bridge *bridge)
enable_irq(dp->irq);
analogix_dp_commit(dp);
if (dp->plat_data->panel)
drm_panel_enable(dp->plat_data->panel);
dp->dpms_mode = DRM_MODE_DPMS_ON;
}
@@ -1017,12 +1011,8 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->dpms_mode != DRM_MODE_DPMS_ON)
return;
if (dp->plat_data->panel) {
if (drm_panel_disable(dp->plat_data->panel)) {
DRM_ERROR("failed to disable the panel\n");
return;
}
}
if (dp->plat_data->panel)
drm_panel_disable(dp->plat_data->panel);
disable_irq_nosync(dp->irq);
phy_power_off(dp->phy);
@@ -1032,6 +1022,9 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
pm_runtime_put_sync(dp->dev);
if (dp->plat_data->panel)
drm_panel_unprepare(dp->plat_data->panel);
dp->dpms_mode = DRM_MODE_DPMS_OFF;
}
@@ -1282,13 +1275,6 @@ analogix_dp_bind(struct device *dev, struct drm_device *drm_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 ERR_PTR(-EBUSY);
}
}
if (dp->hpd_gpio) {
ret = devm_request_threaded_irq(dev, gpiod_to_irq(dp->hpd_gpio),
NULL,
@@ -1352,8 +1338,6 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)
dp->encoder->funcs->destroy(dp->encoder);
if (dp->plat_data->panel) {
if (drm_panel_unprepare(dp->plat_data->panel))
DRM_ERROR("failed to turnoff the panel\n");
if (drm_panel_detach(dp->plat_data->panel))
DRM_ERROR("failed to detach the panel\n");
}
@@ -1370,11 +1354,6 @@ int analogix_dp_suspend(struct analogix_dp_device *dp)
{
clk_disable_unprepare(dp->clock);
if (dp->plat_data->panel) {
if (drm_panel_unprepare(dp->plat_data->panel))
DRM_ERROR("failed to turnoff the panel\n");
}
return 0;
}
EXPORT_SYMBOL_GPL(analogix_dp_suspend);
@@ -1389,13 +1368,6 @@ int analogix_dp_resume(struct analogix_dp_device *dp)
return ret;
}
if (dp->plat_data->panel) {
if (drm_panel_prepare(dp->plat_data->panel)) {
DRM_ERROR("failed to setup the panel\n");
return -EBUSY;
}
}
return 0;
}
EXPORT_SYMBOL_GPL(analogix_dp_resume);