gemini: Add kernel v6.1 patches
[openwrt/staging/mans0n.git] / target / linux / gemini / patches-6.1 / 0020-usb-fotg210-udc-Assign-of_node-and-speed-on-start.patch
1 From d7c2b0b6da75b86cf5ddbcd51a74d74e19bbf178 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Wed, 18 Jan 2023 08:09:20 +0100
4 Subject: [PATCH 20/29] usb: fotg210-udc: Assign of_node and speed on start
5
6 Follow the example set by other drivers to assign of_node
7 and speed to the driver when binding, also print bound
8 info akin to other UDC drivers.
9
10 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 Link: https://lore.kernel.org/r/20230103-gemini-fotg210-usb-v2-6-100388af9810@linaro.org
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 --- a/drivers/usb/fotg210/fotg210-udc.c
15 +++ b/drivers/usb/fotg210/fotg210-udc.c
16 @@ -1028,6 +1028,10 @@ static int fotg210_udc_start(struct usb_
17
18 /* hook up the driver */
19 fotg210->driver = driver;
20 + fotg210->gadget.dev.of_node = fotg210->dev->of_node;
21 + fotg210->gadget.speed = USB_SPEED_UNKNOWN;
22 +
23 + dev_info(fotg210->dev, "bound driver %s\n", driver->driver.name);
24
25 if (!IS_ERR_OR_NULL(fotg210->phy)) {
26 ret = otg_set_peripheral(fotg210->phy->otg,
27 @@ -1084,6 +1088,7 @@ static int fotg210_udc_stop(struct usb_g
28
29 fotg210_init(fotg210);
30 fotg210->driver = NULL;
31 + fotg210->gadget.speed = USB_SPEED_UNKNOWN;
32
33 spin_unlock_irqrestore(&fotg210->lock, flags);
34