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

phy: phy-rockchip-inno-usb2: support #address_cells = 2

New Rockchip devices have the usb phy nodes as standalone devices.
These nodes have register nodes with #address_cells = 2, but only use 32
bit addresses.

Adjust the driver to check if the returned address is "0", and adjust
the index in that case.
Signed-off-by: NPeter Geis <pgwipeout@gmail.com>
Tested-by: NMichael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.kernel.org/r/20211215210252.120923-4-pgwipeout@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
上级 8eff5b99
...@@ -1090,12 +1090,21 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) ...@@ -1090,12 +1090,21 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
rphy->usbgrf = NULL; rphy->usbgrf = NULL;
} }
if (of_property_read_u32(np, "reg", &reg)) { if (of_property_read_u32_index(np, "reg", 0, &reg)) {
dev_err(dev, "the reg property is not assigned in %pOFn node\n", dev_err(dev, "the reg property is not assigned in %pOFn node\n",
np); np);
return -EINVAL; return -EINVAL;
} }
/* support address_cells=2 */
if (reg == 0) {
if (of_property_read_u32_index(np, "reg", 1, &reg)) {
dev_err(dev, "the reg property is not assigned in %pOFn node\n",
np);
return -EINVAL;
}
}
rphy->dev = dev; rphy->dev = dev;
phy_cfgs = match->data; phy_cfgs = match->data;
rphy->chg_state = USB_CHG_STATE_UNDEFINED; rphy->chg_state = USB_CHG_STATE_UNDEFINED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册