phy: phy-rockchip-typec: support Type-C phy work without extcon

There is a Standard-A receptacle on the rk3399 box platform with
Type-C phy, which does not have an extern Type-C controller
(e.g. FUSB302), this result in failure when typec probe, this patch
add support without extcon for usb3.0, support of dp is not included
in this patch.

Change-Id: I1af87d311707a5d385017e10478f992d940000b8
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
This commit is contained in:
Meng Dongyang 2016-08-18 11:45:01 +08:00 committed by Huang, Tao
parent fa0777162e
commit 978e10ffd8

View File

@ -602,6 +602,13 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy)
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);
@ -950,11 +957,13 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
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);