| .. | .. |
|---|
| 26 | 26 | #include <linux/seq_file.h> |
|---|
| 27 | 27 | #include <linux/slab.h> |
|---|
| 28 | 28 | #include <linux/timer.h> |
|---|
| 29 | +#include <linux/usb.h> |
|---|
| 29 | 30 | #include <linux/usb/ch9.h> |
|---|
| 30 | 31 | #include <linux/usb/gadget.h> |
|---|
| 31 | 32 | #include <linux/workqueue.h> |
|---|
| .. | .. |
|---|
| 266 | 267 | * @pd: Platform data (board/port info). |
|---|
| 267 | 268 | * @usbd_clk: Clock descriptor for the USB device block. |
|---|
| 268 | 269 | * @usbh_clk: Clock descriptor for the USB host block. |
|---|
| 269 | | - * @gadget: USB slave device. |
|---|
| 270 | | - * @driver: Driver for USB slave devices. |
|---|
| 270 | + * @gadget: USB device. |
|---|
| 271 | + * @driver: Driver for USB device. |
|---|
| 271 | 272 | * @usbd_regs: Base address of the USBD/USB20D block. |
|---|
| 272 | 273 | * @iudma_regs: Base address of the USBD's associated IUDMA block. |
|---|
| 273 | 274 | * @bep: Array of endpoints, including ep0. |
|---|
| .. | .. |
|---|
| 1744 | 1745 | |
|---|
| 1745 | 1746 | /** |
|---|
| 1746 | 1747 | * bcm63xx_udc_get_frame - Read current SOF frame number from the HW. |
|---|
| 1747 | | - * @gadget: USB slave device. |
|---|
| 1748 | + * @gadget: USB device. |
|---|
| 1748 | 1749 | */ |
|---|
| 1749 | 1750 | static int bcm63xx_udc_get_frame(struct usb_gadget *gadget) |
|---|
| 1750 | 1751 | { |
|---|
| .. | .. |
|---|
| 1756 | 1757 | |
|---|
| 1757 | 1758 | /** |
|---|
| 1758 | 1759 | * bcm63xx_udc_pullup - Enable/disable pullup on D+ line. |
|---|
| 1759 | | - * @gadget: USB slave device. |
|---|
| 1760 | + * @gadget: USB device. |
|---|
| 1760 | 1761 | * @is_on: 0 to disable pullup, 1 to enable. |
|---|
| 1761 | 1762 | * |
|---|
| 1762 | 1763 | * See notes in bcm63xx_select_pullup(). |
|---|
| .. | .. |
|---|
| 1805 | 1806 | |
|---|
| 1806 | 1807 | /** |
|---|
| 1807 | 1808 | * bcm63xx_udc_start - Start the controller. |
|---|
| 1808 | | - * @gadget: USB slave device. |
|---|
| 1809 | | - * @driver: Driver for USB slave devices. |
|---|
| 1809 | + * @gadget: USB device. |
|---|
| 1810 | + * @driver: Driver for USB device. |
|---|
| 1810 | 1811 | */ |
|---|
| 1811 | 1812 | static int bcm63xx_udc_start(struct usb_gadget *gadget, |
|---|
| 1812 | 1813 | struct usb_gadget_driver *driver) |
|---|
| .. | .. |
|---|
| 1842 | 1843 | |
|---|
| 1843 | 1844 | /** |
|---|
| 1844 | 1845 | * bcm63xx_udc_stop - Shut down the controller. |
|---|
| 1845 | | - * @gadget: USB slave device. |
|---|
| 1846 | | - * @driver: Driver for USB slave devices. |
|---|
| 1846 | + * @gadget: USB device. |
|---|
| 1847 | + * @driver: Driver for USB device. |
|---|
| 1847 | 1848 | */ |
|---|
| 1848 | 1849 | static int bcm63xx_udc_stop(struct usb_gadget *gadget) |
|---|
| 1849 | 1850 | { |
|---|
| .. | .. |
|---|
| 2248 | 2249 | if (!IS_ENABLED(CONFIG_USB_GADGET_DEBUG_FS)) |
|---|
| 2249 | 2250 | return; |
|---|
| 2250 | 2251 | |
|---|
| 2251 | | - root = debugfs_create_dir(udc->gadget.name, NULL); |
|---|
| 2252 | + root = debugfs_create_dir(udc->gadget.name, usb_debug_root); |
|---|
| 2252 | 2253 | udc->debugfs_root = root; |
|---|
| 2253 | 2254 | |
|---|
| 2254 | 2255 | debugfs_create_file("usbd", 0400, root, udc, &bcm63xx_usbd_dbg_fops); |
|---|
| .. | .. |
|---|
| 2282 | 2283 | struct device *dev = &pdev->dev; |
|---|
| 2283 | 2284 | struct bcm63xx_usbd_platform_data *pd = dev_get_platdata(dev); |
|---|
| 2284 | 2285 | struct bcm63xx_udc *udc; |
|---|
| 2285 | | - struct resource *res; |
|---|
| 2286 | 2286 | int rc = -ENOMEM, i, irq; |
|---|
| 2287 | 2287 | |
|---|
| 2288 | 2288 | udc = devm_kzalloc(dev, sizeof(*udc), GFP_KERNEL); |
|---|
| .. | .. |
|---|
| 2298 | 2298 | return -EINVAL; |
|---|
| 2299 | 2299 | } |
|---|
| 2300 | 2300 | |
|---|
| 2301 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 2302 | | - udc->usbd_regs = devm_ioremap_resource(dev, res); |
|---|
| 2301 | + udc->usbd_regs = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 2303 | 2302 | if (IS_ERR(udc->usbd_regs)) |
|---|
| 2304 | 2303 | return PTR_ERR(udc->usbd_regs); |
|---|
| 2305 | 2304 | |
|---|
| 2306 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
|---|
| 2307 | | - udc->iudma_regs = devm_ioremap_resource(dev, res); |
|---|
| 2305 | + udc->iudma_regs = devm_platform_ioremap_resource(pdev, 1); |
|---|
| 2308 | 2306 | if (IS_ERR(udc->iudma_regs)) |
|---|
| 2309 | 2307 | return PTR_ERR(udc->iudma_regs); |
|---|
| 2310 | 2308 | |
|---|
| .. | .. |
|---|
| 2328 | 2326 | |
|---|
| 2329 | 2327 | /* IRQ resource #0: control interrupt (VBUS, speed, etc.) */ |
|---|
| 2330 | 2328 | irq = platform_get_irq(pdev, 0); |
|---|
| 2331 | | - if (irq < 0) { |
|---|
| 2332 | | - dev_err(dev, "missing IRQ resource #0\n"); |
|---|
| 2329 | + if (irq < 0) |
|---|
| 2333 | 2330 | goto out_uninit; |
|---|
| 2334 | | - } |
|---|
| 2335 | 2331 | if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0, |
|---|
| 2336 | 2332 | dev_name(dev), udc) < 0) |
|---|
| 2337 | 2333 | goto report_request_failure; |
|---|
| .. | .. |
|---|
| 2339 | 2335 | /* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */ |
|---|
| 2340 | 2336 | for (i = 0; i < BCM63XX_NUM_IUDMA; i++) { |
|---|
| 2341 | 2337 | irq = platform_get_irq(pdev, i + 1); |
|---|
| 2342 | | - if (irq < 0) { |
|---|
| 2343 | | - dev_err(dev, "missing IRQ resource #%d\n", i + 1); |
|---|
| 2338 | + if (irq < 0) |
|---|
| 2344 | 2339 | goto out_uninit; |
|---|
| 2345 | | - } |
|---|
| 2346 | 2340 | if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0, |
|---|
| 2347 | 2341 | dev_name(dev), &udc->iudma[i]) < 0) |
|---|
| 2348 | 2342 | goto report_request_failure; |
|---|