Index: linux-2.6-arm/arch/arm/mach-pxa/ezx.c =================================================================== --- linux-2.6-arm.orig/arch/arm/mach-pxa/ezx.c +++ linux-2.6-arm/arch/arm/mach-pxa/ezx.c @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include #include @@ -91,6 +93,27 @@ .lcd_conn = LCD_COLOR_TFT_18BPP, }; +/* UDC */ +static void ezx_udc_command(int cmd) +{ + u32 tmp; + + ezx_pcap_read(PCAP_REG_BUSCTRL, &tmp); + switch (cmd) { + case PXA2XX_UDC_CMD_DISCONNECT: + tmp &= ~PCAP_BUSCTRL_USB_PU; + break; + case PXA2XX_UDC_CMD_CONNECT: + tmp |= PCAP_BUSCTRL_USB_PU; + break; + } + ezx_pcap_write(PCAP_REG_BUSCTRL, tmp); +} + +static struct pxa2xx_udc_mach_info ezx_udc_info __initdata = { + .udc_command = ezx_udc_command, +}; + /* PCAP */ static void ezx_pcap_init(void) { @@ -100,6 +123,14 @@ /* set core voltage */ ezx_pcap_set_sw(SW1, SW_VOLTAGE, SW_VOLTAGE_1250); + + /* EMU hardcoded for usb */ + ezx_pcap_write(PCAP_REG_BUSCTRL, + (PCAP_BUSCTRL_RS232ENB | PCAP_BUSCTRL_VUSB_EN)); + gpio_direction_output(120, 0); + gpio_direction_output(119, 0); + UP2OCR = UP2OCR_SEOS(2); + pxa_set_udc_info(&ezx_udc_info); } static struct pcap_platform_data ezx_pcap_platform_data = {