mdm2: Replace hsic platform_add/remove with connect/disconnect

mdm2 driver calls platform add/remove apis to notify hsic about
peripheral(9x15) connection/disconnection. Instead include hsic
connect/disconnect apis to keep mdm driver unaware of hsic
disconnection and discovery logic

Change-Id: I3bbb0d652d60de4bc5941e31eebbd75bb10b69b7
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
diff --git a/arch/arm/mach-msm/mdm2.c b/arch/arm/mach-msm/mdm2.c
index 0737a81..91f8fc2 100644
--- a/arch/arm/mach-msm/mdm2.c
+++ b/arch/arm/mach-msm/mdm2.c
@@ -33,6 +33,7 @@
 #include <asm/mach-types.h>
 #include <asm/uaccess.h>
 #include <mach/mdm2.h>
+#include <mach/mdm-peripheral.h>
 #include <mach/restart.h>
 #include <mach/subsystem_notif.h>
 #include <mach/subsystem_restart.h>
@@ -49,7 +50,6 @@
 #define IFLINE_DOWN			0
 
 static int mdm_debug_on;
-static int ifline_status = IFLINE_UP;
 static struct mdm_callbacks mdm_cb;
 
 #define MDM_DBG(...)	do { if (mdm_debug_on) \
@@ -58,12 +58,7 @@
 
 static void power_on_mdm(struct mdm_modem_drv *mdm_drv)
 {
-	/* Remove hsic driver before powering on the modem. */
-	if (ifline_status == IFLINE_UP) {
-		MDM_DBG("%s: Removing hsic device\n", __func__);
-		platform_device_del(&msm_device_hsic_host);
-		ifline_status = IFLINE_DOWN;
-	}
+	peripheral_disconnect();
 
 	/* Pull both ERR_FATAL and RESET low */
 	MDM_DBG("Pulling PWR and RESET gpio's low\n");
@@ -82,10 +77,7 @@
 	gpio_direction_output(mdm_drv->ap2mdm_kpdpwr_n_gpio, 1);
 	usleep(1000);
 
-	/* Add back hsic device after modem power up */
-	MDM_DBG("%s: Adding hsic device\n", __func__);
-	platform_device_add(&msm_device_hsic_host);
-	ifline_status = IFLINE_UP;
+	peripheral_connect();
 
 	msleep(200);
 }
@@ -111,12 +103,8 @@
 			msleep(MDM_MODEM_DELTA);
 		}
 	}
-	/* Also remove the hsic device on 9k power down. */
-	MDM_DBG("%s: Removing hsic device\n", __func__);
-	if (ifline_status == IFLINE_UP) {
-		platform_device_del(&msm_device_hsic_host);
-		ifline_status = IFLINE_DOWN;
-	}
+
+	peripheral_disconnect();
 }
 
 static void normal_boot_done(struct mdm_modem_drv *mdm_drv)