提交 e6915e1a 编写于 作者: P Peter Geis 提交者: Vinod Koul

phy: phy-rockchip-inno-usb2: support standalone phy nodes

New Rockchip devices have the usb2 phy devices as standalone nodes
instead of children of the grf node.
Allow the driver to find the grf node from a phandle.
Signed-off-by: NPeter Geis <pgwipeout@gmail.com>
Tested-by: NMichael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.kernel.org/r/20211215210252.120923-5-pgwipeout@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
上级 9c19c531
...@@ -1073,12 +1073,19 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) ...@@ -1073,12 +1073,19 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
if (!dev->parent || !dev->parent->of_node) if (!dev->parent || !dev->parent->of_node) {
return -EINVAL; rphy->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf");
if (IS_ERR(rphy->grf)) {
dev_err(dev, "failed to locate usbgrf\n");
return PTR_ERR(rphy->grf);
}
}
rphy->grf = syscon_node_to_regmap(dev->parent->of_node); else {
if (IS_ERR(rphy->grf)) rphy->grf = syscon_node_to_regmap(dev->parent->of_node);
return PTR_ERR(rphy->grf); if (IS_ERR(rphy->grf))
return PTR_ERR(rphy->grf);
}
if (of_device_is_compatible(np, "rockchip,rv1108-usb2phy")) { if (of_device_is_compatible(np, "rockchip,rv1108-usb2phy")) {
rphy->usbgrf = rphy->usbgrf =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册