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

Commit da2dbe50 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

drm/msm/dp: do not override plug orientation in simulation



In case of hot plug simulation, as the cable remains connected,
its orientation is not going to change. Do not update the orientation
using debug module to avoid unnecessary AUX failures.

Change-Id: I3881847b8fbfed60d23347dc5c6f88f0d9b5b27e
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 92a2b707
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -259,10 +259,8 @@ static ssize_t dp_debug_write_hpd(struct file *file,
	struct dp_debug_private *debug = file->private_data;
	char buf[SZ_8];
	size_t len = 0;
	int const orientation_mask = 0x4;
	int const hpd_data_mask = 0x7;
	int hpd = 0;
	int orientation = 0;

	if (!debug)
		return -ENODEV;
@@ -281,13 +279,10 @@ static ssize_t dp_debug_write_hpd(struct file *file,
		goto end;

	hpd &= hpd_data_mask;
	orientation = hpd & orientation_mask ?
		ORIENTATION_CC2 : ORIENTATION_CC1;

	debug->dp_debug.psm_enabled = !!(hpd & BIT(1));

	debug->hpd->simulate_connect(debug->hpd, !!(hpd & BIT(0)),
			orientation);
	debug->hpd->simulate_connect(debug->hpd, !!(hpd & BIT(0)));
end:
	return len;
}
+1 −2
Original line number Diff line number Diff line
@@ -151,8 +151,7 @@ static void dp_gpio_hpd_work(struct work_struct *work)
	}
}

static int dp_gpio_hpd_simulate_connect(struct dp_hpd *dp_hpd, bool hpd,
		int orientation)
static int dp_gpio_hpd_simulate_connect(struct dp_hpd *dp_hpd, bool hpd)
{
	int rc = 0;
	struct dp_gpio_hpd_private *gpio_hpd;
+1 −2
Original line number Diff line number Diff line
@@ -69,8 +69,7 @@ struct dp_hpd {
	bool multi_func;

	void (*isr)(struct dp_hpd *dp_hpd, int event);
	int (*simulate_connect)(struct dp_hpd *dp_hpd, bool hpd,
			int orientation);
	int (*simulate_connect)(struct dp_hpd *dp_hpd, bool hpd);
	int (*simulate_attention)(struct dp_hpd *dp_hpd, int vdo);
};

+1 −3
Original line number Diff line number Diff line
@@ -430,8 +430,7 @@ static void dp_usbpd_response_cb(struct usbpd_svid_handler *hdlr, u8 cmd,
	}
}

static int dp_usbpd_simulate_connect(struct dp_hpd *dp_hpd, bool hpd,
		int orientation)
static int dp_usbpd_simulate_connect(struct dp_hpd *dp_hpd, bool hpd)
{
	int rc = 0;
	struct dp_usbpd *dp_usbpd;
@@ -448,7 +447,6 @@ static int dp_usbpd_simulate_connect(struct dp_hpd *dp_hpd, bool hpd,

	dp_usbpd->base.hpd_high = hpd;
	pd->forced_disconnect = !hpd;
	pd->dp_usbpd.base.orientation = orientation;
	pd->dp_usbpd.base.alt_mode_cfg_done = hpd;

	pr_debug("hpd_high=%d, forced_disconnect=%d, orientation=%d\n",