Browse Source

qcacmn: Move ADRASTEA_BU inside pci code

Prepare to make ADRASTEA_BU true only for emulation
builds.

Change-Id: Iaeea8d8b1431f5eb670adc43e6fd54d5446bbc0f
CRs-Fixed: 1049433
Houston Hoffman 8 years ago
parent
commit
c1064a8fd8
3 changed files with 13 additions and 7 deletions
  1. 0 6
      hif/src/hif_main.c
  2. 6 0
      hif/src/pcie/if_pci.c
  3. 7 1
      hif/src/snoc/if_snoc.c

+ 0 - 6
hif/src/hif_main.c

@@ -445,9 +445,6 @@ QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
 		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 @@ void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type)
 	else
 		hif_stop(hif_ctx);
 
-	if (ADRASTEA_BU)
-		hif_vote_link_down(hif_ctx);
-
 	hif_disable_bus(scn);
 
 	hif_wlan_disable(scn);

+ 6 - 0
hif/src/pcie/if_pci.c

@@ -2427,6 +2427,8 @@ void hif_pci_disable_bus(struct hif_softc *scn)
 
 	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 @@ again:
 	pci_set_drvdata(sc->pdev, sc);
 
 	hif_target_sync(ol_sc);
+
+	if (ADRASTEA_BU)
+		hif_vote_link_up(hif_hdl);
+
 	return 0;
 
 err_tgtstate:

+ 7 - 1
hif/src/snoc/if_snoc.c

@@ -265,6 +265,9 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
 	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 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
  */
 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);
 }