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

Commit 554ab394 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: pd: Determine dual_role writeable based on PD capability" into msm-4.9

parents 425d075c e232bdee
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1426,6 +1426,7 @@ static void dr_swap(struct usbpd *pd)
	}

	pd_phy_update_roles(pd->current_dr, pd->current_pr);
	dual_role_instance_changed(pd->dual_role);
}


@@ -2665,11 +2666,17 @@ static int usbpd_dr_set_property(struct dual_role_phy_instance *dual_role,
static int usbpd_dr_prop_writeable(struct dual_role_phy_instance *dual_role,
		enum dual_role_property prop)
{
	struct usbpd *pd = dual_role_get_drvdata(dual_role);

	switch (prop) {
	case DUAL_ROLE_PROP_MODE:
		return 1;
	case DUAL_ROLE_PROP_DR:
	case DUAL_ROLE_PROP_PR:
		return 1;
		if (pd)
			return pd->current_state == PE_SNK_READY ||
				pd->current_state == PE_SRC_READY;
		break;
	default:
		break;
	}