]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
usb: chipidea: udc: add CI_HDRC_CONTROLLER_PULLUP_EVENT event
authorXu Yang <xu.yang_2@nxp.com>
Sat, 14 Jun 2025 12:56:43 +0000 (20:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 10:28:25 +0000 (12:28 +0200)
The device controller will send CI_HDRC_CONTROLLER_PULLUP_EVENT event
when it's going to pullup or pulldown data line.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20250614125645.207732-2-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/udc.c
include/linux/usb/chipidea.h

index 8a9b31fd5c89d8ddf4bb1bbe184a9c094983d38c..8ec9817d3311a302bb3a4bda084ac4e4b36bc132 100644 (file)
@@ -1970,6 +1970,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
                hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
        else
                hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
+
+       if (ci->platdata->notify_event) {
+               _gadget->connected = is_on;
+               ci->platdata->notify_event(ci, CI_HDRC_CONTROLLER_PULLUP_EVENT);
+       }
        pm_runtime_put_sync(ci->dev);
 
        return 0;
index ebdfef124b2bc02433b45c27d032f56eba704263..e17ebeee24e3ecc4b1c2d153d9ea9b656b5a3d35 100644 (file)
@@ -72,6 +72,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_IMX_HSIC_ACTIVE_EVENT          2
 #define CI_HDRC_IMX_HSIC_SUSPEND_EVENT         3
 #define CI_HDRC_CONTROLLER_VBUS_EVENT          4
+#define CI_HDRC_CONTROLLER_PULLUP_EVENT                5
        int     (*notify_event) (struct ci_hdrc *ci, unsigned event);
        struct regulator        *reg_vbus;
        struct usb_otg_caps     ci_otg_caps;