diff options
author | Arnaud Patard <arnaud.patard@rtp-net.org> | 2007-02-12 18:21:26 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-14 10:04:15 -0500 |
commit | 71a9c4241278c8104ff30233b9247c0857c404d7 (patch) | |
tree | 98ea3c4ab5ba35e6db3463c519e2e278a4988d6c /arch/arm | |
parent | 0dcfc328ccd1d475f10a33c0ccf10bda869d4a83 (diff) |
[ARM] 4174/1: H1940 usb device definitions
This patch is adding the usb device controller to the h1940 device
list. It's also adding the code to handle the usb pull-ups.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-s3c2410/mach-h1940.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 5af26e177966..68f11efdd140 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -33,10 +33,13 @@ | |||
33 | 33 | ||
34 | #include <asm/arch/regs-serial.h> | 34 | #include <asm/arch/regs-serial.h> |
35 | #include <asm/arch/regs-lcd.h> | 35 | #include <asm/arch/regs-lcd.h> |
36 | #include <asm/arch/regs-gpio.h> | ||
37 | #include <asm/arch/regs-clock.h> | ||
36 | 38 | ||
37 | #include <asm/arch/h1940.h> | 39 | #include <asm/arch/h1940.h> |
38 | #include <asm/arch/h1940-latch.h> | 40 | #include <asm/arch/h1940-latch.h> |
39 | #include <asm/arch/fb.h> | 41 | #include <asm/arch/fb.h> |
42 | #include <asm/arch/udc.h> | ||
40 | 43 | ||
41 | #include <asm/plat-s3c24xx/clock.h> | 44 | #include <asm/plat-s3c24xx/clock.h> |
42 | #include <asm/plat-s3c24xx/devs.h> | 45 | #include <asm/plat-s3c24xx/devs.h> |
@@ -102,6 +105,32 @@ void h1940_latch_control(unsigned int clear, unsigned int set) | |||
102 | 105 | ||
103 | EXPORT_SYMBOL_GPL(h1940_latch_control); | 106 | EXPORT_SYMBOL_GPL(h1940_latch_control); |
104 | 107 | ||
108 | static void h1940_udc_pullup(enum s3c2410_udc_cmd_e cmd) | ||
109 | { | ||
110 | printk(KERN_DEBUG "udc: pullup(%d)\n",cmd); | ||
111 | |||
112 | switch (cmd) | ||
113 | { | ||
114 | case S3C2410_UDC_P_ENABLE : | ||
115 | h1940_latch_control(0, H1940_LATCH_USB_DP); | ||
116 | break; | ||
117 | case S3C2410_UDC_P_DISABLE : | ||
118 | h1940_latch_control(H1940_LATCH_USB_DP, 0); | ||
119 | break; | ||
120 | case S3C2410_UDC_P_RESET : | ||
121 | break; | ||
122 | default: | ||
123 | break; | ||
124 | } | ||
125 | } | ||
126 | |||
127 | static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = { | ||
128 | .udc_command = h1940_udc_pullup, | ||
129 | .vbus_pin = S3C2410_GPG5, | ||
130 | .vbus_pin_inverted = 1, | ||
131 | }; | ||
132 | |||
133 | |||
105 | 134 | ||
106 | /** | 135 | /** |
107 | * Set lcd on or off | 136 | * Set lcd on or off |
@@ -152,6 +181,7 @@ static struct platform_device *h1940_devices[] __initdata = { | |||
152 | &s3c_device_wdt, | 181 | &s3c_device_wdt, |
153 | &s3c_device_i2c, | 182 | &s3c_device_i2c, |
154 | &s3c_device_iis, | 183 | &s3c_device_iis, |
184 | &s3c_device_usbgadget, | ||
155 | }; | 185 | }; |
156 | 186 | ||
157 | static struct s3c24xx_board h1940_board __initdata = { | 187 | static struct s3c24xx_board h1940_board __initdata = { |
@@ -179,7 +209,23 @@ static void __init h1940_init_irq(void) | |||
179 | 209 | ||
180 | static void __init h1940_init(void) | 210 | static void __init h1940_init(void) |
181 | { | 211 | { |
212 | u32 tmp; | ||
213 | |||
182 | s3c24xx_fb_set_platdata(&h1940_lcdcfg); | 214 | s3c24xx_fb_set_platdata(&h1940_lcdcfg); |
215 | s3c24xx_udc_set_platdata(&h1940_udc_cfg); | ||
216 | |||
217 | /* Turn off suspend on both USB ports, and switch the | ||
218 | * selectable USB port to USB device mode. */ | ||
219 | |||
220 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | | ||
221 | S3C2410_MISCCR_USBSUSPND0 | | ||
222 | S3C2410_MISCCR_USBSUSPND1, 0x0); | ||
223 | |||
224 | tmp = ( | ||
225 | 0x78 << S3C2410_PLLCON_MDIVSHIFT) | ||
226 | | (0x02 << S3C2410_PLLCON_PDIVSHIFT) | ||
227 | | (0x03 << S3C2410_PLLCON_SDIVSHIFT); | ||
228 | writel(tmp, S3C2410_UPLLCON); | ||
183 | } | 229 | } |
184 | 230 | ||
185 | MACHINE_START(H1940, "IPAQ-H1940") | 231 | MACHINE_START(H1940, "IPAQ-H1940") |
@@ -189,6 +235,6 @@ MACHINE_START(H1940, "IPAQ-H1940") | |||
189 | .boot_params = S3C2410_SDRAM_PA + 0x100, | 235 | .boot_params = S3C2410_SDRAM_PA + 0x100, |
190 | .map_io = h1940_map_io, | 236 | .map_io = h1940_map_io, |
191 | .init_irq = h1940_init_irq, | 237 | .init_irq = h1940_init_irq, |
192 | .init_machine = h1940_init, | 238 | .init_machine = h1940_init, |
193 | .timer = &s3c24xx_timer, | 239 | .timer = &s3c24xx_timer, |
194 | MACHINE_END | 240 | MACHINE_END |