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

MIPS: jz4740: update platform data for JZ4740 usb device controller

The platform data already available in tree for JZ4740 USB Device
Controller was previously used by an out-of-tree USB gadget driver
which was not relying on the musb driver and was written by Ingenic
and the Qi-Hardware community.

Update platform data for JZ4740 USB device controller to be used with
musb driver.

Signed-off-by: Apelete Seketeli <apelete@seketeli.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6265/

authored by

Apelete Seketeli and committed by
Ralf Baechle
c330fd90 14a17836

+26 -16
+1
arch/mips/include/asm/mach-jz4740/platform.h
··· 21 21 22 22 extern struct platform_device jz4740_usb_ohci_device; 23 23 extern struct platform_device jz4740_udc_device; 24 + extern struct platform_device jz4740_udc_xceiv_device; 24 25 extern struct platform_device jz4740_mmc_device; 25 26 extern struct platform_device jz4740_rtc_device; 26 27 extern struct platform_device jz4740_i2c_device;
+1
arch/mips/jz4740/board-qi_lb60.c
··· 427 427 428 428 static struct platform_device *jz_platform_devices[] __initdata = { 429 429 &jz4740_udc_device, 430 + &jz4740_udc_xceiv_device, 430 431 &jz4740_mmc_device, 431 432 &jz4740_nand_device, 432 433 &qi_lb60_keypad,
+24 -16
arch/mips/jz4740/platform.c
··· 21 21 22 22 #include <linux/dma-mapping.h> 23 23 24 + #include <linux/usb/musb.h> 25 + 24 26 #include <asm/mach-jz4740/platform.h> 25 27 #include <asm/mach-jz4740/base.h> 26 28 #include <asm/mach-jz4740/irq.h> ··· 58 56 .resource = jz4740_usb_ohci_resources, 59 57 }; 60 58 61 - /* UDC (USB gadget controller) */ 62 - static struct resource jz4740_usb_gdt_resources[] = { 63 - { 64 - .start = JZ4740_UDC_BASE_ADDR, 65 - .end = JZ4740_UDC_BASE_ADDR + 0x1000 - 1, 66 - .flags = IORESOURCE_MEM, 59 + /* USB Device Controller */ 60 + struct platform_device jz4740_udc_xceiv_device = { 61 + .name = "usb_phy_gen_xceiv", 62 + .id = 0, 63 + }; 64 + 65 + static struct resource jz4740_udc_resources[] = { 66 + [0] = { 67 + .start = JZ4740_UDC_BASE_ADDR, 68 + .end = JZ4740_UDC_BASE_ADDR + 0x10000 - 1, 69 + .flags = IORESOURCE_MEM, 67 70 }, 68 - { 69 - .start = JZ4740_IRQ_UDC, 70 - .end = JZ4740_IRQ_UDC, 71 - .flags = IORESOURCE_IRQ, 71 + [1] = { 72 + .start = JZ4740_IRQ_UDC, 73 + .end = JZ4740_IRQ_UDC, 74 + .flags = IORESOURCE_IRQ, 75 + .name = "mc", 72 76 }, 73 77 }; 74 78 75 79 struct platform_device jz4740_udc_device = { 76 - .name = "jz-udc", 77 - .id = -1, 78 - .dev = { 79 - .dma_mask = &jz4740_udc_device.dev.coherent_dma_mask, 80 + .name = "musb-jz4740", 81 + .id = -1, 82 + .dev = { 83 + .dma_mask = &jz4740_udc_device.dev.coherent_dma_mask, 80 84 .coherent_dma_mask = DMA_BIT_MASK(32), 81 85 }, 82 - .num_resources = ARRAY_SIZE(jz4740_usb_gdt_resources), 83 - .resource = jz4740_usb_gdt_resources, 86 + .num_resources = ARRAY_SIZE(jz4740_udc_resources), 87 + .resource = jz4740_udc_resources, 84 88 }; 85 89 86 90 /* MMC/SD controller */