|
@@ -507,13 +507,24 @@ static ssize_t dp_debug_write_mst_con_id(struct file *file,
|
|
|
}
|
|
|
mutex_unlock(&debug->dp_debug.dp_mst_connector_list.lock);
|
|
|
|
|
|
- if (!in_list)
|
|
|
+ if (!in_list && status != connector_status_connected) {
|
|
|
DP_ERR("invalid connector id %u\n", con_id);
|
|
|
- else if (status != connector_status_unknown) {
|
|
|
- debug->dp_debug.mst_hpd_sim = true;
|
|
|
- debug->hpd->simulate_attention(debug->hpd, vdo);
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (status == connector_status_unknown)
|
|
|
+ goto end;
|
|
|
+
|
|
|
+ debug->dp_debug.mst_hpd_sim = true;
|
|
|
+
|
|
|
+ if (status == connector_status_connected) {
|
|
|
+ DP_INFO("plug mst connector\n", con_id, status);
|
|
|
+ debug->dp_debug.mst_sim_add_con = true;
|
|
|
+ } else {
|
|
|
+ DP_INFO("unplug mst connector %d\n", con_id, status);
|
|
|
}
|
|
|
|
|
|
+ debug->hpd->simulate_attention(debug->hpd, vdo);
|
|
|
goto end;
|
|
|
clear:
|
|
|
DP_DEBUG("clearing mst_con_id\n");
|
|
@@ -2362,6 +2373,20 @@ static void dp_debug_abort(struct dp_debug *dp_debug)
|
|
|
mutex_unlock(&debug->lock);
|
|
|
}
|
|
|
|
|
|
+static void dp_debug_set_mst_con(struct dp_debug *dp_debug, int con_id)
|
|
|
+{
|
|
|
+ struct dp_debug_private *debug;
|
|
|
+
|
|
|
+ if (!dp_debug)
|
|
|
+ return;
|
|
|
+
|
|
|
+ debug = container_of(dp_debug, struct dp_debug_private, dp_debug);
|
|
|
+ mutex_lock(&debug->lock);
|
|
|
+ debug->mst_con_id = con_id;
|
|
|
+ mutex_unlock(&debug->lock);
|
|
|
+ DP_INFO("Selecting mst connector %d\n", con_id);
|
|
|
+}
|
|
|
+
|
|
|
struct dp_debug *dp_debug_get(struct dp_debug_in *in)
|
|
|
{
|
|
|
int rc = 0;
|
|
@@ -2409,6 +2434,7 @@ struct dp_debug *dp_debug_get(struct dp_debug_in *in)
|
|
|
debug->aux->access_lock = &debug->lock;
|
|
|
dp_debug->get_edid = dp_debug_get_edid;
|
|
|
dp_debug->abort = dp_debug_abort;
|
|
|
+ dp_debug->set_mst_con = dp_debug_set_mst_con;
|
|
|
|
|
|
INIT_LIST_HEAD(&dp_debug->dp_mst_connector_list.list);
|
|
|
|