[PATCH v2 2/3] phy: k1-usb: add disconnect function support
Yixun Lan
dlan at gentoo.org
Mon Feb 16 07:29:54 PST 2026
On 11:01 Mon 16 Feb , Vladimir Oltean wrote:
> Hello Yixun,
>
> On Sat, Feb 14, 2026 at 08:29:15PM +0800, Yixun Lan wrote:
> > A disconnect status BIT of USB2 PHY need to be cleared, otherwise
> > it will fail to work properly during next connection when devices
> > connect to roothub directly.
> >
> > Fixes: fe4bc1a08638 ("phy: spacemit: support K1 USB2.0 PHY controller")
> > Signed-off-by: Yixun Lan <dlan at kernel.org>
> > ---
> > drivers/phy/spacemit/phy-k1-usb2.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/phy/spacemit/phy-k1-usb2.c b/drivers/phy/spacemit/phy-k1-usb2.c
> > index 342061380012..959bf79c7a72 100644
> > --- a/drivers/phy/spacemit/phy-k1-usb2.c
> > +++ b/drivers/phy/spacemit/phy-k1-usb2.c
> > @@ -48,6 +48,9 @@
> > #define PHY_CLK_HSTXP_EN BIT(3) /* clock hstxp enable */
> > #define PHY_HSTXP_MODE BIT(4) /* 0: force en_txp to be 1; 1: no force */
> >
> > +#define PHY_K1_HS_HOST_DISC 0x40
> > +#define PHY_K1_HS_HOST_DISC_CLR BIT(0)
> > +
> > #define PHY_PLL_DIV_CFG 0x98
> > #define PHY_FDIV_FRACT_8_15 GENMASK(7, 0)
> > #define PHY_FDIV_FRACT_16_19 GENMASK(11, 8)
> > @@ -142,9 +145,20 @@ static int spacemit_usb2phy_exit(struct phy *phy)
> > return 0;
> > }
> >
> > +static int spacemit_usb2phy_disconnect(struct phy *phy, int port)
> > +{
> > + struct spacemit_usb2phy *sphy = phy_get_drvdata(phy);
> > +
> > + regmap_update_bits(sphy->regmap_base, PHY_K1_HS_HOST_DISC,
> > + PHY_K1_HS_HOST_DISC_CLR, PHY_K1_HS_HOST_DISC_CLR);
>
> Please align function arguments to the open parenthesis.
>
Ok
> Since we are in the merge window, it is likely that new features will
> not be picked up at this stage.
>
Sure, no problem and I expect this is normal..
> But this seems to be a fix for existing SpacemiT K1 support, currently
> in the linux-phy/next branch. The linux-phy pull request hasn't been
> sent yet, so if you can resend just this patch and we can get an ACK for
> it in time, perhaps it can be included for v7.0.
>
Ok, done
http://lore.kernel.org/r/20260216152653.25244-1-dlan@kernel.org
> The K3 support should be resent after the merge window.
>
will do once new -rc1 is tagged
--
Yixun Lan (dlan)
More information about the linux-riscv
mailing list