mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-13 21:36:57 +00:00
phy: rockchip: inno-usb2: Add 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. Derived and adjusted the similar change from linux-next with below commit <9c19c531dc98> ("phy: phy-rockchip-inno-usb2: support #address_cells = 2") Co-developed-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com> Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
parent
3dd126155c
commit
d538efb9ad
1 changed files with 10 additions and 1 deletions
|
@ -179,12 +179,21 @@ static int rockchip_usb2phy_probe(struct udevice *dev)
|
|||
if (IS_ERR(priv->reg_base))
|
||||
return PTR_ERR(priv->reg_base);
|
||||
|
||||
ret = ofnode_read_u32(dev_ofnode(dev), "reg", ®);
|
||||
ret = ofnode_read_u32_index(dev_ofnode(dev), "reg", 0, ®);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to read reg property (ret = %d)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* support address_cells=2 */
|
||||
if (reg == 0) {
|
||||
if (ofnode_read_u32_index(dev_ofnode(dev), "reg", 1, ®)) {
|
||||
dev_err(dev, "%s must have reg[1]\n",
|
||||
ofnode_get_name(dev_ofnode(dev)));
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
phy_cfgs = (const struct rockchip_usb2phy_cfg *)
|
||||
dev_get_driver_data(dev);
|
||||
if (!phy_cfgs)
|
||||
|
|
Loading…
Add table
Reference in a new issue