usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95
authorPeng Fan <peng.fan@nxp.com>
Mon, 22 Sep 2025 02:21:09 +0000 (10:21 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 19 Nov 2025 17:06:49 +0000 (18:06 +0100)
i.MX95 USB2 inside HSIOMIX could still wakeup Linux, even if HSIOMIX
power domain(Digital logic) is off. There is still always on logic
have the wakeup capability which is out band wakeup capbility.

So use device_set_out_band_wakeup for i.MX95 to make sure usb2 could
wakeup system even if HSIOMIX power domain is in off state.

Tested-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/usb/chipidea/ci_hdrc_imx.c
include/linux/usb/chipidea.h

index d7c2a1a..d4ee9e1 100644 (file)
@@ -79,6 +79,10 @@ static const struct ci_hdrc_imx_platform_flag imx8ulp_usb_data = {
                CI_HDRC_HAS_PORTSC_PEC_MISSED,
 };
 
+static const struct ci_hdrc_imx_platform_flag imx95_usb_data = {
+       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM | CI_HDRC_OUT_BAND_WAKEUP,
+};
+
 static const struct ci_hdrc_imx_platform_flag s32g_usb_data = {
        .flags = CI_HDRC_DISABLE_HOST_STREAMING,
 };
@@ -94,6 +98,7 @@ static const struct of_device_id ci_hdrc_imx_dt_ids[] = {
        { .compatible = "fsl,imx7d-usb", .data = &imx7d_usb_data},
        { .compatible = "fsl,imx7ulp-usb", .data = &imx7ulp_usb_data},
        { .compatible = "fsl,imx8ulp-usb", .data = &imx8ulp_usb_data},
+       { .compatible = "fsl,imx95-usb", .data = &imx95_usb_data},
        { .compatible = "nxp,s32g2-usb", .data = &s32g_usb_data},
        { /* sentinel */ }
 };
@@ -704,9 +709,13 @@ static int ci_hdrc_imx_suspend(struct device *dev)
 
        pinctrl_pm_select_sleep_state(dev);
 
-       if (data->wakeup_irq > 0 && device_may_wakeup(dev))
+       if (data->wakeup_irq > 0 && device_may_wakeup(dev)) {
                enable_irq_wake(data->wakeup_irq);
 
+               if (data->plat_data->flags & CI_HDRC_OUT_BAND_WAKEUP)
+                       device_set_out_band_wakeup(dev);
+       }
+
        return ret;
 }
 
index e17ebee..c645119 100644 (file)
@@ -66,6 +66,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_HAS_PORTSC_PEC_MISSED  BIT(17)
 #define CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS       BIT(18)
 #define        CI_HDRC_HAS_SHORT_PKT_LIMIT     BIT(19)
+#define        CI_HDRC_OUT_BAND_WAKEUP         BIT(20)
        enum usb_dr_mode        dr_mode;
 #define CI_HDRC_CONTROLLER_RESET_EVENT         0
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT       1