diff -r -d -u -p a/drivers/power/qpnp-smbcharger_extension.c b/drivers/power/qpnp-smbcharger_extension.c
--- a/drivers/power/qpnp-smbcharger_extension.c	2015-11-27 00:35:54.000000000 -0800
+++ b/drivers/power/qpnp-smbcharger_extension.c	2017-09-09 00:32:39.000000000 -0700
@@ -49,7 +49,7 @@ static void somc_chg_weak_detect_weak_ch
 #define  ID_POLLING_TIMEOUT_MAX			(60000)
 #define  ID_POLLING_WAKE_LOCK_TIMEOUT_EXT	(1000)
 
-static bool force_id_polling_on;
+static bool force_id_polling_on = false;
 module_param(force_id_polling_on, bool, S_IRUSR | S_IWUSR);
 
 static bool id_polling_state;
@@ -1913,7 +1913,6 @@ void somc_chg_init(struct chg_somc_param
 	id_polling_state = false;
 	start_id_polling = false;
 	id_polling_timeout = ID_POLLING_TIMEOUT_DEFAULT;
-	force_id_polling_on = false;
 
 	INIT_DELAYED_WORK(&params->chg_key.remove_work,
 			somc_chg_remove_work);
diff -r -d -u -p a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
--- a/drivers/usb/dwc3/dwc3-msm.c	2015-11-27 00:35:55.000000000 -0800
+++ b/drivers/usb/dwc3/dwc3-msm.c	2017-09-09 00:32:39.000000000 -0700
@@ -105,6 +105,10 @@ int dcp_max_current = DWC3_IDEV_CHG_MAX;
 module_param(dcp_max_current, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(dcp_max_current, "max current drawn for DCP charger");
 
+static bool force_float_on_bsv = true;
+module_param(force_float_on_bsv, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(force_float_on_bsv, "Ignore OTG ID_GROUND when B-device power is sensed");
+
 #define TA2227_ENDMODE1	"50000000"
 #define TA2227_ENDMODE2	"50"
 static bool factorymode;
@@ -2908,7 +2912,7 @@ static void dwc3_id_work(struct work_str
 		/* MHL cable: stop peripheral */
 		mdwc->ext_xceiv.id = DWC3_ID_FLOAT;
 		mdwc->ext_xceiv.bsv = false;
-	} else if (mdwc->ext_xceiv.bsv || mdwc->ext_bsv) {
+	} else if ((mdwc->ext_xceiv.bsv || mdwc->ext_bsv) && force_float_on_bsv) {
 		if (mdwc->ext_xceiv.id == DWC3_ID_FLOAT) {
 			dev_dbg(mdwc->dev, "%s: ignore FLOAT\n", __func__);
 			return;
diff -r -d -u -p a/drivers/usb/dwc3/dwc3_otg.c b/drivers/usb/dwc3/dwc3_otg.c
--- a/drivers/usb/dwc3/dwc3_otg.c	2015-11-27 00:35:55.000000000 -0800
+++ b/drivers/usb/dwc3/dwc3_otg.c	2017-09-09 00:33:00.000000000 -0700
@@ -39,6 +39,17 @@ static int max_chgr_retry_count = MAX_IN
 module_param(max_chgr_retry_count, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(max_chgr_retry_count, "Max invalid charger retry count");
 
+/* Module params for aca enabling */
+static bool aca_enable = false;
+module_param(aca_enable, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(aca_enable, "Enable ACA host mode to allow charging and host");
+static bool prop_chg_aca_enable = false;
+module_param(prop_chg_aca_enable, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(prop_chg_aca_enable, "Enable proprietary charger detection to also trigger ACA host mode");
+
+/* Flag for choosing either ID (host w/ vbus) or ID_A (host w/ charge) based on aca_enable toggle */
+int ID_MODE;
+
 #define DWC3_OTG_TIME_NO_DEVICE (10000)
 #define DWC3_OTG_STOP_HOST_RETRY_MAX (10)
 static unsigned int no_device_timeout;
@@ -46,7 +57,7 @@ module_param(no_device_timeout, uint, S_
 static unsigned int stop_host_retry_max;
 module_param(stop_host_retry_max, uint, S_IRUSR | S_IWUSR);
 
-static bool no_device_timeout_enable;
+static bool no_device_timeout_enable = true;
 module_param(no_device_timeout_enable, bool, S_IRUSR | S_IWUSR);
 
 static bool not_use_sw_chg_det;
@@ -171,38 +182,42 @@ static int dwc3_otg_start_host(struct us
 	if (!dwc->xhci)
 		return -EINVAL;
 
-	if (!dotg->vbus_otg) {
-		dotg->vbus_otg = devm_regulator_get(dwc->dev->parent,
-							"vbus_dwc3");
-		if (IS_ERR(dotg->vbus_otg)) {
-			dev_err(dwc->dev, "Failed to get vbus regulator\n");
-			ret = PTR_ERR(dotg->vbus_otg);
-			dotg->vbus_otg = 0;
-			return ret;
+	if (ID_MODE == ID) {
+		if (!dotg->vbus_otg) {
+			dotg->vbus_otg = devm_regulator_get(dwc->dev->parent,
+								"vbus_dwc3");
+			if (IS_ERR(dotg->vbus_otg)) {
+				dev_err(dwc->dev, "Failed to get vbus regulator\n");
+				ret = PTR_ERR(dotg->vbus_otg);
+				dotg->vbus_otg = 0;
+				return ret;
+			}
 		}
 	}
 
 	if (on) {
 		dev_dbg(otg->phy->dev, "%s: turn on host\n", __func__);
 
-		dwc3_otg_notify_host_mode(otg, on);
-		usb_phy_notify_connect(dotg->dwc->usb2_phy, USB_SPEED_HIGH);
+		if (ID_MODE == ID) {
+			dwc3_otg_notify_host_mode(otg, on);
+			usb_phy_notify_connect(dotg->dwc->usb2_phy, USB_SPEED_HIGH);
 
-		/* register ocp notification */
-		if (ext_xceiv && ext_xceiv->ext_ocp_notification.notify) {
-			ret = regulator_register_ocp_notification(
-					dotg->vbus_otg,
-					&ext_xceiv->ext_ocp_notification);
-			if (ret)
-				dev_err(otg->phy->dev,
-					"unable to register ocp\n");
-		}
+			/* register ocp notification */
+			if (ext_xceiv && ext_xceiv->ext_ocp_notification.notify) {
+				ret = regulator_register_ocp_notification(
+						dotg->vbus_otg,
+						&ext_xceiv->ext_ocp_notification);
+				if (ret)
+					dev_err(otg->phy->dev,
+						"unable to register ocp\n");
+			}
 
-		ret = regulator_enable(dotg->vbus_otg);
-		if (ret) {
-			dev_err(otg->phy->dev, "unable to enable vbus_otg\n");
-			dwc3_otg_notify_host_mode(otg, 0);
-			return ret;
+			ret = regulator_enable(dotg->vbus_otg);
+			if (ret) {
+				dev_err(otg->phy->dev, "unable to enable vbus_otg\n");
+				dwc3_otg_notify_host_mode(otg, 0);
+				return ret;
+			}
 		}
 
 		/* The delay between enabling regulator and adding the
@@ -225,8 +240,10 @@ static int dwc3_otg_start_host(struct us
 			dev_err(otg->phy->dev,
 				"%s: failed to add XHCI pdev ret=%d\n",
 				__func__, ret);
-			regulator_disable(dotg->vbus_otg);
-			dwc3_otg_notify_host_mode(otg, 0);
+			if (ID_MODE == ID) {
+				regulator_disable(dotg->vbus_otg);
+				dwc3_otg_notify_host_mode(otg, 0);
+			}
 			return ret;
 		}
 
@@ -258,26 +275,29 @@ static int dwc3_otg_start_host(struct us
 	} else {
 		dev_dbg(otg->phy->dev, "%s: turn off host\n", __func__);
 
-		ret = regulator_disable(dotg->vbus_otg);
-		if (ret) {
-			dev_err(otg->phy->dev, "unable to disable vbus_otg\n");
-			return ret;
-		}
+		if (ID_MODE == ID) {
+			ret = regulator_disable(dotg->vbus_otg);
+			if (ret) {
+				dev_err(otg->phy->dev, "unable to disable vbus_otg\n");
+				return ret;
+			}
 
-		dbg_event(0xFF, "StHost get", 0);
 
-		/* unregister ocp notification */
-		if (ext_xceiv && ext_xceiv->ext_ocp_notification.notify) {
-			ret = regulator_register_ocp_notification(
-					dotg->vbus_otg, NULL);
-			if (ret)
-				dev_err(otg->phy->dev,
-					"unable to unregister ocp\n");
+			/* unregister ocp notification */
+			if (ext_xceiv && ext_xceiv->ext_ocp_notification.notify) {
+				ret = regulator_register_ocp_notification(
+						dotg->vbus_otg, NULL);
+				if (ret)
+					dev_err(otg->phy->dev,
+						"unable to unregister ocp\n");
+			}
+
+			usb_phy_notify_disconnect(dotg->dwc->usb2_phy, USB_SPEED_HIGH);
+			dwc3_otg_notify_host_mode(otg, on);
 		}
 
+		dbg_event(0xFF, "StHost get", 0);
 		pm_runtime_get(dwc->dev);
-		usb_phy_notify_disconnect(dotg->dwc->usb2_phy, USB_SPEED_HIGH);
-		dwc3_otg_notify_host_mode(otg, on);
 		otg->host = NULL;
 		if (dotg->no_device_timeout_enabled) {
 			dotg->no_device_timeout_enabled = 0;
@@ -454,6 +474,13 @@ int dwc3_set_charger(struct usb_otg *otg
 	return 0;
 }
 
+static inline void dwc3_aca_toggle_id(struct dwc3_otg *dotg)
+{
+	ID_MODE = (!aca_enable) ? ID : ID_A;
+	set_bit((ID_MODE == ID) ? ID_A : ID, &dotg->inputs);
+	clear_bit(ID_MODE, &dotg->inputs);
+}
+
 /**
  * dwc3_ext_event_notify - callback to handle events from external transceiver
  * @otg: Pointer to the otg transceiver structure
@@ -502,11 +529,12 @@ static void dwc3_ext_event_notify(struct
 				dev_warn(phy->dev, "pm_runtime_get failed!!\n");
 		}
 		if (ext_xceiv->id == DWC3_ID_FLOAT) {
-			dev_dbg(phy->dev, "XCVR: ID set\n");
+			dev_dbg(phy->dev, "XCVR: ID/ID_A set\n");
 			set_bit(ID, &dotg->inputs);
-		} else {
-			dev_dbg(phy->dev, "XCVR: ID clear\n");
-			clear_bit(ID, &dotg->inputs);
+			set_bit(ID_A, &dotg->inputs);
+		} else if (phy->state != OTG_STATE_A_HOST) {
+			dev_dbg(phy->dev, "XCVR: ID_MODE clear\n");
+			dwc3_aca_toggle_id(dotg);
 		}
 
 		if (ext_xceiv->bsv) {
@@ -660,6 +688,7 @@ void dwc3_otg_init_sm(struct dwc3_otg *d
 		dev_err(phy->dev, "%s: completion timeout\n", __func__);
 		/* We can safely assume no cable connected */
 		set_bit(ID, &dotg->inputs);
+		set_bit(ID_A, &dotg->inputs);
 	}
 
 	/*
@@ -701,6 +730,9 @@ static void dwc3_otg_sm_work(struct work
 	bool work = 0;
 	int ret = 0;
 	unsigned long delay = 0;
+	/* Flag to determine the current ACA host mode status */
+	static bool acaenabled;
+	bool prop_chg_aca = aca_enable && prop_chg_aca_enable;
 
 	pm_runtime_resume(phy->dev);
 	dev_dbg(phy->dev, "%s state\n", usb_otg_state_string(phy->state));
@@ -717,8 +749,8 @@ static void dwc3_otg_sm_work(struct work
 					 "couldn't get usb power supply\n");
 		}
 
-		/* Switch to A or B-Device according to ID / BSV */
-		if (!test_bit(ID, &dotg->inputs)) {
+		/* Switch to A or B-Device according to ID_MODE / BSV */
+		if (!test_bit(ID_MODE, &dotg->inputs)) {
 			dev_dbg(phy->dev, "!id\n");
 			phy->state = OTG_STATE_A_IDLE;
 			work = 1;
@@ -735,32 +767,40 @@ static void dwc3_otg_sm_work(struct work
 		break;
 
 	case OTG_STATE_B_IDLE:
-		if (!test_bit(ID, &dotg->inputs)) {
+		if (!test_bit(ID_MODE, &dotg->inputs)) {
 			dev_dbg(phy->dev, "!id\n");
 			phy->state = OTG_STATE_A_IDLE;
 			work = 1;
-			dotg->charger_retry_count = 0;
-			if (charger) {
-				if (charger->chg_type == DWC3_INVALID_CHARGER)
-					charger->start_detection(dotg->charger,
-									false);
-				else
-					charger->chg_type =
-							DWC3_INVALID_CHARGER;
+			if (!(prop_chg_aca &&
+				charger->chg_type == DWC3_PROPRIETARY_CHARGER)) {
+				dotg->charger_retry_count = 0;
+				if (charger) {
+					if (charger->chg_type == DWC3_INVALID_CHARGER)
+						charger->start_detection(dotg->charger,
+										false);
+					else
+						charger->chg_type =
+								DWC3_INVALID_CHARGER;
+				}
+				dwc3_otg_set_power(phy, 0);
 			}
-			dwc3_otg_set_power(phy, 0);
 		} else if (test_bit(B_SESS_VLD, &dotg->inputs)) {
 			dev_dbg(phy->dev, "b_sess_vld\n");
 			if (charger) {
 				/* Has charger been detected? If no detect it */
 				switch (charger->chg_type) {
-				case DWC3_DCP_CHARGER:
 				case DWC3_PROPRIETARY_CHARGER:
+					if (prop_chg_aca) {
+						dwc3_aca_toggle_id(dotg);
+						work = 1;
+					}
+				case DWC3_DCP_CHARGER:
 					dev_dbg(phy->dev, "lpm, DCP charger\n");
 					dwc3_otg_set_power(phy,
 						dcp_max_current);
 					dbg_event(0xFF, "PROPCHG put", 0);
-					pm_runtime_put_sync(phy->dev);
+					if (!prop_chg_aca)
+						pm_runtime_put_sync(phy->dev);
 					break;
 				case DWC3_PROPRIETARY_1000MA:
 					dev_dbg(phy->dev, "lpm, DCP charger\n");
@@ -855,7 +895,7 @@ static void dwc3_otg_sm_work(struct work
 
 	case OTG_STATE_B_PERIPHERAL:
 		if (!test_bit(B_SESS_VLD, &dotg->inputs) ||
-				!test_bit(ID, &dotg->inputs)) {
+				!test_bit(ID_MODE, &dotg->inputs)) {
 			dev_dbg(phy->dev, "!id || !bsv\n");
 			dwc3_otg_start_peripheral(&dotg->otg, 0);
 			phy->state = OTG_STATE_B_IDLE;
@@ -871,7 +911,7 @@ static void dwc3_otg_sm_work(struct work
 
 	case OTG_STATE_A_IDLE:
 		/* Switch to A-Device*/
-		if (test_bit(ID, &dotg->inputs)) {
+		if (test_bit(ID_MODE, &dotg->inputs)) {
 			dev_dbg(phy->dev, "id\n");
 			phy->state = OTG_STATE_B_IDLE;
 			dotg->vbus_retry_count = 0;
@@ -885,42 +925,57 @@ static void dwc3_otg_sm_work(struct work
 			/* staying on here until exit from A-Device */
 		} else {
 			phy->state = OTG_STATE_A_HOST;
-			ret = dwc3_otg_start_host(&dotg->otg, 1);
-			if ((ret == -EPROBE_DEFER) &&
-						dotg->vbus_retry_count < 3) {
-				/*
-				 * Get regulator failed as regulator driver is
-				 * not up yet. Will try to start host after 1sec
-				 */
-				phy->state = OTG_STATE_A_IDLE;
-				dev_dbg(phy->dev, "Unable to get vbus regulator. Retrying...\n");
-				delay = VBUS_REG_CHECK_DELAY;
-				work = 1;
-				dotg->vbus_retry_count++;
-			} else if (ret) {
-				dev_dbg(phy->dev, "enter lpm as\n"
-					"unable to start A-device\n");
-				phy->state = OTG_STATE_A_IDLE;
-				dbg_event(0xFF, "AIDL put", 0);
-				pm_runtime_put_sync(phy->dev);
-				return;
+			/* Wait, as host must be enabled after power */
+			if (ID_MODE == ID_A) {
+				acaenabled = 0;
+				/* If B_SESS_VLD went off already, proceed to enable host */
+				if (test_bit(B_SESS_VLD, &dotg->inputs)) {
+					work = 1;
+					break;
+				}
+				/* Ensure there's no charger before suspending */
+				msleep(200);
+				if (!dotg->ext_xceiv->bsv)
+					pm_runtime_put_sync(phy->dev);
 			} else {
-				/*
-				 * delay 1s to allow for xHCI to detect
-				 * just-attached devices before allowing
-				 * runtime suspend
-				 */
-				dev_dbg(phy->dev, "a_host state entered\n");
-				delay = VBUS_REG_CHECK_DELAY;
-				work = 1;
+				ret = dwc3_otg_start_host(&dotg->otg, 1);
+				if ((ret == -EPROBE_DEFER) &&
+							dotg->vbus_retry_count < 3) {
+					/*
+					 * Get regulator failed as regulator driver is
+					 * not up yet. Will try to start host after 1sec
+					 */
+					phy->state = OTG_STATE_A_IDLE;
+					dev_dbg(phy->dev, "Unable to get vbus regulator. Retrying...\n");
+					delay = VBUS_REG_CHECK_DELAY;
+					work = 1;
+					dotg->vbus_retry_count++;
+				} else if (ret) {
+					dev_dbg(phy->dev, "enter lpm as\n"
+						"unable to start A-device\n");
+					phy->state = OTG_STATE_A_IDLE;
+					dbg_event(0xFF, "AIDL put", 0);
+					pm_runtime_put_sync(phy->dev);
+					return;
+				} else {
+					/*
+					 * delay 1s to allow for xHCI to detect
+					 * just-attached devices before allowing
+					 * runtime suspend
+					 */
+					dev_dbg(phy->dev, "a_host state entered\n");
+					delay = VBUS_REG_CHECK_DELAY;
+					work = 1;
+				}
 			}
 		}
 		break;
 
 	case OTG_STATE_A_HOST:
-		if (test_bit(ID, &dotg->inputs)) {
+		if (test_bit(ID_MODE, &dotg->inputs)) {
 			dev_dbg(phy->dev, "id\n");
-			dwc3_otg_start_host(&dotg->otg, 0);
+			if (ID_MODE == ID || acaenabled)
+				dwc3_otg_start_host(&dotg->otg, 0);
 			phy->state = OTG_STATE_B_IDLE;
 			dotg->vbus_retry_count = 0;
 			work = 1;
@@ -936,6 +991,93 @@ static void dwc3_otg_sm_work(struct work
 #ifdef CONFIG_USB_HOST_EXTRA_NOTIFICATION
 			host_send_uevent(USB_HOST_EXT_EVENT_VBUS_DROP);
 #endif
+		} else if (test_bit(B_SESS_VLD, &dotg->inputs)) {
+			if (ID_MODE == ID_A && !acaenabled) {
+				dev_dbg(phy->dev, "b_sess_vld\n");
+				/* Has charger been detected? If no detect it */
+				switch (charger->chg_type) {
+			 	case DWC3_PROPRIETARY_CHARGER:
+					if (prop_chg_aca)
+						break;
+				case DWC3_DCP_CHARGER:
+					dwc3_otg_set_power(phy,
+							dcp_max_current);
+					break;
+			 	case DWC3_PROPRIETARY_1000MA:
+					dwc3_otg_set_power(phy,
+							DWC3_1000MA_CHG_MAX);
+					break;
+			 	case DWC3_PROPRIETARY_500MA:
+					dwc3_otg_set_power(phy,
+							DWC3_500MA_CHG_MAX);
+					break;
+				case DWC3_CDP_CHARGER:
+					dwc3_otg_set_power(phy,
+							DWC3_IDEV_CHG_MAX);
+					break;
+				case DWC3_SDP_CHARGER:
+					break;
+				case DWC3_FLOATED_CHARGER:
+					if (dotg->charger_retry_count <
+						max_chgr_retry_count)
+						dotg->charger_retry_count++;
+					/*
+					 * In case of floating charger, if
+					 * retry count equal to max retry count
+					 * notify PMIC about floating charger
+					 * and put Hw in low power mode. Else
+					 * perform charger detection again by
+					 * calling start_detection() with false
+					 * and then with true argument.
+					 */
+					if (dotg->charger_retry_count ==
+						max_chgr_retry_count) {
+						dwc3_otg_set_power(phy, 0);
+						dwc3_otg_set_invalid_charger(phy);
+						dbg_event(0xFF, "FLCHG put", 0);
+						pm_runtime_put_sync(phy->dev);
+						return;
+					}
+					charger->start_detection(dotg->charger,
+									false);
+
+					delay = msecs_to_jiffies(100 *
+						dotg->charger_retry_count);
+					work = 1;
+					break;
+				default:
+					dev_dbg(phy->dev, "chg_det started\n");
+					charger->start_detection(charger, true);
+					return;
+				}
+
+				ret = dwc3_otg_start_host(&dotg->otg, 1);
+				if (!ret)
+					acaenabled = 1;
+				else {
+					/*
+					 * Probably set_host was not called yet.
+					 * We will re-try as soon as it will be called
+					 */
+    
+					dev_dbg(phy->dev, "enter lpm as\n"
+						"unable to start A-device\n");
+					pm_runtime_put_sync(phy->dev);
+					return;
+				}
+			}
+		} else if (ID_MODE == ID_A) {
+			/* Charger has been removed */
+			dev_dbg(phy->dev, "Charger removed, trying to suspend\n");
+			if (acaenabled) {
+				dwc3_otg_start_host(&dotg->otg, 0);
+				acaenabled = 0;
+			}
+			charger->start_detection(dotg->charger, false);
+
+			dotg->charger_retry_count = 0;
+			dwc3_otg_set_power(phy, 0);
+			pm_runtime_put_sync(phy->dev);
 		} else {
 			dev_dbg(phy->dev, "still in a_host state. Resuming root hub.\n");
 			dbg_event(0xFF, "AHOST put", 0);
@@ -1003,8 +1145,6 @@ int dwc3_otg_init(struct dwc3 *dwc)
 
 	stop_host_retry_max = DWC3_OTG_STOP_HOST_RETRY_MAX;
 
-	no_device_timeout_enable = true;
-
 	dbg_event(0xFF, "OTGInit get", 0);
 	pm_runtime_get(dwc->dev);
 
diff -r -d -u -p a/drivers/usb/dwc3/dwc3_otg.h b/drivers/usb/dwc3/dwc3_otg.h
--- a/drivers/usb/dwc3/dwc3_otg.h	2015-11-27 00:35:55.000000000 -0800
+++ b/drivers/usb/dwc3/dwc3_otg.h	2017-09-09 00:32:39.000000000 -0700
@@ -61,8 +61,9 @@ struct dwc3_otg {
 	struct dwc3_ext_xceiv	*ext_xceiv;
 #define ID		 0
 #define B_SESS_VLD	 1
-#define DWC3_OTG_SUSPEND 2
-#define A_VBUS_DROP_DET	 3
+#define ID_A		 2
+#define DWC3_OTG_SUSPEND 3
+#define A_VBUS_DROP_DET	 4
 	unsigned long inputs;
 	struct power_supply	*psy;
 	struct completion	dwc3_xcvr_vbus_init;
diff -r -d -u -p a/drivers/video/msm/mdss/mhl_porting/mhl_platform_base.c b/drivers/video/msm/mdss/mhl_porting/mhl_platform_base.c
--- a/drivers/video/msm/mdss/mhl_porting/mhl_platform_base.c	2015-11-27 00:35:55.000000000 -0800
+++ b/drivers/video/msm/mdss/mhl_porting/mhl_platform_base.c	2017-09-09 00:32:39.000000000 -0700
@@ -90,14 +90,18 @@ static void mhl_unlock(struct wake_lock 
 
 /* It should be removed later */
 #ifdef MHL_PMIC_VMIN_SET
+# ifdef CONFIG_QPNP_SMBCHARGER_EXTENSION
 extern int somc_chg_notify_mhl_state(int state);
+# endif
 #endif
 
 static void mhl_pf_external_notify(int data)
 {
 	/* noitfy charger of mhl status */
 #ifdef MHL_PMIC_VMIN_SET
+# ifdef CONFIG_QPNP_SMBCHARGER_EXTENSION
 	somc_chg_notify_mhl_state(data);
+# endif
 #endif
 
 	notify_usb_online(usb_ctx, data);
