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

Commit 40f41b1c authored by Yuan Zhao's avatar Yuan Zhao Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: enable gpio aux switch support



If we defined the gpios for a gpio DP AUX switch
chipset, it was ignored by the default settings.
We should enable it as same as I2C chipset and HPD
gpio detected methods.

Signed-off-by: default avatarYuan Zhao <yzhao@codeaurora.org>
Change-Id: Ife110776a79808d9de962ad93fae7b46ea79658a
parent 2b01ab76
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ DP Controller: Required properties:
- 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,dp-gpio-aux-switch:»       Gpio DP AUX switch chipset support.
- 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,
+3 −1
Original line number Diff line number Diff line
@@ -817,7 +817,9 @@ struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
	struct dp_aux *dp_aux;

	if (!catalog || !parser ||
			(!parser->no_aux_switch && !aux_switch)) {
			(!parser->no_aux_switch &&
				!aux_switch &&
				!parser->gpio_aux_switch)) {
		pr_err("invalid input\n");
		rc = -ENODEV;
		goto error;
+4 −2
Original line number Diff line number Diff line
@@ -772,7 +772,8 @@ static int dp_display_usbpd_configure_cb(struct device *dev)
		goto end;
	}

	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch) {
	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch
	    && !dp->parser->gpio_aux_switch) {
		rc = dp->aux->aux_switch(dp->aux, true, dp->hpd->orientation);
		if (rc)
			goto end;
@@ -914,7 +915,8 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)
	dp_display_disconnect_sync(dp);
	dp->dp_display.post_open = NULL;

	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch)
	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch
	    && !dp->parser->gpio_aux_switch)
		dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE);
end:
	return rc;
+6 −0
Original line number Diff line number Diff line
@@ -241,6 +241,8 @@ static int dp_parser_gpio(struct dp_parser *parser)
		return 0;
	}

	if (of_find_property(of_node, "qcom,dp-gpio-aux-switch", NULL))
		parser->gpio_aux_switch = true;
	mp->gpio_config = devm_kzalloc(dev,
		sizeof(struct dss_gpio) * ARRAY_SIZE(dp_gpios), GFP_KERNEL);
	if (!mp->gpio_config)
@@ -254,6 +256,10 @@ static int dp_parser_gpio(struct dp_parser *parser)

		if (!gpio_is_valid(mp->gpio_config[i].gpio)) {
			pr_debug("%s gpio not specified\n", dp_gpios[i]);
			/* In case any gpio was not specified, we think gpio
			 * aux switch also was not specified.
			 */
			parser->gpio_aux_switch = false;
			continue;
		}

+2 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
 * @has_mst: MST feature enable status
 * @has_mst_sideband: MST sideband feature enable status
 * @no_aux_switch: presence AUX switch status
 * @gpio_aux_switch: presence GPIO AUX switch status
 * @dsc_feature_enable: DSC feature enable status
 * @fec_feature_enable: FEC feature enable status
 * @has_widebus: widebus (2PPC) feature eanble status
@@ -218,6 +219,7 @@ struct dp_parser {
	bool dsc_feature_enable;
	bool fec_feature_enable;
	bool has_widebus;
	bool gpio_aux_switch;

	int (*parse)(struct dp_parser *parser);
	struct dp_io_data *(*get_io)(struct dp_parser *parser, char *name);