diff options
author | Peter Geis <pgwipeout@gmail.com> | 2021-12-16 00:02:47 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2021-12-23 14:24:48 +0300 |
commit | 9c19c531dc98d7ba49b44802a607042e763ebe21 (patch) | |
tree | 0b5fc9aa18a8970f2669439bb14ea6083d0fbcbd /drivers/phy/rockchip | |
parent | 8eff5b99042dd2fe6494e82ab1dc39bcdd5b976c (diff) | |
download | linux-9c19c531dc98d7ba49b44802a607042e763ebe21.tar.xz |
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: Peter Geis <pgwipeout@gmail.com>
Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.kernel.org/r/20211215210252.120923-4-pgwipeout@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy/rockchip')
-rw-r--r-- | drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 9f95b587e2c0..fac390e1f8de 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1090,12 +1090,21 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) rphy->usbgrf = NULL; } - if (of_property_read_u32(np, "reg", ®)) { + if (of_property_read_u32_index(np, "reg", 0, ®)) { dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); return -EINVAL; } + /* support address_cells=2 */ + if (reg == 0) { + if (of_property_read_u32_index(np, "reg", 1, ®)) { + dev_err(dev, "the reg property is not assigned in %pOFn node\n", + np); + return -EINVAL; + } + } + rphy->dev = dev; phy_cfgs = match->data; rphy->chg_state = USB_CHG_STATE_UNDEFINED; |