[PATCH 21/27] phy: rockchip-inno-usb2: Add RK3572 support
Manivannan Sadhasivam
mani at kernel.org
Sun Nov 1 02:51:52 PST 2026
On 2026-10-22 00:11 +0800, Cunhao Lu wrote:
> Support both RK3572 USB2 PHY instances.
>
> Signed-off-by: Cunhao Lu <1579567540 at qq.com>
Nitpicks below. With those fixed,
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam at oss.qualcomm.com>
> ---
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 136 ++++++++++++++++++++++++++
> 1 file changed, 136 insertions(+)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 7d8a533f24aea..16a36e68cb6d3 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -1544,6 +1544,49 @@ static int rk3528_usb2phy_tuning(struct rockchip_usb2phy *rphy)
> return 0;
> }
>
> +static int rk3572_usb2phy_tuning(struct rockchip_usb2phy *rphy)
> +{
> + u32 reg = rphy->phy_cfg->reg;
> + struct clk *refclk;
> + unsigned long rate;
> + u32 val;
> + int ret;
> +
> + refclk = devm_clk_get(rphy->dev, "phyclk");
> + if (IS_ERR(refclk))
> + return PTR_ERR(refclk);
Please insert a newline between each operation to improve readability.
> + rate = clk_get_rate(refclk);
> + if (rate != 24000000 && rate != 26000000)
> + return -EINVAL;
> +
> + ret = regmap_write(rphy->grf, reg + 0x0004,
> + GENMASK(18, 16) | (rate == 24000000 ? 2 : 6));
> + if (ret)
> + return ret;
> +
> + ret = regmap_read(rphy->grf, reg + 0x0010, &val);
> + if (ret)
> + return ret;
> + if (val & BIT(13)) {
> + ret = regmap_write(rphy->grf, reg + 0x0010, BIT(29));
> + if (ret)
> + return ret;
> + ret = rockchip_usb2phy_reset(rphy);
> + if (ret)
> + return ret;
> + }
> +
> + /* Set the normal line-state filter interval. */
> + ret = regmap_write(rphy->grf, reg + 0x0020, 0x30100);
> + if (ret)
> + return ret;
Here.
> + /* Increase HS voltage by 5.89% and double pre-emphasis current. */
> + ret = regmap_write(rphy->grf, reg + 0x000c, GENMASK(27, 24) | 0x0900);
> + if (ret)
> + return ret;
And here.
- Mani
More information about the linux-phy
mailing list