aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-02-12 18:39:08 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-02-14 10:04:17 -0500
commitecd1b171a76bb73196dbce4da9f64a4a0a9d098f (patch)
treed09991df9255705bbf93b3d3a3fb25a351976e6d /arch/arm
parent71a9c4241278c8104ff30233b9247c0857c404d7 (diff)
[ARM] 4175/1: SMDK2413: add udc pull-up control
USB gadget pull-up control and device addition for the SMDK2413/SMDK2412 board. Signed-off-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-s3c2412/mach-smdk2413.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index e385069b5ea1..b5befce6c8d3 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -37,6 +37,7 @@
37#include <asm/arch/regs-lcd.h> 37#include <asm/arch/regs-lcd.h>
38 38
39#include <asm/arch/idle.h> 39#include <asm/arch/idle.h>
40#include <asm/arch/udc.h>
40#include <asm/arch/fb.h> 41#include <asm/arch/fb.h>
41 42
42#include <asm/plat-s3c24xx/s3c2410.h> 43#include <asm/plat-s3c24xx/s3c2410.h>
@@ -75,12 +76,38 @@ static struct s3c2410_uartcfg smdk2413_uartcfgs[] __initdata = {
75 } 76 }
76}; 77};
77 78
79static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd)
80{
81 printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
82
83 switch (cmd)
84 {
85 case S3C2410_UDC_P_ENABLE :
86 s3c2410_gpio_setpin(S3C2410_GPF2, 1);
87 break;
88 case S3C2410_UDC_P_DISABLE :
89 s3c2410_gpio_setpin(S3C2410_GPF2, 0);
90 break;
91 case S3C2410_UDC_P_RESET :
92 break;
93 default:
94 break;
95 }
96}
97
98
99static struct s3c2410_udc_mach_info smdk2413_udc_cfg __initdata = {
100 .udc_command = smdk2413_udc_pullup,
101};
102
103
78static struct platform_device *smdk2413_devices[] __initdata = { 104static struct platform_device *smdk2413_devices[] __initdata = {
79 &s3c_device_usb, 105 &s3c_device_usb,
80 //&s3c_device_lcd, 106 //&s3c_device_lcd,
81 &s3c_device_wdt, 107 &s3c_device_wdt,
82 &s3c_device_i2c, 108 &s3c_device_i2c,
83 &s3c_device_iis, 109 &s3c_device_iis,
110 &s3c_device_usbgadget,
84}; 111};
85 112
86static struct s3c24xx_board smdk2413_board __initdata = { 113static struct s3c24xx_board smdk2413_board __initdata = {
@@ -109,7 +136,19 @@ static void __init smdk2413_map_io(void)
109} 136}
110 137
111static void __init smdk2413_machine_init(void) 138static void __init smdk2413_machine_init(void)
112{ 139{ /* Turn off suspend on both USB ports, and switch the
140 * selectable USB port to USB device mode. */
141
142 s3c2410_gpio_setpin(S3C2410_GPF2, 0);
143 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPIO_OUTPUT);
144
145 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
146 S3C2410_MISCCR_USBSUSPND0 |
147 S3C2410_MISCCR_USBSUSPND1, 0x0);
148
149
150 s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
151
113 smdk_machine_init(); 152 smdk_machine_init();
114} 153}
115 154