Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9f72226 authored by Fuad Hossain's avatar Fuad Hossain Committed by Abhijith Desai
Browse files

drm/msm/dp: print dp mst connected status to sysfs file



When the main dp link is connected, user space
should be notified via sysfs. This will now be
done by printing the dp mst connected status to a
sysfs file, which gets triggered during the dp
mst hot plug detection for the main link.

Change-Id: If2be23959408c1b88a29d5af8c20a40f558bf964
CRs-Fixed: 2326221
Signed-off-by: default avatarFuad Hossain <fhossain@codeaurora.org>
Signed-off-by: default avatarAbhijith Desai <desaia@codeaurora.org>
parent e8cb707b
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define MAX_DP_MST_DRM_ENCODERS		2
#define MAX_DP_MST_DRM_BRIDGES		2
#define DP_MST_SIM_MAX_PORTS    2
#define HPD_STRING_SIZE			30

struct dp_drm_mst_fw_helper_ops {
	int (*calc_pbn_mode)(int clock, int bpp);
@@ -1325,6 +1326,27 @@ static void dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
	DP_MST_DEBUG("mst hot plug event\n");
}

static void dp_mst_hpd_event_notify(struct dp_mst_private *mst, bool hpd_status)
{
	struct drm_device *dev = mst->dp_display->drm_dev;
	char event_string[] = "MST_HOTPLUG=1";
	char status[HPD_STRING_SIZE];
	char *envp[3];

	if (hpd_status)
		snprintf(status, HPD_STRING_SIZE, "status=connected");
	else
		snprintf(status, HPD_STRING_SIZE, "status=disconnected");

	envp[0] = event_string;
	envp[1] = status;
	envp[2] = NULL;

	kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp);

	DP_MST_DEBUG("%s finished\n", __func__);
}

/* DP Driver Callback OPs */

static void dp_mst_display_hpd(void *dp_display, bool hpd_status,
@@ -1352,6 +1374,8 @@ static void dp_mst_display_hpd(void *dp_display, bool hpd_status,
		rc = mst->mst_fw_cbs->topology_mgr_set_mst(&mst->mst_mgr,
				hpd_status);

	dp_mst_hpd_event_notify(mst, hpd_status);

	DP_MST_DEBUG("mst display hpd:%d, rc:%d\n", hpd_status, rc);

	DP_MST_DEBUG("exit:\n");