]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
MIPS: JZ4740: Probe OHCI platform device via DT
authorMaarten ter Huurne <maarten@treewalker.org>
Mon, 18 Apr 2016 18:58:52 +0000 (20:58 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 13 May 2016 17:09:24 +0000 (19:09 +0200)
The DT fragment will select the ohci-platform driver, since that can
handle the JZ4740 OHCI just fine. While I don't have a JZ4740-based
board with anything connected to the USB host controller, I did test
the generic OHCI driver successfully on a JZ4770-based board.

The device is disabled by default; boards that want to use it can
override the "status" property. The mass-production Qi LB60 boards
don't use the USB host controller.

Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13104/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/boot/dts/ingenic/jz4740.dtsi
arch/mips/include/asm/mach-jz4740/platform.h
arch/mips/jz4740/platform.c

index 8b2437cd019f3688feb0ed7bc0a290ec57d008a7..4a9c8f2a72d6b736f25a314e360412297dba69ac 100644 (file)
                clocks = <&ext>, <&cgu JZ4740_CLK_UART1>;
                clock-names = "baud", "module";
        };
+
+       uhc: uhc@13030000 {
+               compatible = "ingenic,jz4740-ohci", "generic-ohci";
+               reg = <0x13030000 0x1000>;
+
+               clocks = <&cgu JZ4740_CLK_UHC>;
+               assigned-clocks = <&cgu JZ4740_CLK_UHC>;
+               assigned-clock-rates = <48000000>;
+
+               interrupt-parent = <&intc>;
+               interrupts = <3>;
+
+               status = "disabled";
+       };
 };
index 32cfbe6a191be8defd37fc373dc5a6cf951f3852..073b8bfbb3b3f16525df19d9802b2d32897a9bcd 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/platform_device.h>
 
-extern struct platform_device jz4740_usb_ohci_device;
 extern struct platform_device jz4740_udc_device;
 extern struct platform_device jz4740_udc_xceiv_device;
 extern struct platform_device jz4740_mmc_device;
index e8a463b9b663edec81ebe547aebbe8b7645a6adf..2f1dab35c061831263073707d6ee6e4c07816c4f 100644 (file)
 
 #include "clock.h"
 
-/* OHCI controller */
-static struct resource jz4740_usb_ohci_resources[] = {
-       {
-               .start  = JZ4740_UHC_BASE_ADDR,
-               .end    = JZ4740_UHC_BASE_ADDR + 0x1000 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = JZ4740_IRQ_UHC,
-               .end    = JZ4740_IRQ_UHC,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-struct platform_device jz4740_usb_ohci_device = {
-       .name           = "jz4740-ohci",
-       .id             = -1,
-       .dev = {
-               .dma_mask = &jz4740_usb_ohci_device.dev.coherent_dma_mask,
-               .coherent_dma_mask = DMA_BIT_MASK(32),
-       },
-       .num_resources  = ARRAY_SIZE(jz4740_usb_ohci_resources),
-       .resource       = jz4740_usb_ohci_resources,
-};
-
 /* USB Device Controller */
 struct platform_device jz4740_udc_xceiv_device = {
        .name = "usb_phy_generic",