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

Commit 342a282f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: pd: Remove vconn_is_external flag"

parents 7ef644ed 2ff02f91
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -442,7 +442,6 @@ struct usbpd {
	struct regulator	*vconn;
	bool			vbus_enabled;
	bool			vconn_enabled;
	bool			vconn_is_external;

	u8			tx_msgid[SOPII_MSG + 1];
	u8			rx_msgid[SOPII_MSG + 1];
@@ -831,11 +830,6 @@ static int pd_select_pdo(struct usbpd *pd, int pdo_pos, int uv, int ua)
		return -ENOTSUPP;
	}

	/* Can't sink more than 5V if VCONN is sourced from the VBUS input */
	if (pd->vconn_enabled && !pd->vconn_is_external &&
			pd->requested_voltage > 5000000)
		return -ENOTSUPP;

	pd->requested_current = curr;
	pd->requested_pdo = pdo_pos;

@@ -2850,21 +2844,6 @@ static bool handle_ctrl_snk_ready(struct usbpd *pd, struct rx_msg *rx_msg)
		usbpd_set_state(pd, PE_PRS_SNK_SRC_TRANSITION_TO_OFF);
		break;
	case MSG_VCONN_SWAP:
		/*
		 * if VCONN is connected to VBUS, make sure we are
		 * not in high voltage contract, otherwise reject.
		 */
		if (!pd->vconn_is_external &&
				(pd->requested_voltage > 5000000)) {
			ret = pd_send_msg(pd, MSG_REJECT, NULL, 0,
					SOP_MSG);
			if (ret)
				usbpd_set_state(pd,
						PE_SEND_SOFT_RESET);

			break;
		}

		ret = pd_send_msg(pd, MSG_ACCEPT, NULL, 0, SOP_MSG);
		if (ret) {
			usbpd_set_state(pd, PE_SEND_SOFT_RESET);
@@ -4673,9 +4652,6 @@ struct usbpd *usbpd_create(struct device *parent)
	extcon_set_property_capability(pd->extcon, EXTCON_USB_HOST,
			EXTCON_PROP_USB_SS);

	pd->vconn_is_external = device_property_present(parent,
					"qcom,vconn-uses-external-source");

	pd->num_sink_caps = device_property_read_u32_array(parent,
			"qcom,default-sink-caps", NULL, 0);
	if (pd->num_sink_caps > 0) {