2 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
15 * platform_device registration for ULPI OTG device
18 #include <linux/module.h>
19 #include <linux/kernel.h>
20 #include <linux/types.h>
21 #include <linux/errno.h>
22 #include <linux/init.h>
23 #include <linux/err.h>
24 #include <linux/platform_device.h>
25 #include <linux/fsl_devices.h>
27 #include <asm/mcfsim.h>
29 #define USB_OTGREGS_BASE MCF_REG32(0xFC0B0000)
30 #define INT_USB (64 + 64 + 47) /* INTC1:47 16.2.9.1 */
31 #define INT_UOCSR (64 + 64 + 53) /* INTC1:53 16.2.9.1 */
33 extern int usbotg_init(struct platform_device *pdev);
34 extern void usbotg_uninit(struct fsl_usb2_platform_data *pdata);
35 extern struct fsl_usb2_platform_data mxc_otg_config;
37 static void otg_otg_release(struct device *dev)
39 /* normally not freed */
43 static struct resource otg_otg_resources[] = {
45 .start = (u32) (&USB_OTGREGS_BASE),
46 .end = (u32) (&USB_OTGREGS_BASE + 0x1ff),
47 .flags = IORESOURCE_MEM,
51 .flags = IORESOURCE_IRQ,
58 static u64 otg_otg_dmamask = ~(u32) 0;
59 static struct platform_device otg_otg_device = {
60 .name = "fsl-usb2-otg",
63 .release = otg_otg_release,
64 .dma_mask = &otg_otg_dmamask,
65 .coherent_dma_mask = 0xffffffff,
66 .platform_data = &mxc_otg_config,
68 .resource = otg_otg_resources,
69 .num_resources = ARRAY_SIZE(otg_otg_resources),
73 static int __init mx31_otg_otg_init(void)
77 pr_debug("register OTG otg res=0x%p, size=%d\n",
78 otg_otg_device.resource, otg_otg_device.num_resources);
80 rc = platform_device_register(&otg_otg_device);
82 pr_debug("can't register ULPI OTG dvc, %d\n", rc);
84 printk(KERN_INFO "usb: OTG ULPI transceiver registered\n");
85 pr_debug("otg_otg_device=0x%p resources=0x%p.\n",
86 &otg_otg_device, otg_otg_device.resource);
92 subsys_initcall(mx31_otg_otg_init);
94 MODULE_AUTHOR("Freescale Semiconductor, Inc.");
95 MODULE_DESCRIPTION("ULPI OTG device registration");
96 MODULE_LICENSE("GPL");