Răsfoiți Sursa

qcacld-3.0: Add sdio support for pld_wlan_enable

Add sdio support for pld_wlan_enable to put
the FW in the required mode.

Change-Id: I4ff3648a70b6c9cd4be389562851444258b347e6
CRs-Fixed: 2504554
Jayachandran Sreekumaran 6 ani în urmă
părinte
comite
32a0d43f05
3 a modificat fișierele cu 46 adăugiri și 0 ștergeri
  1. 1 0
      core/pld/src/pld_common.c
  2. 34 0
      core/pld/src/pld_sdio.c
  3. 11 0
      core/pld/src/pld_sdio.h

+ 1 - 0
core/pld/src/pld_common.c

@@ -371,6 +371,7 @@ int pld_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
 		ret = pld_snoc_wlan_enable(dev, config, mode, QWLAN_VERSIONSTR);
 		break;
 	case PLD_BUS_TYPE_SDIO:
+		ret = pld_sdio_wlan_enable(dev, config, mode, QWLAN_VERSIONSTR);
 		break;
 	case PLD_BUS_TYPE_USB:
 		ifdev = pld_get_if_dev(dev);

+ 34 - 0
core/pld/src/pld_sdio.c

@@ -354,6 +354,40 @@ void pld_sdio_unregister_driver(void)
 {
 	cnss_sdio_wlan_unregister_driver(&pld_sdio_ops);
 }
+
+/**
+ * pld_sdio_wlan_enable() - Enable WLAN
+ * @dev: device
+ * @config: NA
+ * @mode: WLAN mode
+ * @host_version: host software version
+ *
+ * This function enables WLAN FW. It passed
+ * WLAN mode and host software version to FW.
+ *
+ * Return: 0 for success
+ *         Non zero failure code for errors
+ */
+int pld_sdio_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
+			 enum pld_driver_mode mode, const char *host_version)
+{
+	struct cnss_wlan_enable_cfg cfg;
+	enum cnss_driver_mode cnss_mode;
+
+	switch (mode) {
+	case PLD_FTM:
+		cnss_mode = CNSS_FTM;
+		break;
+	case PLD_EPPING:
+		cnss_mode = CNSS_EPPING;
+		break;
+	default:
+		cnss_mode = CNSS_MISSION;
+		break;
+	}
+	return cnss_wlan_enable(dev, &cfg, cnss_mode, host_version);
+}
+
 #else
 
 #ifdef CONFIG_PM

+ 11 - 0
core/pld/src/pld_sdio.h

@@ -244,6 +244,17 @@ struct sdio_al_channel_handle *ch_handle
 {
 	cnss_sdio_wlan_unregister_sdio_al_channel(ch_handle);
 }
+
+int pld_sdio_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
+			 enum pld_driver_mode mode, const char *host_version);
+#else
+static inline int pld_sdio_wlan_enable(struct device *dev,
+				       struct pld_wlan_enable_cfg *config,
+				       enum pld_driver_mode mode,
+				       const char *host_version)
+{
+	return 0;
+}
 #endif /* CONFIG_PLD_SDIO_CNSS2 */
 
 /**