forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/usb/gadget/udc/gr_udc.c
....@@ -8,7 +8,7 @@
88 * GRLIB VHDL IP core library.
99 *
1010 * Full documentation of the GRUSBDC core can be found here:
11
- * http://www.gaisler.com/products/grlib/grip.pdf
11
+ * https://www.gaisler.com/products/grlib/grip.pdf
1212 *
1313 * Contributors:
1414 * - Andreas Larsson <andreas@gaisler.com>
....@@ -29,6 +29,7 @@
2929 #include <linux/list.h>
3030 #include <linux/interrupt.h>
3131 #include <linux/device.h>
32
+#include <linux/usb.h>
3233 #include <linux/usb/ch9.h>
3334 #include <linux/usb/gadget.h>
3435 #include <linux/dma-mapping.h>
....@@ -47,7 +48,6 @@
4748 #define DRIVER_DESC "Aeroflex Gaisler GRUSBDC USB Peripheral Controller"
4849
4950 static const char driver_name[] = DRIVER_NAME;
50
-static const char driver_desc[] = DRIVER_DESC;
5151
5252 #define gr_read32(x) (ioread32be((x)))
5353 #define gr_write32(x, v) (iowrite32be((v), (x)))
....@@ -208,7 +208,7 @@
208208 {
209209 const char *name = "gr_udc_state";
210210
211
- dev->dfs_root = debugfs_create_dir(dev_name(dev->dev), NULL);
211
+ dev->dfs_root = debugfs_create_dir(dev_name(dev->dev), usb_debug_root);
212212 debugfs_create_file(name, 0444, dev->dfs_root, dev, &gr_dfs_fops);
213213 }
214214
....@@ -912,9 +912,9 @@
912912 return gr_ep0_respond_empty(dev);
913913
914914 case USB_DEVICE_TEST_MODE:
915
- /* The hardware does not support TEST_FORCE_EN */
915
+ /* The hardware does not support USB_TEST_FORCE_ENABLE */
916916 test = index >> 8;
917
- if (test >= TEST_J && test <= TEST_PACKET) {
917
+ if (test >= USB_TEST_J && test <= USB_TEST_PACKET) {
918918 dev->test_mode = test;
919919 return gr_ep0_respond(dev, NULL, 0,
920920 gr_ep0_testmode_complete);
....@@ -2121,7 +2121,6 @@
21212121 static int gr_probe(struct platform_device *pdev)
21222122 {
21232123 struct gr_udc *dev;
2124
- struct resource *res;
21252124 struct gr_regs __iomem *regs;
21262125 int retval;
21272126 u32 status;
....@@ -2131,25 +2130,20 @@
21312130 return -ENOMEM;
21322131 dev->dev = &pdev->dev;
21332132
2134
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2135
- regs = devm_ioremap_resource(dev->dev, res);
2133
+ regs = devm_platform_ioremap_resource(pdev, 0);
21362134 if (IS_ERR(regs))
21372135 return PTR_ERR(regs);
21382136
21392137 dev->irq = platform_get_irq(pdev, 0);
2140
- if (dev->irq <= 0) {
2141
- dev_err(dev->dev, "No irq found\n");
2138
+ if (dev->irq <= 0)
21422139 return -ENODEV;
2143
- }
21442140
21452141 /* Some core configurations has separate irqs for IN and OUT events */
21462142 dev->irqi = platform_get_irq(pdev, 1);
21472143 if (dev->irqi > 0) {
21482144 dev->irqo = platform_get_irq(pdev, 2);
2149
- if (dev->irqo <= 0) {
2150
- dev_err(dev->dev, "Found irqi but not irqo\n");
2145
+ if (dev->irqo <= 0)
21512146 return -ENODEV;
2152
- }
21532147 } else {
21542148 dev->irqi = 0;
21552149 }