]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/board-2430sdp-usb.c
908a0c0be5b123e206e72bfd8a9db0a1d0a8ba02
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-2430sdp-usb.c
1 /*
2  * linux/arch/arm/mach-omap2/board-2430sdp-usb.c
3  *
4  * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
5  * Author: Kevin Hilman
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11
12 #include <linux/types.h>
13 #include <linux/errno.h>
14 #include <linux/delay.h>
15 #include <linux/platform_device.h>
16 #include <linux/usb/musb.h>
17
18 #include <asm/arch/hardware.h>
19 #include <asm/arch/usb.h>
20
21 static struct resource musb_resources[] = {
22         [0] = {
23                 .start  = OMAP243X_HS_BASE,
24                 .end    = OMAP243X_HS_BASE + SZ_8K,
25                 .flags  = IORESOURCE_MEM,
26         },
27         [1] = { /* general IRQ */
28                 .start  = INT_243X_HS_USB_MC,
29                 .flags  = IORESOURCE_IRQ,
30         },
31         [2] = { /* DMA IRQ */
32                 .start  = INT_243X_HS_USB_DMA,
33                 .flags  = IORESOURCE_IRQ,
34         },
35 };
36
37 static struct musb_hdrc_platform_data musb_plat = {
38 #ifdef CONFIG_USB_MUSB_OTG
39         .mode           = MUSB_OTG,
40 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
41         .mode           = MUSB_HOST,
42 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
43         .mode           = MUSB_PERIPHERAL,
44 #endif
45         .multipoint     = 1,
46 };
47
48 static u64 musb_dmamask = ~(u32)0;
49
50 static struct platform_device musb_device = {
51         .name           = "musb_hdrc",
52         .id             = 0,
53         .dev = {
54                 .dma_mask               = &musb_dmamask,
55                 .coherent_dma_mask      = 0xffffffff,
56                 .platform_data          = &musb_plat,
57         },
58         .num_resources  = ARRAY_SIZE(musb_resources),
59         .resource       = musb_resources,
60 };
61
62 void __init sdp2430_usb_init(void)
63 {
64         if (platform_device_register(&musb_device) < 0) {
65                 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
66                 return;
67         }
68 }
69