]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: host: xhci-plat: Add .post_resume_quirk for struct xhci_plat_priv
authorBiju Das <biju.das.jz@bp.renesas.com>
Tue, 16 Sep 2025 15:02:41 +0000 (16:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Sep 2025 10:43:17 +0000 (12:43 +0200)
Some SoCs (eg Renesas RZ/G3E SoC) have special sequence after
xhci_resume, add .post_resume_quick for it.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20250916150255.4231-6-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci-plat.h

index b3f895505cbebfc3a257510f79b100e941ca791a..074d9c731639fa5a2fbca06b7dfb938a243d824b 100644 (file)
@@ -75,6 +75,16 @@ static int xhci_priv_resume_quirk(struct usb_hcd *hcd)
        return priv->resume_quirk(hcd);
 }
 
+static int xhci_priv_post_resume_quirk(struct usb_hcd *hcd)
+{
+       struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
+
+       if (!priv->post_resume_quirk)
+               return 0;
+
+       return priv->post_resume_quirk(hcd);
+}
+
 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
        struct xhci_plat_priv *priv = xhci_to_priv(xhci);
@@ -530,6 +540,10 @@ static int xhci_plat_resume_common(struct device *dev, bool power_lost)
        if (ret)
                goto disable_clks;
 
+       ret = xhci_priv_post_resume_quirk(hcd);
+       if (ret)
+               goto disable_clks;
+
        pm_runtime_disable(dev);
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);
index 2b32a93d2b7604ba83442a839438764e1ba2e382..00751d851831057a062ff83e05ab662b9767e992 100644 (file)
@@ -21,6 +21,7 @@ struct xhci_plat_priv {
        int (*init_quirk)(struct usb_hcd *);
        int (*suspend_quirk)(struct usb_hcd *);
        int (*resume_quirk)(struct usb_hcd *);
+       int (*post_resume_quirk)(struct usb_hcd *);
 };
 
 #define hcd_to_xhci_priv(h) ((struct xhci_plat_priv *)hcd_to_xhci(h)->priv)