|
@@ -821,6 +821,9 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy)
|
|
|
u8 mode;
|
|
|
int ret;
|
|
|
|
|
|
+ if (!edev)
|
|
|
+ return MODE_DFP_USB;
|
|
|
+
|
|
|
ufp = extcon_get_state(edev, EXTCON_USB);
|
|
|
dp = extcon_get_state(edev, EXTCON_DISP_DP);
|
|
|
|
|
@@ -1159,9 +1162,13 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
|
|
|
|
|
|
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 (PTR_ERR(tcphy->extcon) == -ENODEV) {
|
|
|
+ tcphy->extcon = NULL;
|
|
|
+ } else {
|
|
|
+ if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
|
|
|
+ dev_err(dev, "Invalid or missing extcon\n");
|
|
|
+ return PTR_ERR(tcphy->extcon);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
pm_runtime_enable(dev);
|