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

Commit 312d2286 authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: pd: Do not fail PD driver probe in case of uAB connector



Remove check for uAB connector in PD driver probe to
support dynamic detection of uAB device. If we fail
PD driver probe in case of uAB connector then our
current handling of extcon handles in dwc3 driver will
keep on defering probe until PD driver get probed successfully.

Change-Id: I5197b05a240a01416e388e81b5770276348de95e
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 786e83fb
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -512,21 +512,6 @@ enum plug_orientation usbpd_get_plug_orientation(struct usbpd *pd)
}
EXPORT_SYMBOL(usbpd_get_plug_orientation);

static unsigned int get_connector_type(struct usbpd *pd)
{
	int ret;
	union power_supply_propval val;

	ret = power_supply_get_property(pd->usb_psy,
		POWER_SUPPLY_PROP_CONNECTOR_TYPE, &val);

	if (ret) {
		dev_err(&pd->dev, "Unable to read CONNECTOR TYPE: %d\n", ret);
		return ret;
	}
	return val.intval;
}

static inline void stop_usb_host(struct usbpd *pd)
{
	extcon_set_state_sync(pd->extcon, EXTCON_USB_HOST, 0);
@@ -4119,11 +4104,6 @@ struct usbpd *usbpd_create(struct device *parent)
		goto destroy_wq;
	}

	if (get_connector_type(pd) == POWER_SUPPLY_CONNECTOR_MICRO_USB) {
		usbpd_dbg(&pd->dev, "USB connector is microAB hence failing pdphy_probe\n");
		ret = -EINVAL;
		goto put_psy;
	}
	/*
	 * associate extcon with the parent dev as it could have a DT
	 * node which will be useful for extcon_get_edev_by_phandle()