qcacmn: Move ADRASTEA_BU inside pci code

Prepare to make ADRASTEA_BU true only for emulation
builds.

Change-Id: Iaeea8d8b1431f5eb670adc43e6fd54d5446bbc0f
CRs-Fixed: 1049433
diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c
index 9b8dc12..1519343 100644
--- a/hif/src/hif_main.c
+++ b/hif/src/hif_main.c
@@ -445,9 +445,6 @@
 		return status;
 	}
 
-	if (ADRASTEA_BU)
-		hif_vote_link_up(hif_ctx);
-
 	if (hif_bus_configure(scn)) {
 		HIF_ERROR("%s: Target probe failed.", __func__);
 		hif_disable_bus(scn);
@@ -483,9 +480,6 @@
 	else
 		hif_stop(hif_ctx);
 
-	if (ADRASTEA_BU)
-		hif_vote_link_down(hif_ctx);
-
 	hif_disable_bus(scn);
 
 	hif_wlan_disable(scn);
diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c
index 1b124fd..6c9618b 100644
--- a/hif/src/pcie/if_pci.c
+++ b/hif/src/pcie/if_pci.c
@@ -2427,6 +2427,8 @@
 
 	pdev = sc->pdev;
 	if (ADRASTEA_BU) {
+		hif_vote_link_down(GET_HIF_OPAQUE_HDL(scn));
+
 		hif_write32_mb(sc->mem + PCIE_INTR_ENABLE_ADDRESS, 0);
 		hif_write32_mb(sc->mem + PCIE_INTR_CLR_ADDRESS,
 			       HOST_GROUP0_MASK);
@@ -3465,6 +3467,10 @@
 	pci_set_drvdata(sc->pdev, sc);
 
 	hif_target_sync(ol_sc);
+
+	if (ADRASTEA_BU)
+		hif_vote_link_up(hif_hdl);
+
 	return 0;
 
 err_tgtstate:
diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c
index 201eb7c..74acfbe 100644
--- a/hif/src/snoc/if_snoc.c
+++ b/hif/src/snoc/if_snoc.c
@@ -265,6 +265,9 @@
 	hif_register_tbl_attach(ol_sc, hif_type);
 	hif_target_register_tbl_attach(ol_sc, target_type);
 
+	/* the bus should remain on durring suspend for snoc */
+	hif_vote_link_up(GET_HIF_OPAQUE_HDL(ol_sc));
+
 	HIF_TRACE("%s: X - hif_type = 0x%x, target_type = 0x%x",
 		  __func__, hif_type, target_type);
 
@@ -282,8 +285,11 @@
  */
 void hif_snoc_disable_bus(struct hif_softc *scn)
 {
-	int ret = qdf_device_init_wakeup(scn->qdf_dev, false);
+	int ret;
 
+	hif_vote_link_down(GET_HIF_OPAQUE_HDL(scn));
+
+	ret = qdf_device_init_wakeup(scn->qdf_dev, false);
 	if (ret)
 		HIF_ERROR("%s: device_init_wakeup: err %d", __func__, ret);
 }