Re: [PATCH 05/11] phy: rockchip: inno-usb2: Add support for RK3528

From: Vinod Koul
Date: Tue Aug 12 2025 - 11:53:07 EST


On 23-07-25, 12:23, Jonas Karlman wrote:
> From: Jianwei Zheng <jianwei.zheng@xxxxxxxxxxxxxx>

Please do not send encrypted emails over public mail lists

>
> The RK3528 has a single USB2PHY with a otg and host port.
>
> Add support for the RK3528 variant of USB2PHY.
>
> PHY tuning for RK3528:
>
> - Turn off differential receiver in suspend mode to save power
> consumption.
>
> - Set HS eye-height to 400mV instead of default 450mV.
>
> - Choose the Tx fs/ls data as linestate from TX driver for otg port
> which uses dwc3 controller to improve fs/ls devices compatibility with
> long cables.
>
> This is based on vendor kernel linux-stan-6.1-rkr5 tag.
>
> Signed-off-by: Jianwei Zheng <jianwei.zheng@xxxxxxxxxxxxxx>
> Signed-off-by: Jonas Karlman <jonas@xxxxxxxxx>
> ---
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 74 +++++++++++++++++++
> 1 file changed, 74 insertions(+)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index cd1a02b990ef..b8950d9f9e97 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -1507,6 +1507,28 @@ static int rk3128_usb2phy_tuning(struct rockchip_usb2phy *rphy)
> BIT(2) << BIT_WRITEABLE_SHIFT | 0);
> }
>
> +static int rk3528_usb2phy_tuning(struct rockchip_usb2phy *rphy)
> +{
> + int ret = 0;

Superfluous init

> +
> + /* Turn off otg port differential receiver in suspend mode */
> + ret |= regmap_write(rphy->phy_base, 0x30, BIT(18) | 0x0000);
> +
> + /* Turn off host port differential receiver in suspend mode */
> + ret |= regmap_write(rphy->phy_base, 0x430, BIT(18) | 0x0000);
> +
> + /* Set otg port HS eye height to 400mv (default is 450mv) */
> + ret |= regmap_write(rphy->phy_base, 0x30, GENMASK(22, 20) | 0x0000);
> +
> + /* Set host port HS eye height to 400mv (default is 450mv) */
> + ret |= regmap_write(rphy->phy_base, 0x430, GENMASK(22, 20) | 0x0000);
> +
> + /* Choose the Tx fs/ls data as linestate from TX driver for otg port */
> + ret |= regmap_write(rphy->phy_base, 0x94, GENMASK(22, 19) | 0x0018);

No error checking?

--
~Vinod