diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-03-08 15:21:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-03-08 15:21:04 -0500 |
commit | 988addf82e4c03739375279de73929580a2d4a6a (patch) | |
tree | 989ae1cd4e264bbad80c65f04480486246e7b9f3 /arch/arm/mach-omap2/usb-musb.c | |
parent | 004c1c7096659d352b83047a7593e91d8a30e3c5 (diff) | |
parent | 25cf84cf377c0aae5dbcf937ea89bc7893db5176 (diff) |
Merge branch 'origin' into devel-stable
Conflicts:
arch/arm/mach-mx2/devices.c
arch/arm/mach-mx2/devices.h
sound/soc/pxa/pxa-ssp.c
Diffstat (limited to 'arch/arm/mach-omap2/usb-musb.c')
-rw-r--r-- | arch/arm/mach-omap2/usb-musb.c | 82 |
1 files changed, 14 insertions, 68 deletions
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index a80441dd19b8..6d41fa7b2ce8 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -47,70 +47,11 @@ static struct resource musb_resources[] = { | |||
47 | }, | 47 | }, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static int clk_on; | ||
51 | |||
52 | static int musb_set_clock(struct clk *clk, int state) | ||
53 | { | ||
54 | if (state) { | ||
55 | if (clk_on > 0) | ||
56 | return -ENODEV; | ||
57 | |||
58 | clk_enable(clk); | ||
59 | clk_on = 1; | ||
60 | } else { | ||
61 | if (clk_on == 0) | ||
62 | return -ENODEV; | ||
63 | |||
64 | clk_disable(clk); | ||
65 | clk_on = 0; | ||
66 | } | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static struct musb_hdrc_eps_bits musb_eps[] = { | ||
72 | { "ep1_tx", 10, }, | ||
73 | { "ep1_rx", 10, }, | ||
74 | { "ep2_tx", 9, }, | ||
75 | { "ep2_rx", 9, }, | ||
76 | { "ep3_tx", 3, }, | ||
77 | { "ep3_rx", 3, }, | ||
78 | { "ep4_tx", 3, }, | ||
79 | { "ep4_rx", 3, }, | ||
80 | { "ep5_tx", 3, }, | ||
81 | { "ep5_rx", 3, }, | ||
82 | { "ep6_tx", 3, }, | ||
83 | { "ep6_rx", 3, }, | ||
84 | { "ep7_tx", 3, }, | ||
85 | { "ep7_rx", 3, }, | ||
86 | { "ep8_tx", 2, }, | ||
87 | { "ep8_rx", 2, }, | ||
88 | { "ep9_tx", 2, }, | ||
89 | { "ep9_rx", 2, }, | ||
90 | { "ep10_tx", 2, }, | ||
91 | { "ep10_rx", 2, }, | ||
92 | { "ep11_tx", 2, }, | ||
93 | { "ep11_rx", 2, }, | ||
94 | { "ep12_tx", 2, }, | ||
95 | { "ep12_rx", 2, }, | ||
96 | { "ep13_tx", 2, }, | ||
97 | { "ep13_rx", 2, }, | ||
98 | { "ep14_tx", 2, }, | ||
99 | { "ep14_rx", 2, }, | ||
100 | { "ep15_tx", 2, }, | ||
101 | { "ep15_rx", 2, }, | ||
102 | }; | ||
103 | |||
104 | static struct musb_hdrc_config musb_config = { | 50 | static struct musb_hdrc_config musb_config = { |
105 | .multipoint = 1, | 51 | .multipoint = 1, |
106 | .dyn_fifo = 1, | 52 | .dyn_fifo = 1, |
107 | .soft_con = 1, | ||
108 | .dma = 1, | ||
109 | .num_eps = 16, | 53 | .num_eps = 16, |
110 | .dma_channels = 7, | ||
111 | .dma_req_chan = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), | ||
112 | .ram_bits = 12, | 54 | .ram_bits = 12, |
113 | .eps_bits = musb_eps, | ||
114 | }; | 55 | }; |
115 | 56 | ||
116 | static struct musb_hdrc_platform_data musb_plat = { | 57 | static struct musb_hdrc_platform_data musb_plat = { |
@@ -122,7 +63,6 @@ static struct musb_hdrc_platform_data musb_plat = { | |||
122 | .mode = MUSB_PERIPHERAL, | 63 | .mode = MUSB_PERIPHERAL, |
123 | #endif | 64 | #endif |
124 | /* .clock is set dynamically */ | 65 | /* .clock is set dynamically */ |
125 | .set_clock = musb_set_clock, | ||
126 | .config = &musb_config, | 66 | .config = &musb_config, |
127 | 67 | ||
128 | /* REVISIT charge pump on TWL4030 can supply up to | 68 | /* REVISIT charge pump on TWL4030 can supply up to |
@@ -146,28 +86,34 @@ static struct platform_device musb_device = { | |||
146 | .resource = musb_resources, | 86 | .resource = musb_resources, |
147 | }; | 87 | }; |
148 | 88 | ||
149 | void __init usb_musb_init(void) | 89 | void __init usb_musb_init(struct omap_musb_board_data *board_data) |
150 | { | 90 | { |
151 | if (cpu_is_omap243x()) | 91 | if (cpu_is_omap243x()) { |
152 | musb_resources[0].start = OMAP243X_HS_BASE; | 92 | musb_resources[0].start = OMAP243X_HS_BASE; |
153 | else | 93 | } else if (cpu_is_omap34xx()) { |
154 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; | 94 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; |
155 | musb_resources[0].end = musb_resources[0].start + SZ_8K - 1; | 95 | } else if (cpu_is_omap44xx()) { |
96 | musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE; | ||
97 | musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N; | ||
98 | musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N; | ||
99 | } | ||
100 | musb_resources[0].end = musb_resources[0].start + SZ_4K - 1; | ||
156 | 101 | ||
157 | /* | 102 | /* |
158 | * REVISIT: This line can be removed once all the platforms using | 103 | * REVISIT: This line can be removed once all the platforms using |
159 | * musb_core.c have been converted to use use clkdev. | 104 | * musb_core.c have been converted to use use clkdev. |
160 | */ | 105 | */ |
161 | musb_plat.clock = "ick"; | 106 | musb_plat.clock = "ick"; |
107 | musb_plat.board_data = board_data; | ||
108 | musb_plat.power = board_data->power >> 1; | ||
109 | musb_plat.mode = board_data->mode; | ||
162 | 110 | ||
163 | if (platform_device_register(&musb_device) < 0) { | 111 | if (platform_device_register(&musb_device) < 0) |
164 | printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); | 112 | printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); |
165 | return; | ||
166 | } | ||
167 | } | 113 | } |
168 | 114 | ||
169 | #else | 115 | #else |
170 | void __init usb_musb_init(void) | 116 | void __init usb_musb_init(struct omap_musb_board_data *board_data) |
171 | { | 117 | { |
172 | } | 118 | } |
173 | #endif /* CONFIG_USB_MUSB_SOC */ | 119 | #endif /* CONFIG_USB_MUSB_SOC */ |