From: Jagan Teki <jagan@amarulasolutions.com>
To: Kever Yang <kever.yang@rock-chips.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com,
Jagan Teki <jagan@amarulasolutions.com>,
Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Subject: [PATCH v3 5/7] phy: rockchip: inno-usb2: Add support #address_cells = 2
Date: Thu, 9 Feb 2023 20:00:58 +0530 [thread overview]
Message-ID: <20230209143100.113376-5-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20230209143100.113376-1-jagan@amarulasolutions.com>
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>
---
Changes for v3:
- new patch
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index b32a498ea7..a01148db22 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -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)
--
2.25.1
next prev parent reply other threads:[~2023-02-09 14:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 14:30 [PATCH v3 1/7] dt-bindings: rockchip: Sync rockchip, vop2.h from Linux Jagan Teki
2023-02-09 14:30 ` [PATCH v3 2/7] arm64: dts: rockchip: rk3566: Add Radxa Compute Module 3 Jagan Teki
2023-02-09 14:30 ` [PATCH v3 3/7] arm64: dts: rockchip: rk3566: Add Radxa Compute Module 3 IO Jagan Teki
2023-02-09 14:30 ` [PATCH v3 4/7] board: rockchip: Add Radxa Compute Module 3 IO Board Jagan Teki
2023-02-09 14:30 ` Jagan Teki [this message]
2023-02-09 14:30 ` [PATCH v3 6/7] phy: rockchip-inno-usb2: Add USB2 PHY for rk3568 Jagan Teki
2023-02-09 14:31 ` [PATCH v3 7/7] config: Enable USB 2.0 for Radxa CM3-IO Jagan Teki
2023-02-16 9:25 ` [PATCH v3 1/7] dt-bindings: rockchip: Sync rockchip, vop2.h from Linux Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230209143100.113376-5-jagan@amarulasolutions.com \
--to=jagan@amarulasolutions.com \
--cc=abbaraju.manojsai@amarulasolutions.com \
--cc=kever.yang@rock-chips.com \
--cc=linux-amarula@amarulasolutions.com \
--cc=philipp.tomsich@vrull.eu \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox