rendered paste bodyFrom 3d1f40584aa51dd08bca5e10e38e68b2dba0ddc1 Mon Sep 17 00:00:00 2001From: Philipp Zabel <philipp.zabel@gmail.com>Date: Fri, 30 May 2008 20:48:23 +0200Subject: [PATCH] WIP hx4700: add pxa27x-udc support--- arch/arm/mach-pxa/hx4700.c | 26 ++++++++++++++++++++++++++ include/asm-arm/arch-pxa/hx4700.h | 2 +- 2 files changed, 27 insertions(+), 1 deletions(-)diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.cindex 85ef656..aa05ab3 100644--- a/arch/arm/mach-pxa/hx4700.c+++ b/arch/arm/mach-pxa/hx4700.c@@ -38,6 +38,7 @@ #include <asm/arch/irda.h> #include <asm/arch/mfp-pxa27x.h> #include <asm/arch/pxa-regs.h>+#include <asm/arch/udc.h> #include <video/w100fb.h> @@ -677,6 +678,25 @@ static struct platform_device power_supply = { * USB Device Controller */ +static void hx4700_udc_command(int cmd)+{+ switch (cmd) {+ case PXA2XX_UDC_CMD_CONNECT:+ pr_info("hx4700_udc_command: connect\n");+ //UP2OCR = UP2OCR_HXOE | UP2OCR_DMPUE | UP2OCR_DMPUBE;+ gpio_set_value(GPIO76_HX4700_USBC_PUEN, 1);+ break;+ case PXA2XX_UDC_CMD_DISCONNECT:+ pr_info("hx4700_udc_command: disconnect\n");+ gpio_set_value(GPIO76_HX4700_USBC_PUEN, 0);+ break;+ }+}++static struct pxa2xx_udc_mach_info hx4700_udc_mach_info __initdata = {+ .udc_command = hx4700_udc_command,+};+ /* * Platform devices */@@ -733,6 +753,12 @@ static void __init hx4700_init( void ) pxa_set_ficp_info(&hx4700_ficp_info); } pxa_set_i2c_info(NULL);++ err = gpio_request(GPIO76_HX4700_USBC_PUEN, "USBC_PUEN");+ if (!err) {+ gpio_direction_output(GPIO76_HX4700_USBC_PUEN, 0);+ pxa_set_udc_info(&hx4700_udc_mach_info);+ } } MACHINE_START(H4700, "HP iPAQ HX4700")diff --git a/include/asm-arm/arch-pxa/hx4700.h b/include/asm-arm/arch-pxa/hx4700.hindex 7162156..58f81bd 100644--- a/include/asm-arm/arch-pxa/hx4700.h+++ b/include/asm-arm/arch-pxa/hx4700.h@@ -51,7 +51,7 @@ #define GPIO73_HX4700_LCD_UD_1 73 #define GPIO_NR_HX4700_EARPHONE_DET_N 75-#define GPIO76_HX4700_USB_PUEN 76+#define GPIO76_HX4700_USBC_PUEN 76 #define GPIO_NR_HX4700_CPU_GP_RESET_N 81 #define GPIO82_HX4700_EUART_RESET 82-- 1.5.5.3