Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull more USB fixes from Greg Kroah-Hartman:
"Here are some more USB fixes for the 3.8-rc4 tree.

Some gadget driver fixes, and finally resolved the ehci-mxc driver
build issues (it's just some code moving around and being deleted)."

* tag 'usb-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: EHCI: fix build error in ehci-mxc
USB: EHCI: add a name for the platform-private field
USB: EHCI: fix incorrect configuration test
USB: EHCI: Move definition of EHCI_STATS to ehci.h
USB: UHCI: fix IRQ race during initialization
usb: gadget: FunctionFS: Fix missing braces in parse_opts
usb: dwc3: gadget: fix ep->maxburst for ep0
ARM: i.MX clock: Change the connection-id for fsl-usb2-udc
usb: gadget: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremap
usb: gadget: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id
usb: musb: cppi_dma: drop '__init' annotation

+154 -147
+3 -3
arch/arm/mach-imx/clk-imx25.c
··· 254 254 clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2"); 255 255 clk_register_clkdev(clk[usbotg_ahb], "ahb", "mxc-ehci.2"); 256 256 clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.2"); 257 - clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc"); 258 - clk_register_clkdev(clk[usbotg_ahb], "ahb", "fsl-usb2-udc"); 259 - clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc"); 257 + clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27"); 258 + clk_register_clkdev(clk[usbotg_ahb], "ahb", "imx-udc-mx27"); 259 + clk_register_clkdev(clk[usb_div], "per", "imx-udc-mx27"); 260 260 clk_register_clkdev(clk[nfc_ipg_per], NULL, "imx25-nand.0"); 261 261 /* i.mx25 has the i.mx35 type cspi */ 262 262 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0");
+3 -3
arch/arm/mach-imx/clk-imx27.c
··· 236 236 clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx21-fb.0"); 237 237 clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0"); 238 238 clk_register_clkdev(clk[per4_gate], "per", "imx27-camera.0"); 239 - clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc"); 240 - clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc"); 241 - clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc"); 239 + clk_register_clkdev(clk[usb_div], "per", "imx-udc-mx27"); 240 + clk_register_clkdev(clk[usb_ipg_gate], "ipg", "imx-udc-mx27"); 241 + clk_register_clkdev(clk[usb_ahb_gate], "ahb", "imx-udc-mx27"); 242 242 clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0"); 243 243 clk_register_clkdev(clk[usb_ipg_gate], "ipg", "mxc-ehci.0"); 244 244 clk_register_clkdev(clk[usb_ahb_gate], "ahb", "mxc-ehci.0");
+3 -3
arch/arm/mach-imx/clk-imx31.c
··· 139 139 clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.2"); 140 140 clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.2"); 141 141 clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2"); 142 - clk_register_clkdev(clk[usb_div_post], "per", "fsl-usb2-udc"); 143 - clk_register_clkdev(clk[usb_gate], "ahb", "fsl-usb2-udc"); 144 - clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc"); 142 + clk_register_clkdev(clk[usb_div_post], "per", "imx-udc-mx27"); 143 + clk_register_clkdev(clk[usb_gate], "ahb", "imx-udc-mx27"); 144 + clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27"); 145 145 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0"); 146 146 /* i.mx31 has the i.mx21 type uart */ 147 147 clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
+3 -3
arch/arm/mach-imx/clk-imx35.c
··· 251 251 clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.2"); 252 252 clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2"); 253 253 clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.2"); 254 - clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc"); 255 - clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc"); 256 - clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc"); 254 + clk_register_clkdev(clk[usb_div], "per", "imx-udc-mx27"); 255 + clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27"); 256 + clk_register_clkdev(clk[usbotg_gate], "ahb", "imx-udc-mx27"); 257 257 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 258 258 clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0"); 259 259 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
+3 -3
arch/arm/mach-imx/clk-imx51-imx53.c
··· 269 269 clk_register_clkdev(clk[usboh3_per_gate], "per", "mxc-ehci.2"); 270 270 clk_register_clkdev(clk[usboh3_gate], "ipg", "mxc-ehci.2"); 271 271 clk_register_clkdev(clk[usboh3_gate], "ahb", "mxc-ehci.2"); 272 - clk_register_clkdev(clk[usboh3_per_gate], "per", "fsl-usb2-udc"); 273 - clk_register_clkdev(clk[usboh3_gate], "ipg", "fsl-usb2-udc"); 274 - clk_register_clkdev(clk[usboh3_gate], "ahb", "fsl-usb2-udc"); 272 + clk_register_clkdev(clk[usboh3_per_gate], "per", "imx-udc-mx51"); 273 + clk_register_clkdev(clk[usboh3_gate], "ipg", "imx-udc-mx51"); 274 + clk_register_clkdev(clk[usboh3_gate], "ahb", "imx-udc-mx51"); 275 275 clk_register_clkdev(clk[nfc_gate], NULL, "imx51-nand"); 276 276 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); 277 277 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
+1
arch/arm/mach-imx/devices/devices-common.h
··· 63 63 64 64 #include <linux/fsl_devices.h> 65 65 struct imx_fsl_usb2_udc_data { 66 + const char *devid; 66 67 resource_size_t iobase; 67 68 resource_size_t irq; 68 69 };
+8 -7
arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
··· 11 11 #include "../hardware.h" 12 12 #include "devices-common.h" 13 13 14 - #define imx_fsl_usb2_udc_data_entry_single(soc) \ 14 + #define imx_fsl_usb2_udc_data_entry_single(soc, _devid) \ 15 15 { \ 16 + .devid = _devid, \ 16 17 .iobase = soc ## _USB_OTG_BASE_ADDR, \ 17 18 .irq = soc ## _INT_USB_OTG, \ 18 19 } 19 20 20 21 #ifdef CONFIG_SOC_IMX25 21 22 const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst = 22 - imx_fsl_usb2_udc_data_entry_single(MX25); 23 + imx_fsl_usb2_udc_data_entry_single(MX25, "imx-udc-mx27"); 23 24 #endif /* ifdef CONFIG_SOC_IMX25 */ 24 25 25 26 #ifdef CONFIG_SOC_IMX27 26 27 const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst = 27 - imx_fsl_usb2_udc_data_entry_single(MX27); 28 + imx_fsl_usb2_udc_data_entry_single(MX27, "imx-udc-mx27"); 28 29 #endif /* ifdef CONFIG_SOC_IMX27 */ 29 30 30 31 #ifdef CONFIG_SOC_IMX31 31 32 const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst = 32 - imx_fsl_usb2_udc_data_entry_single(MX31); 33 + imx_fsl_usb2_udc_data_entry_single(MX31, "imx-udc-mx27"); 33 34 #endif /* ifdef CONFIG_SOC_IMX31 */ 34 35 35 36 #ifdef CONFIG_SOC_IMX35 36 37 const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst = 37 - imx_fsl_usb2_udc_data_entry_single(MX35); 38 + imx_fsl_usb2_udc_data_entry_single(MX35, "imx-udc-mx27"); 38 39 #endif /* ifdef CONFIG_SOC_IMX35 */ 39 40 40 41 #ifdef CONFIG_SOC_IMX51 41 42 const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data __initconst = 42 - imx_fsl_usb2_udc_data_entry_single(MX51); 43 + imx_fsl_usb2_udc_data_entry_single(MX51, "imx-udc-mx51"); 43 44 #endif 44 45 45 46 struct platform_device *__init imx_add_fsl_usb2_udc( ··· 58 57 .flags = IORESOURCE_IRQ, 59 58 }, 60 59 }; 61 - return imx_add_platform_device_dmamask("fsl-usb2-udc", -1, 60 + return imx_add_platform_device_dmamask(data->devid, -1, 62 61 res, ARRAY_SIZE(res), 63 62 pdata, sizeof(*pdata), DMA_BIT_MASK(32)); 64 63 }
+1
drivers/usb/dwc3/gadget.c
··· 1605 1605 1606 1606 if (epnum == 0 || epnum == 1) { 1607 1607 dep->endpoint.maxpacket = 512; 1608 + dep->endpoint.maxburst = 1; 1608 1609 dep->endpoint.ops = &dwc3_gadget_ep0_ops; 1609 1610 if (!epnum) 1610 1611 dwc->gadget.ep0 = &dep->endpoint;
+3 -3
drivers/usb/gadget/f_fs.c
··· 1153 1153 pr_err("%s: unmapped value: %lu\n", opts, value); 1154 1154 return -EINVAL; 1155 1155 } 1156 - } 1157 - else if (!memcmp(opts, "gid", 3)) 1156 + } else if (!memcmp(opts, "gid", 3)) { 1158 1157 data->perms.gid = make_kgid(current_user_ns(), value); 1159 1158 if (!gid_valid(data->perms.gid)) { 1160 1159 pr_err("%s: unmapped value: %lu\n", opts, value); 1161 1160 return -EINVAL; 1162 1161 } 1163 - else 1162 + } else { 1164 1163 goto invalid; 1164 + } 1165 1165 break; 1166 1166 1167 1167 default:
+26 -14
drivers/usb/gadget/fsl_mxc_udc.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <linux/io.h> 20 20 21 - #include <mach/hardware.h> 22 - 23 21 static struct clk *mxc_ahb_clk; 24 22 static struct clk *mxc_per_clk; 25 23 static struct clk *mxc_ipg_clk; 26 24 27 25 /* workaround ENGcm09152 for i.MX35 */ 28 - #define USBPHYCTRL_OTGBASE_OFFSET 0x608 26 + #define MX35_USBPHYCTRL_OFFSET 0x600 27 + #define USBPHYCTRL_OTGBASE_OFFSET 0x8 29 28 #define USBPHYCTRL_EVDO (1 << 23) 30 29 31 30 int fsl_udc_clk_init(struct platform_device *pdev) ··· 58 59 clk_prepare_enable(mxc_per_clk); 59 60 60 61 /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ 61 - if (!cpu_is_mx51()) { 62 + if (!strcmp(pdev->id_entry->name, "imx-udc-mx27")) { 62 63 freq = clk_get_rate(mxc_per_clk); 63 64 if (pdata->phy_mode != FSL_USB2_PHY_ULPI && 64 65 (freq < 59999000 || freq > 60001000)) { ··· 78 79 return ret; 79 80 } 80 81 81 - void fsl_udc_clk_finalize(struct platform_device *pdev) 82 + int fsl_udc_clk_finalize(struct platform_device *pdev) 82 83 { 83 84 struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; 84 - if (cpu_is_mx35()) { 85 - unsigned int v; 85 + int ret = 0; 86 86 87 - /* workaround ENGcm09152 for i.MX35 */ 88 - if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) { 89 - v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + 90 - USBPHYCTRL_OTGBASE_OFFSET)); 91 - writel(v | USBPHYCTRL_EVDO, 92 - MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + 93 - USBPHYCTRL_OTGBASE_OFFSET)); 87 + /* workaround ENGcm09152 for i.MX35 */ 88 + if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) { 89 + unsigned int v; 90 + struct resource *res = platform_get_resource 91 + (pdev, IORESOURCE_MEM, 0); 92 + void __iomem *phy_regs = ioremap(res->start + 93 + MX35_USBPHYCTRL_OFFSET, 512); 94 + if (!phy_regs) { 95 + dev_err(&pdev->dev, "ioremap for phy address fails\n"); 96 + ret = -EINVAL; 97 + goto ioremap_err; 94 98 } 99 + 100 + v = readl(phy_regs + USBPHYCTRL_OTGBASE_OFFSET); 101 + writel(v | USBPHYCTRL_EVDO, 102 + phy_regs + USBPHYCTRL_OTGBASE_OFFSET); 103 + 104 + iounmap(phy_regs); 95 105 } 96 106 107 + 108 + ioremap_err: 97 109 /* ULPI transceivers don't need usbpll */ 98 110 if (pdata->phy_mode == FSL_USB2_PHY_ULPI) { 99 111 clk_disable_unprepare(mxc_per_clk); 100 112 mxc_per_clk = NULL; 101 113 } 114 + 115 + return ret; 102 116 } 103 117 104 118 void fsl_udc_clk_release(void)
+25 -17
drivers/usb/gadget/fsl_udc_core.c
··· 41 41 #include <linux/fsl_devices.h> 42 42 #include <linux/dmapool.h> 43 43 #include <linux/delay.h> 44 + #include <linux/of_device.h> 44 45 45 46 #include <asm/byteorder.h> 46 47 #include <asm/io.h> ··· 2439 2438 unsigned int i; 2440 2439 u32 dccparams; 2441 2440 2442 - if (strcmp(pdev->name, driver_name)) { 2443 - VDBG("Wrong device"); 2444 - return -ENODEV; 2445 - } 2446 - 2447 2441 udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL); 2448 2442 if (udc_controller == NULL) { 2449 2443 ERR("malloc udc failed\n"); ··· 2543 2547 dr_controller_setup(udc_controller); 2544 2548 } 2545 2549 2546 - fsl_udc_clk_finalize(pdev); 2550 + ret = fsl_udc_clk_finalize(pdev); 2551 + if (ret) 2552 + goto err_free_irq; 2547 2553 2548 2554 /* Setup gadget structure */ 2549 2555 udc_controller->gadget.ops = &fsl_gadget_ops; ··· 2754 2756 2755 2757 return fsl_udc_resume(NULL); 2756 2758 } 2757 - 2758 2759 /*------------------------------------------------------------------------- 2759 2760 Register entry point for the peripheral controller driver 2760 2761 --------------------------------------------------------------------------*/ 2761 - 2762 + static const struct platform_device_id fsl_udc_devtype[] = { 2763 + { 2764 + .name = "imx-udc-mx27", 2765 + }, { 2766 + .name = "imx-udc-mx51", 2767 + }, { 2768 + /* sentinel */ 2769 + } 2770 + }; 2771 + MODULE_DEVICE_TABLE(platform, fsl_udc_devtype); 2762 2772 static struct platform_driver udc_driver = { 2763 - .remove = __exit_p(fsl_udc_remove), 2773 + .remove = __exit_p(fsl_udc_remove), 2774 + /* Just for FSL i.mx SoC currently */ 2775 + .id_table = fsl_udc_devtype, 2764 2776 /* these suspend and resume are not usb suspend and resume */ 2765 - .suspend = fsl_udc_suspend, 2766 - .resume = fsl_udc_resume, 2767 - .driver = { 2768 - .name = (char *)driver_name, 2769 - .owner = THIS_MODULE, 2770 - /* udc suspend/resume called from OTG driver */ 2771 - .suspend = fsl_udc_otg_suspend, 2772 - .resume = fsl_udc_otg_resume, 2777 + .suspend = fsl_udc_suspend, 2778 + .resume = fsl_udc_resume, 2779 + .driver = { 2780 + .name = (char *)driver_name, 2781 + .owner = THIS_MODULE, 2782 + /* udc suspend/resume called from OTG driver */ 2783 + .suspend = fsl_udc_otg_suspend, 2784 + .resume = fsl_udc_otg_resume, 2773 2785 }, 2774 2786 }; 2775 2787
+3 -2
drivers/usb/gadget/fsl_usb2_udc.h
··· 592 592 struct platform_device; 593 593 #ifdef CONFIG_ARCH_MXC 594 594 int fsl_udc_clk_init(struct platform_device *pdev); 595 - void fsl_udc_clk_finalize(struct platform_device *pdev); 595 + int fsl_udc_clk_finalize(struct platform_device *pdev); 596 596 void fsl_udc_clk_release(void); 597 597 #else 598 598 static inline int fsl_udc_clk_init(struct platform_device *pdev) 599 599 { 600 600 return 0; 601 601 } 602 - static inline void fsl_udc_clk_finalize(struct platform_device *pdev) 602 + static inline int fsl_udc_clk_finalize(struct platform_device *pdev) 603 603 { 604 + return 0; 604 605 } 605 606 static inline void fsl_udc_clk_release(void) 606 607 {
+1 -1
drivers/usb/host/Kconfig
··· 148 148 Variation of ARC USB block used in some Freescale chips. 149 149 150 150 config USB_EHCI_MXC 151 - bool "Support for Freescale i.MX on-chip EHCI USB controller" 151 + tristate "Support for Freescale i.MX on-chip EHCI USB controller" 152 152 depends on USB_EHCI_HCD && ARCH_MXC 153 153 select USB_EHCI_ROOT_HUB_TT 154 154 ---help---
+1
drivers/usb/host/Makefile
··· 26 26 obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o 27 27 obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o 28 28 obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o 29 + obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o 29 30 30 31 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o 31 32 obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
+2 -10
drivers/usb/host/ehci-hcd.c
··· 74 74 #undef VERBOSE_DEBUG 75 75 #undef EHCI_URB_TRACE 76 76 77 - #ifdef DEBUG 78 - #define EHCI_STATS 79 - #endif 80 - 81 77 /* magic numbers that can affect system performance */ 82 78 #define EHCI_TUNE_CERR 3 /* 0-3 qtd retries; 0 == don't stop */ 83 79 #define EHCI_TUNE_RL_HS 4 /* nak throttle; see 4.9 */ ··· 1246 1250 #define PLATFORM_DRIVER ehci_fsl_driver 1247 1251 #endif 1248 1252 1249 - #ifdef CONFIG_USB_EHCI_MXC 1250 - #include "ehci-mxc.c" 1251 - #define PLATFORM_DRIVER ehci_mxc_driver 1252 - #endif 1253 - 1254 1253 #ifdef CONFIG_USB_EHCI_SH 1255 1254 #include "ehci-sh.c" 1256 1255 #define PLATFORM_DRIVER ehci_hcd_sh_driver ··· 1343 1352 1344 1353 #if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \ 1345 1354 !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \ 1346 - !defined(CONFIG_USB_CHIPIDEA_HOST) && \ 1355 + !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ 1356 + !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ 1347 1357 !defined(PLATFORM_DRIVER) && \ 1348 1358 !defined(PS3_SYSTEM_BUS_DRIVER) && \ 1349 1359 !defined(OF_PLATFORM_DRIVER) && \
+50 -70
drivers/usb/host/ehci-mxc.c
··· 17 17 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 18 */ 19 19 20 + #include <linux/kernel.h> 21 + #include <linux/module.h> 22 + #include <linux/io.h> 20 23 #include <linux/platform_device.h> 21 24 #include <linux/clk.h> 22 25 #include <linux/delay.h> 23 26 #include <linux/usb/otg.h> 24 27 #include <linux/usb/ulpi.h> 25 28 #include <linux/slab.h> 29 + #include <linux/usb.h> 30 + #include <linux/usb/hcd.h> 26 31 27 32 #include <linux/platform_data/usb-ehci-mxc.h> 28 33 29 34 #include <asm/mach-types.h> 30 35 36 + #include "ehci.h" 37 + 38 + #define DRIVER_DESC "Freescale On-Chip EHCI Host driver" 39 + 40 + static const char hcd_name[] = "ehci-mxc"; 41 + 31 42 #define ULPI_VIEWPORT_OFFSET 0x170 32 43 33 44 struct ehci_mxc_priv { 34 45 struct clk *usbclk, *ahbclk, *phyclk; 35 - struct usb_hcd *hcd; 36 46 }; 37 47 38 - /* called during probe() after chip reset completes */ 39 - static int ehci_mxc_setup(struct usb_hcd *hcd) 40 - { 41 - hcd->has_tt = 1; 48 + static struct hc_driver __read_mostly ehci_mxc_hc_driver; 42 49 43 - return ehci_setup(hcd); 44 - } 45 - 46 - static const struct hc_driver ehci_mxc_hc_driver = { 47 - .description = hcd_name, 48 - .product_desc = "Freescale On-Chip EHCI Host Controller", 49 - .hcd_priv_size = sizeof(struct ehci_hcd), 50 - 51 - /* 52 - * generic hardware linkage 53 - */ 54 - .irq = ehci_irq, 55 - .flags = HCD_USB2 | HCD_MEMORY, 56 - 57 - /* 58 - * basic lifecycle operations 59 - */ 60 - .reset = ehci_mxc_setup, 61 - .start = ehci_run, 62 - .stop = ehci_stop, 63 - .shutdown = ehci_shutdown, 64 - 65 - /* 66 - * managing i/o requests and associated device resources 67 - */ 68 - .urb_enqueue = ehci_urb_enqueue, 69 - .urb_dequeue = ehci_urb_dequeue, 70 - .endpoint_disable = ehci_endpoint_disable, 71 - .endpoint_reset = ehci_endpoint_reset, 72 - 73 - /* 74 - * scheduling support 75 - */ 76 - .get_frame_number = ehci_get_frame, 77 - 78 - /* 79 - * root hub support 80 - */ 81 - .hub_status_data = ehci_hub_status_data, 82 - .hub_control = ehci_hub_control, 83 - .bus_suspend = ehci_bus_suspend, 84 - .bus_resume = ehci_bus_resume, 85 - .relinquish_port = ehci_relinquish_port, 86 - .port_handed_over = ehci_port_handed_over, 87 - 88 - .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, 50 + static const struct ehci_driver_overrides ehci_mxc_overrides __initdata = { 51 + .extra_priv_size = sizeof(struct ehci_mxc_priv), 89 52 }; 90 53 91 54 static int ehci_mxc_drv_probe(struct platform_device *pdev) ··· 75 112 if (!hcd) 76 113 return -ENOMEM; 77 114 78 - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 79 - if (!priv) { 80 - ret = -ENOMEM; 81 - goto err_alloc; 82 - } 83 - 84 115 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 85 116 if (!res) { 86 117 dev_err(dev, "Found HC with no register addr. Check setup!\n"); ··· 91 134 ret = -EFAULT; 92 135 goto err_alloc; 93 136 } 137 + 138 + hcd->has_tt = 1; 139 + ehci = hcd_to_ehci(hcd); 140 + priv = (struct ehci_mxc_priv *) ehci->priv; 94 141 95 142 /* enable clocks */ 96 143 priv->usbclk = devm_clk_get(&pdev->dev, "ipg"); ··· 130 169 mdelay(10); 131 170 } 132 171 133 - ehci = hcd_to_ehci(hcd); 134 - 135 172 /* EHCI registers start at offset 0x100 */ 136 173 ehci->caps = hcd->regs + 0x100; 137 174 ehci->regs = hcd->regs + 0x100 + ··· 157 198 } 158 199 } 159 200 160 - priv->hcd = hcd; 161 - platform_set_drvdata(pdev, priv); 201 + platform_set_drvdata(pdev, hcd); 162 202 163 203 ret = usb_add_hcd(hcd, irq, IRQF_SHARED); 164 204 if (ret) ··· 202 244 static int __exit ehci_mxc_drv_remove(struct platform_device *pdev) 203 245 { 204 246 struct mxc_usbh_platform_data *pdata = pdev->dev.platform_data; 205 - struct ehci_mxc_priv *priv = platform_get_drvdata(pdev); 206 - struct usb_hcd *hcd = priv->hcd; 247 + struct usb_hcd *hcd = platform_get_drvdata(pdev); 248 + struct ehci_hcd *ehci = hcd_to_ehci(hcd); 249 + struct ehci_mxc_priv *priv = (struct ehci_mxc_priv *) ehci->priv; 250 + 251 + usb_remove_hcd(hcd); 207 252 208 253 if (pdata && pdata->exit) 209 254 pdata->exit(pdev); ··· 214 253 if (pdata->otg) 215 254 usb_phy_shutdown(pdata->otg); 216 255 217 - usb_remove_hcd(hcd); 218 - usb_put_hcd(hcd); 219 - platform_set_drvdata(pdev, NULL); 220 - 221 256 clk_disable_unprepare(priv->usbclk); 222 257 clk_disable_unprepare(priv->ahbclk); 223 258 224 259 if (priv->phyclk) 225 260 clk_disable_unprepare(priv->phyclk); 226 261 262 + usb_put_hcd(hcd); 263 + platform_set_drvdata(pdev, NULL); 227 264 return 0; 228 265 } 229 266 230 267 static void ehci_mxc_drv_shutdown(struct platform_device *pdev) 231 268 { 232 - struct ehci_mxc_priv *priv = platform_get_drvdata(pdev); 233 - struct usb_hcd *hcd = priv->hcd; 269 + struct usb_hcd *hcd = platform_get_drvdata(pdev); 234 270 235 271 if (hcd->driver->shutdown) 236 272 hcd->driver->shutdown(hcd); ··· 237 279 238 280 static struct platform_driver ehci_mxc_driver = { 239 281 .probe = ehci_mxc_drv_probe, 240 - .remove = __exit_p(ehci_mxc_drv_remove), 282 + .remove = ehci_mxc_drv_remove, 241 283 .shutdown = ehci_mxc_drv_shutdown, 242 284 .driver = { 243 285 .name = "mxc-ehci", 244 286 }, 245 287 }; 288 + 289 + static int __init ehci_mxc_init(void) 290 + { 291 + if (usb_disabled()) 292 + return -ENODEV; 293 + 294 + pr_info("%s: " DRIVER_DESC "\n", hcd_name); 295 + 296 + ehci_init_driver(&ehci_mxc_hc_driver, &ehci_mxc_overrides); 297 + return platform_driver_register(&ehci_mxc_driver); 298 + } 299 + module_init(ehci_mxc_init); 300 + 301 + static void __exit ehci_mxc_cleanup(void) 302 + { 303 + platform_driver_unregister(&ehci_mxc_driver); 304 + } 305 + module_exit(ehci_mxc_cleanup); 306 + 307 + MODULE_DESCRIPTION(DRIVER_DESC); 308 + MODULE_AUTHOR("Sascha Hauer"); 309 + MODULE_LICENSE("GPL");
+7
drivers/usb/host/ehci.h
··· 38 38 #endif 39 39 40 40 /* statistics can be kept for tuning/monitoring */ 41 + #ifdef DEBUG 42 + #define EHCI_STATS 43 + #endif 44 + 41 45 struct ehci_stats { 42 46 /* irq usage */ 43 47 unsigned long normal; ··· 225 221 #ifdef DEBUG 226 222 struct dentry *debug_dir; 227 223 #endif 224 + 225 + /* platform-specific data -- must come last */ 226 + unsigned long priv[0] __aligned(sizeof(s64)); 228 227 }; 229 228 230 229 /* convert between an HCD pointer and the corresponding EHCI_HCD */
+9 -6
drivers/usb/host/uhci-hcd.c
··· 447 447 return IRQ_NONE; 448 448 uhci_writew(uhci, status, USBSTS); /* Clear it */ 449 449 450 + spin_lock(&uhci->lock); 451 + if (unlikely(!uhci->is_initialized)) /* not yet configured */ 452 + goto done; 453 + 450 454 if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) { 451 455 if (status & USBSTS_HSE) 452 456 dev_err(uhci_dev(uhci), "host system error, " ··· 459 455 dev_err(uhci_dev(uhci), "host controller process " 460 456 "error, something bad happened!\n"); 461 457 if (status & USBSTS_HCH) { 462 - spin_lock(&uhci->lock); 463 458 if (uhci->rh_state >= UHCI_RH_RUNNING) { 464 459 dev_err(uhci_dev(uhci), 465 460 "host controller halted, " ··· 476 473 * pending unlinks */ 477 474 mod_timer(&hcd->rh_timer, jiffies); 478 475 } 479 - spin_unlock(&uhci->lock); 480 476 } 481 477 } 482 478 483 - if (status & USBSTS_RD) 479 + if (status & USBSTS_RD) { 480 + spin_unlock(&uhci->lock); 484 481 usb_hcd_poll_rh_status(hcd); 485 - else { 486 - spin_lock(&uhci->lock); 482 + } else { 487 483 uhci_scan_schedule(uhci); 484 + done: 488 485 spin_unlock(&uhci->lock); 489 486 } 490 487 ··· 665 662 */ 666 663 mb(); 667 664 665 + spin_lock_irq(&uhci->lock); 668 666 configure_hc(uhci); 669 667 uhci->is_initialized = 1; 670 - spin_lock_irq(&uhci->lock); 671 668 start_rh(uhci); 672 669 spin_unlock_irq(&uhci->lock); 673 670 return 0;
+2 -2
drivers/usb/musb/cppi_dma.c
··· 105 105 musb_writel(&tx->tx_complete, 0, ptr); 106 106 } 107 107 108 - static void __init cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) 108 + static void cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) 109 109 { 110 110 int j; 111 111 ··· 150 150 c->last_processed = NULL; 151 151 } 152 152 153 - static int __init cppi_controller_start(struct dma_controller *c) 153 + static int cppi_controller_start(struct dma_controller *c) 154 154 { 155 155 struct cppi *controller; 156 156 void __iomem *tibase;