[PATCH v5 5/5] phy: fsl-imx8mq-usb: keep PHY power domain runtime always-on for i.MX8MP

Xu Yang xu.yang_2 at oss.nxp.com
Wed Jul 15 03:48:09 PDT 2026


On Tue, Jun 30, 2026 at 02:13:33PM -0500, Frank Li wrote:
> On Tue, Jun 30, 2026 at 06:11:32PM +0800, Xu Yang wrote:
> > From: Xu Yang <xu.yang_2 at nxp.com>
> >
> > On i.MX8MP, the USB PHY has a dedicated power domain that was previously
> > never powered off at runtime. With the introduction of runtime PM support,
> > the power domain will be powered off if the device is runtime suspended,
> > which breaks USB wakeup functionality.
> >
> > To preserve wakeup functionality, mark the PHY power domain as runtime
> > always-on for i.MX8MP platform. To limit the behavior to i.MX8MP, add a
> > new imx95_usb_phy_ops for i.MX95 and introduce usb_phy_is_imx8mp() helper
> > to identify i.MX8MP PHY instance.
> >
> > Signed-off-by: Xu Yang <xu.yang_2 at nxp.com>
> >
> > ---
> > Changes in v5:
> >  - no changes
> > Changes in v4:
> >  - no changes
> > Changes in v3:
> >  - new patch
> > ---
> >  drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 18 +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > index 4949ec78d304..c9741b532663 100644
> > --- a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > +++ b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > @@ -9,6 +9,7 @@
> >  #include <linux/of.h>
> >  #include <linux/phy/phy.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/pm_domain.h>
> >  #include <linux/pm_runtime.h>
> >  #include <linux/regulator/consumer.h>
> >  #include <linux/regmap.h>
> > @@ -660,13 +661,20 @@ static const struct phy_ops imx8mp_usb_phy_ops = {
> >  	.owner		= THIS_MODULE,
> >  };
> >
> > +static const struct phy_ops imx95_usb_phy_ops = {
> > +	.init		= imx8mp_usb_phy_init,
> > +	.power_on	= imx8mq_phy_power_on,
> > +	.power_off	= imx8mq_phy_power_off,
> > +	.owner		= THIS_MODULE,
> > +};
> > +
> >  static const struct of_device_id imx8mq_usb_phy_of_match[] = {
> >  	{.compatible = "fsl,imx8mq-usb-phy",
> >  	 .data = &imx8mq_usb_phy_ops,},
> >  	{.compatible = "fsl,imx8mp-usb-phy",
> >  	 .data = &imx8mp_usb_phy_ops,},
> >  	{.compatible = "fsl,imx95-usb-phy",
> > -	 .data = &imx8mp_usb_phy_ops,},
> > +	 .data = &imx95_usb_phy_ops,},
> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(of, imx8mq_usb_phy_of_match);
> > @@ -679,6 +687,11 @@ static const struct regmap_config imx_cr_regmap_config = {
> >  	.max_register = 0x7,
> >  };
> >
> > +static bool usb_phy_is_imx8mp(const void *data)
> > +{
> > +	return data == &imx8mp_usb_phy_ops;
> > +}
> > +
> 
> It is not good direct use drvdata as it.
> 
> Can you add new drvdata
> 
> drvdata
> {
> 	phy_ops ops;
> 	bool always_on;
> }
> 
> in follow probe check
> 
> if (always_on)
> 	...
> 
> it is more extendable in future.

OK. I already create a new patch to add drvdata.

Thanks,
Xu Yang



More information about the linux-phy mailing list