diff --git a/Kbuild b/Kbuild index 39a7b1c5c1c6..9e8e691baaaa 100644 --- a/Kbuild +++ b/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) diff --git a/core/pld/src/pld_sdio.c b/core/pld/src/pld_sdio.c index 3a2706d0ee02..5d527771b905 100644 --- a/core/pld/src/pld_sdio.c +++ b/core/pld/src/pld_sdio.c @@ -25,6 +25,9 @@ #ifdef CONFIG_PLD_SDIO_CNSS #include #endif +#ifdef CONFIG_PLD_SDIO_CNSS2 +#include +#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, diff --git a/core/pld/src/pld_sdio.h b/core/pld/src/pld_sdio.h index 354eec1a795e..c25dedf122d0 100644 --- a/core/pld/src/pld_sdio.h +++ b/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 + +/** + * 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