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

Commit e3fcaf87 authored by Xiaowen Wu's avatar Xiaowen Wu
Browse files

drm/msm/dp: Add gpio hpd support for DP



For board with direct DP output, there is no usbpd
controller or aux switch. The change will add gpio
based hpd to support direct DP connection.

A super interface dp_hpd is added on top of dp_usbpd
to abstrct the hpd functions. With the change, usbpd
and gpio_hpd are two instances of dp_hpd.

CRs-Fixed: 2262783
Change-Id: I798f52445d0e64bd8c0f7a90f4e9815811b047fc
Signed-off-by: default avatarXiaowen Wu <wxiaowen@codeaurora.org>
parent cf2cba72
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ DP Controller: Required properties:
- qcom,max-pclk-frequency-khz:	An integer specifying the max. pixel clock in KHz supported by Display Port.
- qcom,dp-usbpd-detection:	Phandle for the PMI regulator node for USB PHY PD detection.
- qcom,dp-aux-switch:		Phandle for the driver used to program the AUX switch for Display Port orientation.
- qcom,dp-hpd-gpio:		HPD gpio for direct DP connector without USB PHY or AUX switch.
- qcom,<type>-supply-entries:		A node that lists the elements of the supply used by the a particular "type" of DSI module. The module "types"
					can be "core", "ctrl", and "phy". Within the same type,
					there can be more than one instance of this binding,
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ msm_drm-y := \
	dp/dp_ctrl.o \
	dp/dp_audio.o \
	dp/dp_debug.o \
	dp/dp_hpd.o \
	dp/dp_gpio_hpd.o \
	dp/dp_display.o \
	dp/dp_drm.o \
	dp/dp_hdcp2p2.o \
+4 −3
Original line number Diff line number Diff line
@@ -767,13 +767,14 @@ static int dp_aux_configure_aux_switch(struct dp_aux *dp_aux,
}

struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
		struct dp_aux_cfg *aux_cfg, struct device_node *aux_switch)
		struct dp_parser *parser, struct device_node *aux_switch)
{
	int rc = 0;
	struct dp_aux_private *aux;
	struct dp_aux *dp_aux;

	if (!catalog || !aux_cfg || !aux_switch) {
	if (!catalog || !parser ||
			(!parser->no_aux_switch && !aux_switch)) {
		pr_err("invalid input\n");
		rc = -ENODEV;
		goto error;
@@ -791,7 +792,7 @@ struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,

	aux->dev = dev;
	aux->catalog = catalog;
	aux->cfg = aux_cfg;
	aux->cfg = parser->aux_cfg;
	aux->aux_switch_node = aux_switch;
	dp_aux = &aux->dp_aux;
	aux->retry_cnt = 0;
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ struct dp_aux {
};

struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
		struct dp_aux_cfg *aux_cfg, struct device_node *aux_switch);
		struct dp_parser *parser, struct device_node *aux_switch);
void dp_aux_put(struct dp_aux *aux);

#endif /*__DP_AUX_H_*/
+8 −8
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ struct dp_debug_private {
	char exe_mode[SZ_32];
	char reg_dump[SZ_32];

	struct dp_usbpd *usbpd;
	struct dp_hpd *hpd;
	struct dp_link *link;
	struct dp_panel *panel;
	struct dp_aux *aux;
@@ -289,7 +289,7 @@ static ssize_t dp_debug_write_hpd(struct file *file,

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

	debug->usbpd->simulate_connect(debug->usbpd, !!(hpd & BIT(0)),
	debug->hpd->simulate_connect(debug->hpd, !!(hpd & BIT(0)),
			orientation);
end:
	return len;
@@ -576,7 +576,7 @@ static ssize_t dp_debug_read_connected(struct file *file,
	if (*ppos)
		return 0;

	len += snprintf(buf, SZ_8, "%d\n", debug->usbpd->hpd_high);
	len += snprintf(buf, SZ_8, "%d\n", debug->hpd->hpd_high);

	if (copy_to_user(user_buff, buf, len))
		return -EFAULT;
@@ -1120,7 +1120,7 @@ static ssize_t dp_debug_read_dump(struct file *file,
	if (*ppos)
		return 0;

	if (!debug->usbpd->hpd_high || !strlen(debug->reg_dump))
	if (!debug->hpd->hpd_high || !strlen(debug->reg_dump))
		goto end;

	rc = debug->catalog->get_reg_dump(debug->catalog,
@@ -1404,7 +1404,7 @@ static void dp_debug_sim_work(struct work_struct *work)
	struct dp_debug_private *debug =
		container_of(work, typeof(*debug), sim_work);

	debug->usbpd->simulate_attention(debug->usbpd, debug->vdo);
	debug->hpd->simulate_attention(debug->hpd, debug->vdo);
}

u8 *dp_debug_get_edid(struct dp_debug *dp_debug)
@@ -1420,7 +1420,7 @@ u8 *dp_debug_get_edid(struct dp_debug *dp_debug)
}

struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
			struct dp_usbpd *usbpd, struct dp_link *link,
			struct dp_hpd *hpd, struct dp_link *link,
			struct dp_aux *aux, struct drm_connector **connector,
			struct dp_catalog *catalog,
			struct dp_parser *parser)
@@ -1429,7 +1429,7 @@ struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
	struct dp_debug_private *debug;
	struct dp_debug *dp_debug;

	if (!dev || !panel || !usbpd || !link || !catalog) {
	if (!dev || !panel || !hpd || !link || !catalog) {
		pr_err("invalid input\n");
		rc = -EINVAL;
		goto error;
@@ -1444,7 +1444,7 @@ struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
	INIT_WORK(&debug->sim_work, dp_debug_sim_work);

	debug->dp_debug.debug_en = false;
	debug->usbpd = usbpd;
	debug->hpd = hpd;
	debug->link = link;
	debug->panel = panel;
	debug->aux = aux;
Loading