msm: board-msm7x27: Remove platform devices for USB functions
With the new USB composite framework, USB functions need
not to be registered as platform devices.
Register only android_composite device as platform device
which is used to pass update_pid_serial_number function
callback used by DIAG.
Change-Id: Iedfdd46999f2063c42e4744afa75214ce4b7271e
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm7x27.c b/arch/arm/mach-msm/board-msm7x27.c
index 5f205f4..9629b5c 100644
--- a/arch/arm/mach-msm/board-msm7x27.c
+++ b/arch/arm/mach-msm/board-msm7x27.c
@@ -58,16 +58,17 @@
#include <linux/android_pmem.h>
#include <mach/camera.h>
+#ifdef CONFIG_USB_G_ANDROID
+#include <linux/usb/android.h>
+#include <mach/usbdiag.h>
+#endif
+
#include "devices.h"
#include "clock.h"
#include "acpuclock.h"
#include "msm-keypad-devices.h"
#include "pm.h"
-#ifdef CONFIG_USB_ANDROID
-#include <linux/usb/android_composite.h>
-#endif
-
#ifdef CONFIG_ARCH_MSM7X25
#define MSM_PMEM_MDP_SIZE 0xb21000
#define MSM_PMEM_ADSP_SIZE 0x97b000
@@ -103,135 +104,16 @@
},
};
-#ifdef CONFIG_USB_FUNCTION
-static struct usb_mass_storage_platform_data usb_mass_storage_pdata = {
- .nluns = 0x02,
- .buf_size = 16384,
- .vendor = "GOOGLE",
- .product = "Mass storage",
- .release = 0xffff,
+static struct platform_device smc91x_device = {
+ .name = "smc91x",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(smc91x_resources),
+ .resource = smc91x_resources,
};
-static struct platform_device mass_storage_device = {
- .name = "usb_mass_storage",
- .id = -1,
- .dev = {
- .platform_data = &usb_mass_storage_pdata,
- },
-};
-#endif
-#ifdef CONFIG_USB_ANDROID
-static char *usb_functions_default[] = {
- "diag",
- "modem",
- "nmea",
- "rmnet",
- "usb_mass_storage",
-};
-
-static char *usb_functions_default_adb[] = {
- "diag",
- "adb",
- "modem",
- "nmea",
- "rmnet",
- "usb_mass_storage",
-};
-
-static char *usb_functions_rndis[] = {
- "rndis",
-};
-
-static char *usb_functions_rndis_adb[] = {
- "rndis",
- "adb",
-};
-
-static char *usb_functions_all[] = {
-#ifdef CONFIG_USB_ANDROID_RNDIS
- "rndis",
-#endif
-#ifdef CONFIG_USB_ANDROID_DIAG
- "diag",
-#endif
- "adb",
-#ifdef CONFIG_USB_F_SERIAL
- "modem",
- "nmea",
-#endif
-#ifdef CONFIG_USB_ANDROID_RMNET
- "rmnet",
-#endif
- "usb_mass_storage",
-#ifdef CONFIG_USB_ANDROID_ACM
- "acm",
-#endif
-};
-
-static struct android_usb_product usb_products[] = {
- {
- .product_id = 0x9026,
- .num_functions = ARRAY_SIZE(usb_functions_default),
- .functions = usb_functions_default,
- },
- {
- .product_id = 0x9025,
- .num_functions = ARRAY_SIZE(usb_functions_default_adb),
- .functions = usb_functions_default_adb,
- },
- {
- .product_id = 0xf00e,
- .num_functions = ARRAY_SIZE(usb_functions_rndis),
- .functions = usb_functions_rndis,
- },
- {
- .product_id = 0x9024,
- .num_functions = ARRAY_SIZE(usb_functions_rndis_adb),
- .functions = usb_functions_rndis_adb,
- },
-};
-
-static struct usb_mass_storage_platform_data mass_storage_pdata = {
- .nluns = 1,
- .vendor = "Qualcomm Incorporated",
- .product = "Mass storage",
- .release = 0x0100,
- .can_stall = 1,
-};
-
-static struct platform_device usb_mass_storage_device = {
- .name = "usb_mass_storage",
- .id = -1,
- .dev = {
- .platform_data = &mass_storage_pdata,
- },
-};
-
-static struct usb_ether_platform_data rndis_pdata = {
- /* ethaddr is filled by board_serialno_setup */
- .vendorID = 0x05C6,
- .vendorDescr = "Qualcomm Incorporated",
-};
-
-static struct platform_device rndis_device = {
- .name = "rndis",
- .id = -1,
- .dev = {
- .platform_data = &rndis_pdata,
- },
-};
-
+#ifdef CONFIG_USB_G_ANDROID
static struct android_usb_platform_data android_usb_pdata = {
- .vendor_id = 0x05C6,
- .product_id = 0x9026,
- .version = 0x0100,
- .product_name = "Qualcomm HSUSB Device",
- .manufacturer_name = "Qualcomm Incorporated",
- .num_products = ARRAY_SIZE(usb_products),
- .products = usb_products,
- .num_functions = ARRAY_SIZE(usb_functions_all),
- .functions = usb_functions_all,
- .serial_number = "1234567890ABCDEF",
+ .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
};
static struct platform_device android_usb_device = {
@@ -241,114 +123,6 @@
.platform_data = &android_usb_pdata,
},
};
-
-static int __init board_serialno_setup(char *serialno)
-{
- int i;
- char *src = serialno;
-
- /* create a fake MAC address from our serial number.
- * first byte is 0x02 to signify locally administered.
- */
- rndis_pdata.ethaddr[0] = 0x02;
- for (i = 0; *src; i++) {
- /* XOR the USB serial across the remaining bytes */
- rndis_pdata.ethaddr[i % (ETH_ALEN - 1) + 1] ^= *src++;
- }
-
- android_usb_pdata.serial_number = serialno;
- return 1;
-}
-__setup("androidboot.serialno=", board_serialno_setup);
-#endif
-
-static struct platform_device smc91x_device = {
- .name = "smc91x",
- .id = 0,
- .num_resources = ARRAY_SIZE(smc91x_resources),
- .resource = smc91x_resources,
-};
-
-#ifdef CONFIG_USB_FUNCTION
-static struct usb_function_map usb_functions_map[] = {
- {"diag", 0},
- {"adb", 1},
- {"modem", 2},
- {"nmea", 3},
- {"mass_storage", 4},
- {"ethernet", 5},
- {"rmnet", 6},
-};
-
-/* dynamic composition */
-static struct usb_composition usb_func_composition[] = {
- {
- .product_id = 0x9012,
- .functions = 0x5, /* 0101 */
- },
-
- {
- .product_id = 0x9013,
- .functions = 0x15, /* 10101 */
- },
-
- {
- .product_id = 0x9014,
- .functions = 0x30, /* 110000 */
- },
-
- {
- .product_id = 0x9016,
- .functions = 0xD, /* 01101 */
- },
-
- {
- .product_id = 0x9017,
- .functions = 0x1D, /* 11101 */
- },
-
- {
- .product_id = 0xF000,
- .functions = 0x10, /* 10000 */
- },
-
- {
- .product_id = 0xF009,
- .functions = 0x20, /* 100000 */
- },
-
- {
- .product_id = 0x9018,
- .functions = 0x1F, /* 011111 */
- },
-#ifdef CONFIG_USB_FUNCTION_RMNET
- {
- .product_id = 0x9021,
- /* DIAG + RMNET */
- .functions = 0x41,
- },
- {
- .product_id = 0x9022,
- /* DIAG + ADB + RMNET */
- .functions = 0x43,
- },
-#endif
-
-};
-
-static struct msm_hsusb_platform_data msm_hsusb_pdata = {
- .version = 0x0100,
- .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_65NM),
- .vendor_id = 0x5c6,
- .product_name = "Qualcomm HSUSB Device",
- .serial_number = "1234567890ABCDEF",
- .manufacturer_name = "Qualcomm Incorporated",
- .compositions = usb_func_composition,
- .num_compositions = ARRAY_SIZE(usb_func_composition),
- .function_map = usb_functions_map,
- .num_functions = ARRAY_SIZE(usb_functions_map),
- .config_gpio = NULL,
-};
#endif
#ifdef CONFIG_USB_EHCI_MSM_72K
@@ -1410,22 +1184,10 @@
#endif
#endif
-#ifdef CONFIG_USB_FUNCTION
- &msm_device_hsusb_peripheral,
- &mass_storage_device,
-#endif
-
-#ifdef CONFIG_USB_ANDROID
- &usb_mass_storage_device,
- &rndis_device,
-#ifdef CONFIG_USB_ANDROID_DIAG
- &usb_diag_device,
-#endif
-#ifdef CONFIG_USB_F_SERIAL
- &usb_gadget_fserial_device,
-#endif
+#ifdef CONFIG_USB_G_ANDROID
&android_usb_device,
#endif
+
&msm_device_i2c,
&smc91x_device,
&msm_device_tssc,
@@ -1891,13 +1653,6 @@
usb_mpp_init();
-#ifdef CONFIG_USB_FUNCTION
- msm_hsusb_pdata.swfi_latency =
- msm7x27_pm_data
- [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
-
- msm_device_hsusb_peripheral.dev.platform_data = &msm_hsusb_pdata;
-#endif
#ifdef CONFIG_USB_MSM_OTG_72K
msm_device_otg.dev.platform_data = &msm_otg_pdata;