drm/bridge: analogix_dp: Add optional LCD panel self test

Many TCON devices include an embedded LCD panel self-test mode.
This mode is designed to help system integrators identify
the root cause of abnormal display operation, without the use of
complicated debug tools.

Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I19770c7488d43e2486c5fde5cc0a5b345e5be0eb
This commit is contained in:
Wyon Bi
2021-05-18 11:49:32 +08:00
committed by Tao Huang
parent 5d2f3f959e
commit f963ba7784
2 changed files with 9 additions and 15 deletions

View File

@@ -29,6 +29,8 @@ Optional properties for dp-controller:
-hpd-gpios: -hpd-gpios:
Hotplug detect GPIO. Hotplug detect GPIO.
Indicates which GPIO should be used for hotplug detection Indicates which GPIO should be used for hotplug detection
-panel-self-test:
Enable optional LCD Panel Self Test.
-port@[X]: SoC specific port nodes with endpoint definitions as defined -port@[X]: SoC specific port nodes with endpoint definitions as defined
in Documentation/devicetree/bindings/media/video-interfaces.txt, in Documentation/devicetree/bindings/media/video-interfaces.txt,
please refer to the SoC specific binding document: please refer to the SoC specific binding document:

View File

@@ -959,11 +959,9 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
struct video_info *video = &dp->video_info; struct video_info *video = &dp->video_info;
int ret; int ret;
/* Keep the panel disabled while we configure video */ if (device_property_read_bool(dp->dev, "panel-self-test"))
if (dp->plat_data->panel) { return drm_dp_dpcd_writeb(&dp->aux, DP_EDP_CONFIGURATION_SET,
if (drm_panel_disable(dp->plat_data->panel)) DP_PANEL_SELF_TEST_ENABLE);
DRM_ERROR("failed to disable the panel\n");
}
ret = analogix_dp_train_link(dp); ret = analogix_dp_train_link(dp);
if (ret) { if (ret) {
@@ -989,15 +987,6 @@ static int analogix_dp_commit(struct analogix_dp_device *dp)
return ret; return ret;
} }
/* Safe to enable the panel now */
if (dp->plat_data->panel) {
ret = drm_panel_enable(dp->plat_data->panel);
if (ret) {
DRM_ERROR("failed to enable the panel\n");
return ret;
}
}
/* Check whether panel supports fast training */ /* Check whether panel supports fast training */
ret = analogix_dp_fast_link_train_detection(dp); ret = analogix_dp_fast_link_train_detection(dp);
if (ret) if (ret)
@@ -1301,11 +1290,14 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
} }
ret = analogix_dp_commit(dp); ret = analogix_dp_commit(dp);
if (ret) { if (ret < 0) {
DRM_ERROR("dp commit error, ret = %d\n", ret); DRM_ERROR("dp commit error, ret = %d\n", ret);
goto out_dp_init; goto out_dp_init;
} }
if (dp->plat_data->panel)
drm_panel_enable(dp->plat_data->panel);
if (dp->plat_data->power_on_end) if (dp->plat_data->power_on_end)
dp->plat_data->power_on_end(dp->plat_data); dp->plat_data->power_on_end(dp->plat_data);