diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 12 | ||||
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/csb701.c | 61 | ||||
-rw-r--r-- | arch/arm/mach-pxa/csb726.c | 318 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/csb726.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/gpio.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/uncompress.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-pxa/mioa701.c | 42 |
8 files changed, 432 insertions, 34 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 33214c1e0607..d13282d773aa 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -393,6 +393,18 @@ config PCM990_DISPLAY_NONE | |||
393 | 393 | ||
394 | endchoice | 394 | endchoice |
395 | 395 | ||
396 | config MACH_CSB726 | ||
397 | bool "Enable Cogent CSB726 System On a Module" | ||
398 | select PXA27x | ||
399 | select IWMMXT | ||
400 | help | ||
401 | Say Y here if you intend to run this kernel on a Cogent | ||
402 | CSB726 System On Module. | ||
403 | |||
404 | config CSB726_CSB701 | ||
405 | bool "Enable supprot for CSB701 baseboard" | ||
406 | depends on MACH_CSB726 | ||
407 | |||
396 | config PXA_EZX | 408 | config PXA_EZX |
397 | bool "Motorola EZX Platform" | 409 | bool "Motorola EZX Platform" |
398 | select PXA27x | 410 | select PXA27x |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 361fcfa7531a..8da8e63d048b 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -75,6 +75,8 @@ obj-$(CONFIG_MACH_CM_X300) += cm-x300.o | |||
75 | obj-$(CONFIG_PXA_EZX) += ezx.o | 75 | obj-$(CONFIG_PXA_EZX) += ezx.o |
76 | 76 | ||
77 | obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o | 77 | obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o |
78 | obj-$(CONFIG_MACH_CSB726) += csb726.o | ||
79 | obj-$(CONFIG_CSB726_CSB701) += csb701.o | ||
78 | 80 | ||
79 | # Support for blinky lights | 81 | # Support for blinky lights |
80 | led-y := leds.o | 82 | led-y := leds.o |
diff --git a/arch/arm/mach-pxa/csb701.c b/arch/arm/mach-pxa/csb701.c new file mode 100644 index 000000000000..4a2a2952c374 --- /dev/null +++ b/arch/arm/mach-pxa/csb701.c | |||
@@ -0,0 +1,61 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/module.h> | ||
3 | #include <linux/platform_device.h> | ||
4 | #include <linux/gpio_keys.h> | ||
5 | #include <linux/input.h> | ||
6 | #include <linux/leds.h> | ||
7 | |||
8 | static struct gpio_keys_button csb701_buttons[] = { | ||
9 | { | ||
10 | .code = 0x7, | ||
11 | .gpio = 1, | ||
12 | .active_low = 1, | ||
13 | .desc = "SW2", | ||
14 | .type = EV_SW, | ||
15 | .wakeup = 1, | ||
16 | }, | ||
17 | }; | ||
18 | |||
19 | static struct gpio_keys_platform_data csb701_gpio_keys_data = { | ||
20 | .buttons = csb701_buttons, | ||
21 | .nbuttons = ARRAY_SIZE(csb701_buttons), | ||
22 | }; | ||
23 | |||
24 | static struct gpio_led csb701_leds[] = { | ||
25 | { | ||
26 | .name = "csb701:yellow:heartbeat", | ||
27 | .default_trigger = "heartbeat", | ||
28 | .gpio = 11, | ||
29 | .active_low = 1, | ||
30 | }, | ||
31 | }; | ||
32 | |||
33 | static struct platform_device csb701_gpio_keys = { | ||
34 | .name = "gpio-keys", | ||
35 | .id = -1, | ||
36 | .dev.platform_data = &csb701_gpio_keys_data, | ||
37 | }; | ||
38 | |||
39 | static struct gpio_led_platform_data csb701_leds_gpio_data = { | ||
40 | .leds = csb701_leds, | ||
41 | .num_leds = ARRAY_SIZE(csb701_leds), | ||
42 | }; | ||
43 | |||
44 | static struct platform_device csb701_leds_gpio = { | ||
45 | .name = "leds-gpio", | ||
46 | .id = -1, | ||
47 | .dev.platform_data = &csb701_leds_gpio_data, | ||
48 | }; | ||
49 | |||
50 | static struct platform_device *devices[] __initdata = { | ||
51 | &csb701_gpio_keys, | ||
52 | &csb701_leds_gpio, | ||
53 | }; | ||
54 | |||
55 | static int __init csb701_init(void) | ||
56 | { | ||
57 | return platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
58 | } | ||
59 | |||
60 | module_init(csb701_init); | ||
61 | |||
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c new file mode 100644 index 000000000000..2b289f83a61a --- /dev/null +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -0,0 +1,318 @@ | |||
1 | /* | ||
2 | * Support for Cogent CSB726 | ||
3 | * | ||
4 | * Copyright (c) 2008 Dmitry Eremin-Solenikov | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/gpio.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/physmap.h> | ||
17 | #include <linux/mtd/partitions.h> | ||
18 | #include <linux/sm501.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <mach/csb726.h> | ||
23 | #include <mach/mfp-pxa27x.h> | ||
24 | #include <mach/i2c.h> | ||
25 | #include <mach/mmc.h> | ||
26 | #include <mach/ohci.h> | ||
27 | #include <mach/pxa2xx-regs.h> | ||
28 | |||
29 | #include "generic.h" | ||
30 | #include "devices.h" | ||
31 | |||
32 | /* | ||
33 | * n/a: 2, 5, 6, 7, 8, 23, 24, 25, 26, 27, 87, 88, 89, | ||
34 | * nu: 58 -- 77, 90, 91, 93, 102, 105-108, 114-116, | ||
35 | * XXX: 21, | ||
36 | * XXX: 79 CS_3 for LAN9215 or PSKTSEL on R2, R3 | ||
37 | * XXX: 33 CS_5 for LAN9215 on R1 | ||
38 | */ | ||
39 | |||
40 | static unsigned long csb726_pin_config[] = { | ||
41 | GPIO78_nCS_2, /* EXP_CS */ | ||
42 | GPIO79_nCS_3, /* SMSC9215 */ | ||
43 | GPIO80_nCS_4, /* SM501 */ | ||
44 | |||
45 | GPIO52_GPIO, /* #SMSC9251 int */ | ||
46 | GPIO53_GPIO, /* SM501 int */ | ||
47 | |||
48 | GPIO1_GPIO, /* GPIO0 */ | ||
49 | GPIO11_GPIO, /* GPIO1 */ | ||
50 | GPIO9_GPIO, /* GPIO2 */ | ||
51 | GPIO10_GPIO, /* GPIO3 */ | ||
52 | GPIO16_PWM0_OUT, /* or GPIO4 */ | ||
53 | GPIO17_PWM1_OUT, /* or GPIO5 */ | ||
54 | GPIO94_GPIO, /* GPIO6 */ | ||
55 | GPIO95_GPIO, /* GPIO7 */ | ||
56 | GPIO96_GPIO, /* GPIO8 */ | ||
57 | GPIO97_GPIO, /* GPIO9 */ | ||
58 | GPIO15_GPIO, /* EXP_IRQ */ | ||
59 | GPIO18_RDY, /* EXP_WAIT */ | ||
60 | |||
61 | GPIO0_GPIO, /* PWR_INT */ | ||
62 | GPIO104_GPIO, /* PWR_OFF */ | ||
63 | |||
64 | GPIO12_GPIO, /* touch irq */ | ||
65 | |||
66 | GPIO13_SSP2_TXD, | ||
67 | GPIO14_SSP2_SFRM, | ||
68 | MFP_CFG_OUT(GPIO19, AF1, DRIVE_LOW),/* SSP2_SYSCLK */ | ||
69 | GPIO22_SSP2_SCLK, | ||
70 | |||
71 | GPIO81_SSP3_TXD, | ||
72 | GPIO82_SSP3_RXD, | ||
73 | GPIO83_SSP3_SFRM, | ||
74 | GPIO84_SSP3_SCLK, | ||
75 | |||
76 | GPIO20_GPIO, /* SDIO int */ | ||
77 | GPIO32_MMC_CLK, | ||
78 | GPIO92_MMC_DAT_0, | ||
79 | GPIO109_MMC_DAT_1, | ||
80 | GPIO110_MMC_DAT_2, | ||
81 | GPIO111_MMC_DAT_3, | ||
82 | GPIO112_MMC_CMD, | ||
83 | GPIO100_GPIO, /* SD CD */ | ||
84 | GPIO101_GPIO, /* SD WP */ | ||
85 | |||
86 | GPIO28_AC97_BITCLK, | ||
87 | GPIO29_AC97_SDATA_IN_0, | ||
88 | GPIO30_AC97_SDATA_OUT, | ||
89 | GPIO31_AC97_SYNC, | ||
90 | GPIO113_AC97_nRESET, | ||
91 | |||
92 | GPIO34_FFUART_RXD, | ||
93 | GPIO35_FFUART_CTS, | ||
94 | GPIO36_FFUART_DCD, | ||
95 | GPIO37_FFUART_DSR, | ||
96 | GPIO38_FFUART_RI, | ||
97 | GPIO39_FFUART_TXD, | ||
98 | GPIO40_FFUART_DTR, | ||
99 | GPIO41_FFUART_RTS, | ||
100 | |||
101 | GPIO42_BTUART_RXD, | ||
102 | GPIO43_BTUART_TXD, | ||
103 | GPIO44_BTUART_CTS, | ||
104 | GPIO45_BTUART_RTS, | ||
105 | |||
106 | GPIO46_STUART_RXD, | ||
107 | GPIO47_STUART_TXD, | ||
108 | |||
109 | GPIO48_nPOE, | ||
110 | GPIO49_nPWE, | ||
111 | GPIO50_nPIOR, | ||
112 | GPIO51_nPIOW, | ||
113 | GPIO54_nPCE_2, | ||
114 | GPIO55_nPREG, | ||
115 | GPIO56_nPWAIT, | ||
116 | GPIO57_nIOIS16, /* maybe unused */ | ||
117 | GPIO85_nPCE_1, | ||
118 | GPIO98_GPIO, /* CF IRQ */ | ||
119 | GPIO99_GPIO, /* CF CD */ | ||
120 | GPIO103_GPIO, /* Reset */ | ||
121 | |||
122 | GPIO117_I2C_SCL, | ||
123 | GPIO118_I2C_SDA, | ||
124 | }; | ||
125 | |||
126 | static struct pxamci_platform_data csb726_mci_data; | ||
127 | |||
128 | static int csb726_mci_init(struct device *dev, | ||
129 | irq_handler_t detect, void *data) | ||
130 | { | ||
131 | int err; | ||
132 | |||
133 | csb726_mci_data.detect_delay = msecs_to_jiffies(500); | ||
134 | |||
135 | err = gpio_request(CSB726_GPIO_MMC_DETECT, "MMC detect"); | ||
136 | if (err) | ||
137 | goto err_det_req; | ||
138 | |||
139 | err = gpio_direction_input(CSB726_GPIO_MMC_DETECT); | ||
140 | if (err) | ||
141 | goto err_det_dir; | ||
142 | |||
143 | err = gpio_request(CSB726_GPIO_MMC_RO, "MMC ro"); | ||
144 | if (err) | ||
145 | goto err_ro_req; | ||
146 | |||
147 | err = gpio_direction_input(CSB726_GPIO_MMC_RO); | ||
148 | if (err) | ||
149 | goto err_ro_dir; | ||
150 | |||
151 | err = request_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), detect, | ||
152 | IRQF_DISABLED, "MMC card detect", data); | ||
153 | if (err) | ||
154 | goto err_irq; | ||
155 | |||
156 | return 0; | ||
157 | |||
158 | err_irq: | ||
159 | err_ro_dir: | ||
160 | gpio_free(CSB726_GPIO_MMC_RO); | ||
161 | err_ro_req: | ||
162 | err_det_dir: | ||
163 | gpio_free(CSB726_GPIO_MMC_DETECT); | ||
164 | err_det_req: | ||
165 | return err; | ||
166 | } | ||
167 | |||
168 | static int csb726_mci_get_ro(struct device *dev) | ||
169 | { | ||
170 | return gpio_get_value(CSB726_GPIO_MMC_RO); | ||
171 | } | ||
172 | |||
173 | static void csb726_mci_exit(struct device *dev, void *data) | ||
174 | { | ||
175 | free_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), data); | ||
176 | gpio_free(CSB726_GPIO_MMC_RO); | ||
177 | gpio_free(CSB726_GPIO_MMC_DETECT); | ||
178 | } | ||
179 | |||
180 | static struct pxamci_platform_data csb726_mci = { | ||
181 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
182 | .init = csb726_mci_init, | ||
183 | .get_ro = csb726_mci_get_ro, | ||
184 | /* FIXME setpower */ | ||
185 | .exit = csb726_mci_exit, | ||
186 | }; | ||
187 | |||
188 | static struct pxaohci_platform_data csb726_ohci_platform_data = { | ||
189 | .port_mode = PMM_NPS_MODE, | ||
190 | .flags = ENABLE_PORT1 | NO_OC_PROTECTION, | ||
191 | }; | ||
192 | |||
193 | static struct mtd_partition csb726_flash_partitions[] = { | ||
194 | { | ||
195 | .name = "Bootloader", | ||
196 | .offset = 0, | ||
197 | .size = CSB726_FLASH_uMON, | ||
198 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
199 | }, | ||
200 | { | ||
201 | .name = "root", | ||
202 | .offset = MTDPART_OFS_APPEND, | ||
203 | .size = MTDPART_SIZ_FULL, | ||
204 | } | ||
205 | }; | ||
206 | |||
207 | static struct physmap_flash_data csb726_flash_data = { | ||
208 | .width = 2, | ||
209 | .parts = csb726_flash_partitions, | ||
210 | .nr_parts = ARRAY_SIZE(csb726_flash_partitions), | ||
211 | }; | ||
212 | |||
213 | static struct resource csb726_flash_resources[] = { | ||
214 | { | ||
215 | .start = PXA_CS0_PHYS, | ||
216 | .end = PXA_CS0_PHYS + CSB726_FLASH_SIZE - 1 , | ||
217 | .flags = IORESOURCE_MEM, | ||
218 | } | ||
219 | }; | ||
220 | |||
221 | static struct platform_device csb726_flash = { | ||
222 | .name = "physmap-flash", | ||
223 | .dev = { | ||
224 | .platform_data = &csb726_flash_data, | ||
225 | }, | ||
226 | .resource = csb726_flash_resources, | ||
227 | .num_resources = ARRAY_SIZE(csb726_flash_resources), | ||
228 | }; | ||
229 | |||
230 | static struct resource csb726_sm501_resources[] = { | ||
231 | { | ||
232 | .start = PXA_CS4_PHYS, | ||
233 | .end = PXA_CS4_PHYS + SZ_8M - 1, | ||
234 | .flags = IORESOURCE_MEM, | ||
235 | .name = "sm501-localmem", | ||
236 | }, | ||
237 | { | ||
238 | .start = PXA_CS4_PHYS + SZ_64M - SZ_2M, | ||
239 | .end = PXA_CS4_PHYS + SZ_64M - 1, | ||
240 | .flags = IORESOURCE_MEM, | ||
241 | .name = "sm501-regs", | ||
242 | }, | ||
243 | { | ||
244 | .start = CSB726_IRQ_SM501, | ||
245 | .end = CSB726_IRQ_SM501, | ||
246 | .flags = IORESOURCE_IRQ, | ||
247 | }, | ||
248 | }; | ||
249 | |||
250 | static struct sm501_initdata csb726_sm501_initdata = { | ||
251 | /* .devices = SM501_USE_USB_HOST, */ | ||
252 | .devices = SM501_USE_USB_HOST | SM501_USE_UART0 | SM501_USE_UART1, | ||
253 | }; | ||
254 | |||
255 | static struct sm501_platdata csb726_sm501_platdata = { | ||
256 | .init = &csb726_sm501_initdata, | ||
257 | }; | ||
258 | |||
259 | static struct platform_device csb726_sm501 = { | ||
260 | .name = "sm501", | ||
261 | .id = 0, | ||
262 | .num_resources = ARRAY_SIZE(csb726_sm501_resources), | ||
263 | .resource = csb726_sm501_resources, | ||
264 | .dev = { | ||
265 | .platform_data = &csb726_sm501_platdata, | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | static struct resource csb726_lan_resources[] = { | ||
270 | { | ||
271 | .start = PXA_CS3_PHYS, | ||
272 | .end = PXA_CS3_PHYS + SZ_64K - 1, | ||
273 | .flags = IORESOURCE_MEM, | ||
274 | }, | ||
275 | { | ||
276 | .start = CSB726_IRQ_LAN, | ||
277 | .end = CSB726_IRQ_LAN, | ||
278 | .flags = IORESOURCE_IRQ, | ||
279 | }, | ||
280 | }; | ||
281 | |||
282 | static struct platform_device csb726_lan = { | ||
283 | .name = "smc911x", | ||
284 | .id = -1, | ||
285 | .num_resources = ARRAY_SIZE(csb726_lan_resources), | ||
286 | .resource = csb726_lan_resources, | ||
287 | }; | ||
288 | |||
289 | static struct platform_device *devices[] __initdata = { | ||
290 | &csb726_flash, | ||
291 | &csb726_sm501, | ||
292 | &csb726_lan, | ||
293 | }; | ||
294 | |||
295 | static void __init csb726_init(void) | ||
296 | { | ||
297 | pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); | ||
298 | /* MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */ | ||
299 | /* MSC2 = 0x06697ff4; *//* none/SM501 */ | ||
300 | MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ | ||
301 | |||
302 | pxa_set_i2c_info(NULL); | ||
303 | pxa27x_set_i2c_power_info(NULL); | ||
304 | pxa_set_mci_info(&csb726_mci); | ||
305 | pxa_set_ohci_info(&csb726_ohci_platform_data); | ||
306 | |||
307 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
308 | } | ||
309 | |||
310 | MACHINE_START(CSB726, "Cogent CSB726") | ||
311 | .phys_io = 0x40000000, | ||
312 | .boot_params = 0xa0000100, | ||
313 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
314 | .map_io = pxa_map_io, | ||
315 | .init_irq = pxa27x_init_irq, | ||
316 | .init_machine = csb726_init, | ||
317 | .timer = &pxa_timer, | ||
318 | MACHINE_END | ||
diff --git a/arch/arm/mach-pxa/include/mach/csb726.h b/arch/arm/mach-pxa/include/mach/csb726.h new file mode 100644 index 000000000000..747ab1a71f2f --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/csb726.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Support for Cogent CSB726 | ||
3 | * | ||
4 | * Copyright (c) 2008 Dmitry Baryshkov | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | #ifndef CSB726_H | ||
12 | #define CSB726_H | ||
13 | |||
14 | #define CSB726_GPIO_IRQ_LAN 52 | ||
15 | #define CSB726_GPIO_IRQ_SM501 53 | ||
16 | #define CSB726_GPIO_MMC_DETECT 100 | ||
17 | #define CSB726_GPIO_MMC_RO 101 | ||
18 | |||
19 | #define CSB726_FLASH_SIZE (64 * 1024 * 1024) | ||
20 | #define CSB726_FLASH_uMON (8 * 1024 * 1024) | ||
21 | |||
22 | #define CSB726_IRQ_LAN gpio_to_irq(CSB726_GPIO_IRQ_LAN) | ||
23 | #define CSB726_IRQ_SM501 gpio_to_irq(CSB726_GPIO_IRQ_SM501) | ||
24 | |||
25 | #endif | ||
26 | |||
diff --git a/arch/arm/mach-pxa/include/mach/gpio.h b/arch/arm/mach-pxa/include/mach/gpio.h index 406fa102cb40..c72c89a2285e 100644 --- a/arch/arm/mach-pxa/include/mach/gpio.h +++ b/arch/arm/mach-pxa/include/mach/gpio.h | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #define GPIO_REGS_VIRT io_p2v(0x40E00000) | 31 | #define GPIO_REGS_VIRT io_p2v(0x40E00000) |
32 | 32 | ||
33 | #define BANK_OFF(n) (((n) > 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) | 33 | #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) |
34 | #define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x))) | 34 | #define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x))) |
35 | 35 | ||
36 | /* GPIO Pin Level Registers */ | 36 | /* GPIO Pin Level Registers */ |
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h index f4b029c03957..5706cea95d11 100644 --- a/arch/arm/mach-pxa/include/mach/uncompress.h +++ b/arch/arm/mach-pxa/include/mach/uncompress.h | |||
@@ -35,7 +35,8 @@ static inline void flush(void) | |||
35 | 35 | ||
36 | static inline void arch_decomp_setup(void) | 36 | static inline void arch_decomp_setup(void) |
37 | { | 37 | { |
38 | if (machine_is_littleton() || machine_is_intelmote2()) | 38 | if (machine_is_littleton() || machine_is_intelmote2() |
39 | || machine_is_csb726()) | ||
39 | UART = STUART; | 40 | UART = STUART; |
40 | } | 41 | } |
41 | 42 | ||
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index e77c95ca67f0..025772785d36 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/power_supply.h> | 36 | #include <linux/power_supply.h> |
37 | #include <linux/wm97xx_batt.h> | 37 | #include <linux/wm97xx_batt.h> |
38 | #include <linux/mtd/physmap.h> | 38 | #include <linux/mtd/physmap.h> |
39 | #include <linux/usb/gpio_vbus.h> | ||
39 | 40 | ||
40 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
41 | #include <asm/mach/arch.h> | 42 | #include <asm/mach/arch.h> |
@@ -412,21 +413,6 @@ static void gsm_exit(void) | |||
412 | /* | 413 | /* |
413 | * USB UDC | 414 | * USB UDC |
414 | */ | 415 | */ |
415 | static void udc_power_command(int cmd) | ||
416 | { | ||
417 | switch (cmd) { | ||
418 | case PXA2XX_UDC_CMD_DISCONNECT: | ||
419 | gpio_set_value(GPIO22_USB_ENABLE, 0); | ||
420 | break; | ||
421 | case PXA2XX_UDC_CMD_CONNECT: | ||
422 | gpio_set_value(GPIO22_USB_ENABLE, 1); | ||
423 | break; | ||
424 | default: | ||
425 | printk(KERN_INFO "udc_control: unknown command (0x%x)!\n", cmd); | ||
426 | break; | ||
427 | } | ||
428 | } | ||
429 | |||
430 | static int is_usb_connected(void) | 416 | static int is_usb_connected(void) |
431 | { | 417 | { |
432 | return !gpio_get_value(GPIO13_nUSB_DETECT); | 418 | return !gpio_get_value(GPIO13_nUSB_DETECT); |
@@ -434,24 +420,15 @@ static int is_usb_connected(void) | |||
434 | 420 | ||
435 | static struct pxa2xx_udc_mach_info mioa701_udc_info = { | 421 | static struct pxa2xx_udc_mach_info mioa701_udc_info = { |
436 | .udc_is_connected = is_usb_connected, | 422 | .udc_is_connected = is_usb_connected, |
437 | .udc_command = udc_power_command, | 423 | .gpio_pullup = GPIO22_USB_ENABLE, |
438 | }; | 424 | }; |
439 | 425 | ||
440 | struct gpio_ress udc_gpios[] = { | 426 | struct gpio_vbus_mach_info gpio_vbus_data = { |
441 | MIO_GPIO_OUT(GPIO22_USB_ENABLE, 0, "USB Vbus enable") | 427 | .gpio_vbus = GPIO13_nUSB_DETECT, |
428 | .gpio_vbus_inverted = 1, | ||
429 | .gpio_pullup = -1, | ||
442 | }; | 430 | }; |
443 | 431 | ||
444 | static int __init udc_init(void) | ||
445 | { | ||
446 | pxa_set_udc_info(&mioa701_udc_info); | ||
447 | return mio_gpio_request(ARRAY_AND_SIZE(udc_gpios)); | ||
448 | } | ||
449 | |||
450 | static void udc_exit(void) | ||
451 | { | ||
452 | mio_gpio_free(ARRAY_AND_SIZE(udc_gpios)); | ||
453 | } | ||
454 | |||
455 | /* | 432 | /* |
456 | * SDIO/MMC Card controller | 433 | * SDIO/MMC Card controller |
457 | */ | 434 | */ |
@@ -790,6 +767,7 @@ MIO_SIMPLE_DEV(pxa2xx_ac97, "pxa2xx-ac97", NULL) | |||
790 | MIO_PARENT_DEV(mio_wm9713_codec, "wm9713-codec", &pxa2xx_ac97.dev, NULL) | 767 | MIO_PARENT_DEV(mio_wm9713_codec, "wm9713-codec", &pxa2xx_ac97.dev, NULL) |
791 | MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL) | 768 | MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL) |
792 | MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL) | 769 | MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL) |
770 | MIO_SIMPLE_DEV(gpio_vbus, "gpio-vbus", &gpio_vbus_data); | ||
793 | 771 | ||
794 | static struct platform_device *devices[] __initdata = { | 772 | static struct platform_device *devices[] __initdata = { |
795 | &mioa701_gpio_keys, | 773 | &mioa701_gpio_keys, |
@@ -801,7 +779,8 @@ static struct platform_device *devices[] __initdata = { | |||
801 | &mioa701_sound, | 779 | &mioa701_sound, |
802 | &power_dev, | 780 | &power_dev, |
803 | &strataflash, | 781 | &strataflash, |
804 | &mioa701_board | 782 | &gpio_vbus, |
783 | &mioa701_board, | ||
805 | }; | 784 | }; |
806 | 785 | ||
807 | static void mioa701_machine_exit(void); | 786 | static void mioa701_machine_exit(void); |
@@ -838,7 +817,7 @@ static void __init mioa701_machine_init(void) | |||
838 | pxa_set_mci_info(&mioa701_mci_info); | 817 | pxa_set_mci_info(&mioa701_mci_info); |
839 | pxa_set_keypad_info(&mioa701_keypad_info); | 818 | pxa_set_keypad_info(&mioa701_keypad_info); |
840 | wm97xx_bat_set_pdata(&mioa701_battery_data); | 819 | wm97xx_bat_set_pdata(&mioa701_battery_data); |
841 | udc_init(); | 820 | pxa_set_udc_info(&mioa701_udc_info); |
842 | pm_power_off = mioa701_poweroff; | 821 | pm_power_off = mioa701_poweroff; |
843 | arm_pm_restart = mioa701_restart; | 822 | arm_pm_restart = mioa701_restart; |
844 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 823 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
@@ -851,7 +830,6 @@ static void __init mioa701_machine_init(void) | |||
851 | 830 | ||
852 | static void mioa701_machine_exit(void) | 831 | static void mioa701_machine_exit(void) |
853 | { | 832 | { |
854 | udc_exit(); | ||
855 | bootstrap_exit(); | 833 | bootstrap_exit(); |
856 | gsm_exit(); | 834 | gsm_exit(); |
857 | } | 835 | } |