.. | .. |
---|
8 | 8 | * GRLIB VHDL IP core library. |
---|
9 | 9 | * |
---|
10 | 10 | * 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 |
---|
12 | 12 | * |
---|
13 | 13 | * Contributors: |
---|
14 | 14 | * - Andreas Larsson <andreas@gaisler.com> |
---|
.. | .. |
---|
29 | 29 | #include <linux/list.h> |
---|
30 | 30 | #include <linux/interrupt.h> |
---|
31 | 31 | #include <linux/device.h> |
---|
| 32 | +#include <linux/usb.h> |
---|
32 | 33 | #include <linux/usb/ch9.h> |
---|
33 | 34 | #include <linux/usb/gadget.h> |
---|
34 | 35 | #include <linux/dma-mapping.h> |
---|
.. | .. |
---|
47 | 48 | #define DRIVER_DESC "Aeroflex Gaisler GRUSBDC USB Peripheral Controller" |
---|
48 | 49 | |
---|
49 | 50 | static const char driver_name[] = DRIVER_NAME; |
---|
50 | | -static const char driver_desc[] = DRIVER_DESC; |
---|
51 | 51 | |
---|
52 | 52 | #define gr_read32(x) (ioread32be((x))) |
---|
53 | 53 | #define gr_write32(x, v) (iowrite32be((v), (x))) |
---|
.. | .. |
---|
208 | 208 | { |
---|
209 | 209 | const char *name = "gr_udc_state"; |
---|
210 | 210 | |
---|
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); |
---|
212 | 212 | debugfs_create_file(name, 0444, dev->dfs_root, dev, &gr_dfs_fops); |
---|
213 | 213 | } |
---|
214 | 214 | |
---|
.. | .. |
---|
912 | 912 | return gr_ep0_respond_empty(dev); |
---|
913 | 913 | |
---|
914 | 914 | case USB_DEVICE_TEST_MODE: |
---|
915 | | - /* The hardware does not support TEST_FORCE_EN */ |
---|
| 915 | + /* The hardware does not support USB_TEST_FORCE_ENABLE */ |
---|
916 | 916 | test = index >> 8; |
---|
917 | | - if (test >= TEST_J && test <= TEST_PACKET) { |
---|
| 917 | + if (test >= USB_TEST_J && test <= USB_TEST_PACKET) { |
---|
918 | 918 | dev->test_mode = test; |
---|
919 | 919 | return gr_ep0_respond(dev, NULL, 0, |
---|
920 | 920 | gr_ep0_testmode_complete); |
---|
.. | .. |
---|
2121 | 2121 | static int gr_probe(struct platform_device *pdev) |
---|
2122 | 2122 | { |
---|
2123 | 2123 | struct gr_udc *dev; |
---|
2124 | | - struct resource *res; |
---|
2125 | 2124 | struct gr_regs __iomem *regs; |
---|
2126 | 2125 | int retval; |
---|
2127 | 2126 | u32 status; |
---|
.. | .. |
---|
2131 | 2130 | return -ENOMEM; |
---|
2132 | 2131 | dev->dev = &pdev->dev; |
---|
2133 | 2132 | |
---|
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); |
---|
2136 | 2134 | if (IS_ERR(regs)) |
---|
2137 | 2135 | return PTR_ERR(regs); |
---|
2138 | 2136 | |
---|
2139 | 2137 | 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) |
---|
2142 | 2139 | return -ENODEV; |
---|
2143 | | - } |
---|
2144 | 2140 | |
---|
2145 | 2141 | /* Some core configurations has separate irqs for IN and OUT events */ |
---|
2146 | 2142 | dev->irqi = platform_get_irq(pdev, 1); |
---|
2147 | 2143 | if (dev->irqi > 0) { |
---|
2148 | 2144 | 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) |
---|
2151 | 2146 | return -ENODEV; |
---|
2152 | | - } |
---|
2153 | 2147 | } else { |
---|
2154 | 2148 | dev->irqi = 0; |
---|
2155 | 2149 | } |
---|