Here you go - this is a patch against the android-msm-2.6.27 branch.

I don't have a config.gz from the G1, so I don't know what specific options
it uses so there may be compilation failures resulting from disabling the
USB_FUNCTION stuff. If you could send me a copy of your config.gz, I can
sort this out.

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel
diff --git a/arch/arm/mach-msm/htc_battery.c b/arch/arm/mach-msm/htc_battery.c
index deb5a12..6d902cd 100644
--- a/arch/arm/mach-msm/htc_battery.c
+++ b/arch/arm/mach-msm/htc_battery.c
@@ -182,12 +182,14 @@ static struct power_supply htc_power_supplies[] = {
 	},
 };
 
-static void usb_status_notifier_func(int online);
 static int g_usb_online;
+#ifdef CONFIG_USB_FUNCTION
+static void usb_status_notifier_func(int online);
 static struct t_usb_status_notifier usb_status_notifier = {
 	.name = "htc_battery",
 	.func = usb_status_notifier_func,
 };
+#endif
 
 /* -------------------------------------------------------------------------- */
 
@@ -362,6 +364,7 @@ int htc_cable_status_update(int status)
 	return rc;
 }
 
+#ifdef CONFIG_USB_FUNCTION
 /* A9 reports USB charging when helf AC cable in and China AC charger. */
 /* Work arround: notify userspace AC charging first,
 and notify USB charging again when receiving usb connected notificaiton from usb driver. */
@@ -790,7 +793,9 @@ static int __init htc_battery_init(void)
 	wake_lock_init(&vbus_wake_lock, WAKE_LOCK_SUSPEND, "vbus_present");
 	mutex_init(&htc_batt_info.lock);
 	mutex_init(&htc_batt_info.rpc_lock);
+#ifdef CONFIG_USB_FUNCTION
 	usb_register_notifier(&usb_status_notifier);
+#endif
 	msm_rpc_create_server(&battery_server);
 	platform_driver_register(&htc_battery_driver);
 	return 0;
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index c24ad95..199a58f 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -55,6 +55,7 @@ config USB_ARCH_HAS_EHCI
 	default y if PPC_83xx
 	default y if SOC_AU1200
 	default y if ARCH_IXP4XX
+	default y if ARCH_MSM
 	default PCI
 
 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
diff --git a/drivers/usb/function/Kconfig b/drivers/usb/function/Kconfig
index b98b477..9743bbd 100644
--- a/drivers/usb/function/Kconfig
+++ b/drivers/usb/function/Kconfig
@@ -14,7 +14,7 @@ choice
 	
 config USB_FUNCTION_MSM_HSUSB
 	boolean "MSM7K Highspeed USB Peripheral Controller"
-	depends on ARCH_MSM
+	depends on ARCH_MSM && (!USB_EHCI_MSM7201)
 
 endchoice
 
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 228797e..c6d4c4c 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -88,6 +88,13 @@ config USB_EHCI_FSL
 	---help---
 	  Variation of ARC USB block used in some Freescale chips.
 
+config USB_EHCI_MSM7201
+	bool "Support for Qualcomm MSM7201 on-chip EHCI USB controller"
+	depends on USB_EHCI_HCD && ARCH_MSM && (!USB_FUNCTION)
+	select USB_EHCI_ROOT_HUB_TT
+	---help---
+	  Variation of ARC USB block used in Qualcomm MSM7201 chips.
+
 config USB_EHCI_HCD_PPC_OF
 	bool "EHCI support for PPC USB controller on OF platform bus"
 	depends on USB_EHCI_HCD && PPC_OF
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 8409e07..5ce2df4 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1040,6 +1040,11 @@ MODULE_LICENSE ("GPL");
 #define	PLATFORM_DRIVER		ixp4xx_ehci_driver
 #endif
 
+#ifdef CONFIG_ARCH_MSM
+#include "ehci-msm7201.c"
+#define	PLATFORM_DRIVER		ehci_msm7201_driver
+#endif
+
 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
     !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
 #error "missing bus glue for ehci-hcd"

Reply via email to