Browse Source

qcacld-3.0: Add sdio abstraction layer support for QCN7605

The SDIO HIF for QCN7605 requires to use the SDIO Abstraction Layer.
Used the SDIO CNSS2 PLD layer api's to interface with SDIO AL

Change-Id: I839a580941e4651e3dcff4f87cda26cc567687fc
CRs-Fixed: 2275631
Sriram Madhvapathi 6 years ago
parent
commit
ecb0bcde59
3 changed files with 103 additions and 1 deletions
  1. 1 0
      Kbuild
  2. 48 1
      core/pld/src/pld_sdio.c
  3. 54 0
      core/pld/src/pld_sdio.h

+ 1 - 0
Kbuild

@@ -2055,6 +2055,7 @@ cppflags-$(CONFIG_PLD_PCIE_INIT_FLAG) += -DCONFIG_PLD_PCIE_INIT
 cppflags-$(CONFIG_WLAN_FEATURE_DP_RX_THREADS) += -DFEATURE_WLAN_DP_RX_THREADS
 cppflags-$(CONFIG_WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT) += -DWLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
 cppflags-$(CONFIG_PLD_USB_CNSS) += -DCONFIG_PLD_USB_CNSS
+cppflags-$(CONFIG_PLD_SDIO_CNSS2) += -DCONFIG_PLD_SDIO_CNSS2
 
 #For both legacy and lithium chip's monitor mode config
 ifeq ($(CONFIG_FEATURE_MONITOR_MODE_SUPPORT), y)

+ 48 - 1
core/pld/src/pld_sdio.c

@@ -25,6 +25,9 @@
 #ifdef CONFIG_PLD_SDIO_CNSS
 #include <net/cnss.h>
 #endif
+#ifdef CONFIG_PLD_SDIO_CNSS2
+#include <net/cnss2.h>
+#endif
 
 #include "pld_common.h"
 #include "pld_internal.h"
@@ -273,7 +276,51 @@ static struct sdio_device_id pld_sdio_id_table[] = {
 	{},
 };
 
-#ifdef CONFIG_PLD_SDIO_CNSS
+#ifdef CONFIG_PLD_SDIO_CNSS2
+/**
+ * pld_sdio_reinit() - SSR re-initialize function for SDIO device
+ * @sdio_func: pointer to sdio device function
+ * @id: SDIO device ID
+ *
+ * During subsystem restart(SSR), this function will be called to
+ * re-initialize SDIO device.
+ *
+ * Return: int
+ */
+static int pld_sdio_reinit(struct sdio_func *sdio_func,
+			   const struct sdio_device_id *id)
+{
+	/* TODO */
+	return -ENODEV;
+}
+
+/**
+ * pld_sdio_shutdown() - SSR shutdown function for SDIO device
+ * @sdio_func: pointer to sdio device function
+ *
+ * During SSR, this function will be called to shutdown SDIO device.
+ *
+ * Return: void
+ */
+static void pld_sdio_shutdown(struct sdio_func *sdio_func)
+{
+	/* TODO */
+}
+
+/**
+ * pld_sdio_crash_shutdown() - Crash shutdown function for SDIO device
+ * @sdio_func: pointer to sdio device function
+ *
+ * This function will be called when a crash is detected, it will shutdown
+ * the SDIO device.
+ *
+ * Return: void
+ */
+static void pld_sdio_crash_shutdown(struct sdio_func *sdio_func)
+{
+	/* TODO */
+}
+
 struct cnss_sdio_wlan_driver pld_sdio_ops = {
 	.name       = "pld_sdio",
 	.id_table   = pld_sdio_id_table,

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

@@ -192,6 +192,60 @@ static inline void pld_hif_sdio_release_ramdump_mem(unsigned long *address)
 {
 }
 #else
+#ifdef CONFIG_PLD_SDIO_CNSS2
+#include <net/cnss2.h>
+
+/**
+ * pld_sdio_get_sdio_al_client_handle() - Get the sdio al client handle
+ * @func: SDIO function pointer
+ *
+ * Return: On success return client handle from al via cnss, else NULL
+ */
+static inline struct sdio_al_client_handle *pld_sdio_get_sdio_al_client_handle
+(
+struct sdio_func *func
+)
+{
+	if (!func)
+		return NULL;
+
+	return cnss_sdio_wlan_get_sdio_al_client_handle(func);
+}
+
+/**
+ * pld_sdio_register_sdio_al_channel() - Register channel with sdio al
+ * @al_client: SDIO al client handle
+ * @ch_data: SDIO client channel data
+ *
+ * Return: Channel handle on success, else null
+ */
+static inline struct sdio_al_channel_handle *pld_sdio_register_sdio_al_channel
+(
+struct sdio_al_client_handle *al_client,
+struct sdio_al_channel_data *ch_data
+)
+{
+	if (!al_client || !ch_data)
+		return NULL;
+
+	return cnss_sdio_wlan_register_sdio_al_channel(ch_data);
+}
+
+/**
+ * pld_sdio_unregister_sdio_al_channel() - Unregister the sdio al channel
+ * @ch_handle: SDIO al channel handle
+ *
+ * Return: None
+ */
+static inline void pld_sdio_unregister_sdio_al_channel
+(
+struct sdio_al_channel_handle *ch_handle
+)
+{
+	cnss_sdio_wlan_unregister_sdio_al_channel(ch_handle);
+}
+#endif /* CONFIG_PLD_SDIO_CNSS2 */
+
 /**
  * pld_hif_sdio_get_virt_ramdump_mem() - Get virtual ramdump memory
  * @dev: device