mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "open list:BAREBOX" <barebox@lists.infradead.org>
Subject: [PATCH 08/12] phy: rockchip-inno-usb2: add support for rk3588
Date: Mon, 28 Oct 2024 15:19:53 +0100	[thread overview]
Message-ID: <20241028-vop2-rk3588-v1-8-a54bf7c28adc@pengutronix.de> (raw)
In-Reply-To: <20241028-vop2-rk3588-v1-0-a54bf7c28adc@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 46 +++++++++++++++++++++++++--
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index e46624111d..2dac64f04b 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -416,13 +416,13 @@ static int rockchip_usb2phy_probe(struct device *dev)
 
 	/* find out a proper config which can be matched with dt. */
 	index = 0;
-	while (phy_cfgs[index].reg) {
+	do {
 		if (phy_cfgs[index].reg == reg) {
 			rphy->phy_cfg = &phy_cfgs[index];
 			break;
 		}
 		++index;
-	}
+	} while (phy_cfgs[index].reg);
 
 	if (!rphy->phy_cfg) {
 		dev_err(dev, "no phy-config can be matched\n");
@@ -971,6 +971,47 @@ static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = {
 	},
 	{ /* sentinel */ }
 };
+
+static const struct rockchip_usb2phy_cfg rk3588_phy_cfgs[] = {
+	{
+		.reg		= 0x0000,
+		.clkout_ctl	= { 0x0000, 0, 0, 1, 0 },
+		.port_cfgs	= {
+			[USB2PHY_PORT_OTG] = {
+				.phy_sus	= { 0x000c, 11, 11, 0, 1 },
+			}
+		},
+	},
+	{
+		.reg		= 0x4000,
+		.clkout_ctl	= { 0x0000, 0, 0, 1, 0 },
+		.port_cfgs	= {
+			[USB2PHY_PORT_OTG] = {
+				.phy_sus	= { 0x000c, 11, 11, 0, 1 },
+			}
+		},
+	},
+	{
+		.reg		= 0x8000,
+		.clkout_ctl	= { 0x0000, 0, 0, 1, 0 },
+		.port_cfgs	= {
+			[USB2PHY_PORT_HOST] = {
+				.phy_sus	= { 0x0008, 2, 2, 0, 1 },
+			}
+		},
+	},
+	{
+		.reg		= 0xc000,
+		.clkout_ctl	= { 0x0000, 0, 0, 1, 0 },
+		.port_cfgs	= {
+			[USB2PHY_PORT_HOST] = {
+				.phy_sus	= { 0x0008, 2, 2, 0, 1 },
+			}
+		},
+	},
+	{ /* sentinel */ }
+};
+
 static const struct of_device_id rockchip_usb2phy_dt_match[] = {
 	{ .compatible = "rockchip,rk1808-usb2phy", .data = &rk1808_phy_cfgs },
 	{ .compatible = "rockchip,rk3128-usb2phy", .data = &rk312x_phy_cfgs },
@@ -980,6 +1021,7 @@ static const struct of_device_id rockchip_usb2phy_dt_match[] = {
 	{ .compatible = "rockchip,rk3368-usb2phy", .data = &rk3368_phy_cfgs },
 	{ .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs },
 	{ .compatible = "rockchip,rk3568-usb2phy", .data = &rk3568_phy_cfgs },
+	{ .compatible = "rockchip,rk3588-usb2phy", .data = &rk3588_phy_cfgs },
 	{ .compatible = "rockchip,rv1108-usb2phy", .data = &rv1108_phy_cfgs },
 	{ }
 };

-- 
2.39.5




  parent reply	other threads:[~2024-10-28 14:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 14:19 [PATCH 00/12] video: rockchip: add vop2 rk3588 support Sascha Hauer
2024-10-28 14:19 ` [PATCH 01/12] vop2: rk3588: make windows primary Sascha Hauer
2024-10-28 14:19 ` [PATCH 02/12] vop2: rk3588: pass clock to rk3588_calc_cru_cfg() Sascha Hauer
2024-10-28 14:19 ` [PATCH 03/12] clk: rockchip: rk3588: Update driver from Linux Sascha Hauer
2024-10-28 14:19 ` [PATCH 04/12] phy: add support for Rockchip Samsung HDMI/eDP Combo PHY driver Sascha Hauer
2024-10-28 14:19 ` [PATCH 05/12] video: add support for dw-hdmi-qp Sascha Hauer
2024-10-28 14:19 ` [PATCH 06/12] video: rockchip: add support for RK3588 HDMI Sascha Hauer
2024-10-28 14:19 ` [PATCH 07/12] video: rockchip vop2: fix uninitialized variables Sascha Hauer
2024-10-28 14:19 ` Sascha Hauer [this message]
2024-10-28 14:19 ` [PATCH 09/12] phy: phy-rockchip-samsung-hdptx: Add clock provider support Sascha Hauer
2024-10-28 14:19 ` [PATCH 10/12] drm/rockchip: vop2: Improve display modes handling on rk3588 Sascha Hauer
2024-10-28 14:19 ` [PATCH 11/12] ARM: dts: Rockchip rk3588: add HDMI node Sascha Hauer
2024-10-28 14:19 ` [PATCH 12/12] ARM: dts: rockchip rk3588: adjustments for vop Sascha Hauer

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=20241028-vop2-rk3588-v1-8-a54bf7c28adc@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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