u8 mode;
int ret;
+ if (!edev) {
+ mode = MODE_DFP_USB;
+ id = EXTCON_USB_HOST;
+ tcphy->flip = 0;
+ return mode;
+ }
+
ufp = extcon_get_state(edev, EXTCON_USB);
dfp = extcon_get_state(edev, EXTCON_USB_HOST);
dp = extcon_get_state(edev, EXTCON_DISP_DP);
typec_phy_pre_init(tcphy);
- tcphy->extcon = extcon_get_edev_by_phandle(dev, 0);
- if (IS_ERR(tcphy->extcon)) {
- if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
- dev_err(dev, "Invalid or missing extcon\n");
- return PTR_ERR(tcphy->extcon);
+ if (device_property_read_bool(dev, "extcon")) {
+ tcphy->extcon = extcon_get_edev_by_phandle(dev, 0);
+ if (IS_ERR(tcphy->extcon)) {
+ if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
+ dev_err(dev, "Invalid or missing extcon\n");
+ return PTR_ERR(tcphy->extcon);
+ }
}
tcphy->phy[0] = devm_phy_create(dev, NULL, &rockchip_dp_phy_ops);