aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2410/mach-h1940.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c2410/mach-h1940.c')
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c64
1 files changed, 57 insertions, 7 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 15b625eae499..01c60d0923cd 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -25,23 +25,24 @@
25#include <asm/mach/irq.h> 25#include <asm/mach/irq.h>
26 26
27#include <asm/hardware.h> 27#include <asm/hardware.h>
28#include <asm/hardware/iomd.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <asm/irq.h> 29#include <asm/irq.h>
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32 31
33
34#include <asm/arch/regs-serial.h> 32#include <asm/arch/regs-serial.h>
35#include <asm/arch/regs-lcd.h> 33#include <asm/arch/regs-lcd.h>
34#include <asm/arch/regs-gpio.h>
35#include <asm/arch/regs-clock.h>
36 36
37#include <asm/arch/h1940.h> 37#include <asm/arch/h1940.h>
38#include <asm/arch/h1940-latch.h> 38#include <asm/arch/h1940-latch.h>
39#include <asm/arch/fb.h> 39#include <asm/arch/fb.h>
40#include <asm/arch/udc.h>
40 41
41#include "clock.h" 42#include <asm/plat-s3c24xx/clock.h>
42#include "devs.h" 43#include <asm/plat-s3c24xx/devs.h>
43#include "cpu.h" 44#include <asm/plat-s3c24xx/cpu.h>
44#include "pm.h" 45#include <asm/plat-s3c24xx/pm.h>
45 46
46static struct map_desc h1940_iodesc[] __initdata = { 47static struct map_desc h1940_iodesc[] __initdata = {
47 [0] = { 48 [0] = {
@@ -102,6 +103,32 @@ void h1940_latch_control(unsigned int clear, unsigned int set)
102 103
103EXPORT_SYMBOL_GPL(h1940_latch_control); 104EXPORT_SYMBOL_GPL(h1940_latch_control);
104 105
106static void h1940_udc_pullup(enum s3c2410_udc_cmd_e cmd)
107{
108 printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
109
110 switch (cmd)
111 {
112 case S3C2410_UDC_P_ENABLE :
113 h1940_latch_control(0, H1940_LATCH_USB_DP);
114 break;
115 case S3C2410_UDC_P_DISABLE :
116 h1940_latch_control(H1940_LATCH_USB_DP, 0);
117 break;
118 case S3C2410_UDC_P_RESET :
119 break;
120 default:
121 break;
122 }
123}
124
125static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
126 .udc_command = h1940_udc_pullup,
127 .vbus_pin = S3C2410_GPG5,
128 .vbus_pin_inverted = 1,
129};
130
131
105 132
106/** 133/**
107 * Set lcd on or off 134 * Set lcd on or off
@@ -146,12 +173,19 @@ static struct s3c2410fb_mach_info h1940_lcdcfg __initdata = {
146 .bpp= {16,16,16}, 173 .bpp= {16,16,16},
147}; 174};
148 175
176static struct platform_device s3c_device_leds = {
177 .name = "h1940-leds",
178 .id = -1,
179};
180
149static struct platform_device *h1940_devices[] __initdata = { 181static struct platform_device *h1940_devices[] __initdata = {
150 &s3c_device_usb, 182 &s3c_device_usb,
151 &s3c_device_lcd, 183 &s3c_device_lcd,
152 &s3c_device_wdt, 184 &s3c_device_wdt,
153 &s3c_device_i2c, 185 &s3c_device_i2c,
154 &s3c_device_iis, 186 &s3c_device_iis,
187 &s3c_device_usbgadget,
188 &s3c_device_leds,
155}; 189};
156 190
157static struct s3c24xx_board h1940_board __initdata = { 191static struct s3c24xx_board h1940_board __initdata = {
@@ -179,7 +213,23 @@ static void __init h1940_init_irq(void)
179 213
180static void __init h1940_init(void) 214static void __init h1940_init(void)
181{ 215{
216 u32 tmp;
217
182 s3c24xx_fb_set_platdata(&h1940_lcdcfg); 218 s3c24xx_fb_set_platdata(&h1940_lcdcfg);
219 s3c24xx_udc_set_platdata(&h1940_udc_cfg);
220
221 /* Turn off suspend on both USB ports, and switch the
222 * selectable USB port to USB device mode. */
223
224 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
225 S3C2410_MISCCR_USBSUSPND0 |
226 S3C2410_MISCCR_USBSUSPND1, 0x0);
227
228 tmp = (
229 0x78 << S3C2410_PLLCON_MDIVSHIFT)
230 | (0x02 << S3C2410_PLLCON_PDIVSHIFT)
231 | (0x03 << S3C2410_PLLCON_SDIVSHIFT);
232 writel(tmp, S3C2410_UPLLCON);
183} 233}
184 234
185MACHINE_START(H1940, "IPAQ-H1940") 235MACHINE_START(H1940, "IPAQ-H1940")
@@ -189,6 +239,6 @@ MACHINE_START(H1940, "IPAQ-H1940")
189 .boot_params = S3C2410_SDRAM_PA + 0x100, 239 .boot_params = S3C2410_SDRAM_PA + 0x100,
190 .map_io = h1940_map_io, 240 .map_io = h1940_map_io,
191 .init_irq = h1940_init_irq, 241 .init_irq = h1940_init_irq,
192 .init_machine = h1940_init, 242 .init_machine = h1940_init,
193 .timer = &s3c24xx_timer, 243 .timer = &s3c24xx_timer,
194MACHINE_END 244MACHINE_END