From deaafa40a60495ee075f66f71141b4d6dd3dbfdf Mon Sep 17 00:00:00 2001 From: wanxiaoqing Date: Fri, 12 Apr 2024 15:28:23 +0800 Subject: [PATCH] =?UTF-8?q?LTS=205.10=20=E8=A1=A5=E4=B8=81=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanxiaoqing --- linux-5.10/rk3568_patch/kernel.patch | 65 ++++------------------------ 1 file changed, 9 insertions(+), 56 deletions(-) diff --git a/linux-5.10/rk3568_patch/kernel.patch b/linux-5.10/rk3568_patch/kernel.patch index fde8e83..80405a4 100755 --- a/linux-5.10/rk3568_patch/kernel.patch +++ b/linux-5.10/rk3568_patch/kernel.patch @@ -1625300,33 +1625300,7 @@ index 3a3b5a03dda7..a0c281293530 goto out; if (gadget->connected) { -@@ -1004,6 +1006,25 @@ int usb_gadget_ep_match_desc(struct usb_gadget *gadget, - } - EXPORT_SYMBOL_GPL(usb_gadget_ep_match_desc); - -+/** -+ * usb_gadget_check_config - checks if the UDC can support the binded -+ * configuration -+ * @gadget: controller to check the USB configuration -+ * -+ * Ensure that a UDC is able to support the requested resources by a -+ * configuration, and that there are no resource limitations, such as -+ * internal memory allocated to all requested endpoints. -+ * -+ * Returns zero on success, else a negative errno. -+ */ -+int usb_gadget_check_config(struct usb_gadget *gadget) -+{ -+ if (gadget->ops->check_config) -+ return gadget->ops->check_config(gadget); -+ return 0; -+} -+EXPORT_SYMBOL_GPL(usb_gadget_check_config); -+ - /* ------------------------------------------------------------------------- */ - - static void usb_gadget_state_work(struct work_struct *work) -@@ -1085,7 +1106,18 @@ EXPORT_SYMBOL_GPL(usb_gadget_udc_reset); +@@ -1104,7 +1106,18 @@ EXPORT_SYMBOL_GPL(usb_gadget_udc_reset); */ static inline int usb_gadget_udc_start(struct usb_udc *udc) { @@ -1625346,7 +1625320,7 @@ index 3a3b5a03dda7..a0c281293530 } /** -@@ -1101,7 +1133,13 @@ static inline int usb_gadget_udc_start(struct usb_udc *udc) +@@ -1120,7 +1133,13 @@ static inline int usb_gadget_udc_start(struct usb_udc *udc) */ static inline void usb_gadget_udc_stop(struct usb_udc *udc) { @@ -1625360,7 +1625334,7 @@ index 3a3b5a03dda7..a0c281293530 } /** -@@ -1117,12 +1155,65 @@ static inline void usb_gadget_udc_stop(struct usb_udc *udc) +@@ -1136,12 +1155,65 @@ static inline void usb_gadget_udc_stop(struct usb_udc *udc) static inline void usb_gadget_udc_set_speed(struct usb_udc *udc, enum usb_device_speed speed) { @@ -1625431,7 +1625405,7 @@ index 3a3b5a03dda7..a0c281293530 } /** -@@ -1225,6 +1316,8 @@ int usb_add_gadget(struct usb_gadget *gadget) +@@ -1244,6 +1316,8 @@ int usb_add_gadget(struct usb_gadget *gadget) udc->gadget = gadget; gadget->udc = udc; @@ -1625440,7 +1625414,7 @@ index 3a3b5a03dda7..a0c281293530 mutex_lock(&udc_lock); list_add_tail(&udc->list, &udc_list); -@@ -1337,6 +1430,7 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) +@@ -1356,6 +1430,7 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); usb_gadget_disconnect(udc->gadget); @@ -1625448,7 +1625422,7 @@ index 3a3b5a03dda7..a0c281293530 if (udc->gadget->irq) synchronize_irq(udc->gadget->irq); udc->driver->unbind(udc->gadget); -@@ -1416,6 +1510,7 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri +@@ -1435,6 +1510,7 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri driver->unbind(udc->gadget); goto err1; } @@ -1734424,7 +1734398,7 @@ index e7351d64f11f..daf43d1af134 }; /*-------------------------------------------------------------------------*/ -@@ -323,9 +327,13 @@ struct usb_gadget_ops { +@@ -323,6 +327,9 @@ struct usb_gadget_ops { struct usb_gadget_driver *); int (*udc_stop)(struct usb_gadget *); void (*udc_set_speed)(struct usb_gadget *, enum usb_device_speed); @@ -1734434,11 +1734408,7 @@ index e7351d64f11f..daf43d1af134 struct usb_ep *(*match_ep)(struct usb_gadget *, struct usb_endpoint_descriptor *, struct usb_ss_ep_comp_descriptor *); -+ int (*check_config)(struct usb_gadget *gadget); - }; - - /** -@@ -339,6 +347,10 @@ struct usb_gadget_ops { +@@ -340,6 +347,10 @@ struct usb_gadget_ops { * @speed: Speed of current connection to USB host. * @max_speed: Maximal speed the UDC can handle. UDC must support this * and all slower speeds. @@ -1734449,7 +1734419,7 @@ index e7351d64f11f..daf43d1af134 * @state: the state we are now (attached, suspended, configured, etc) * @name: Identifies the controller hardware type. Used in diagnostics * and sometimes configuration. -@@ -406,6 +418,11 @@ struct usb_gadget { +@@ -407,6 +418,11 @@ struct usb_gadget { struct list_head ep_list; /* of usb_ep */ enum usb_device_speed speed; enum usb_device_speed max_speed; @@ -1734461,23 +1734431,6 @@ index e7351d64f11f..daf43d1af134 enum usb_device_state state; const char *name; struct device dev; -@@ -596,6 +613,7 @@ int usb_gadget_connect(struct usb_gadget *gadget); - int usb_gadget_disconnect(struct usb_gadget *gadget); - int usb_gadget_deactivate(struct usb_gadget *gadget); - int usb_gadget_activate(struct usb_gadget *gadget); -+int usb_gadget_check_config(struct usb_gadget *gadget); - #else - static inline int usb_gadget_frame_number(struct usb_gadget *gadget) - { return 0; } -@@ -619,6 +637,8 @@ static inline int usb_gadget_deactivate(struct usb_gadget *gadget) - { return 0; } - static inline int usb_gadget_activate(struct usb_gadget *gadget) - { return 0; } -+static inline int usb_gadget_check_config(struct usb_gadget *gadget) -+{ return 0; } - #endif /* CONFIG_USB_GADGET */ - - /*-------------------------------------------------------------------------*/ diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h index 433040ff840a..96b7ff66f074 100644 --- a/include/linux/usb/pd.h -- Gitee