Skip to content

Commit 4589ed1

Browse files
muraliThokalakrish2718
authored andcommitted
drivers: wifi: Swctrl1 configuration for coex
Support to configure swctrl1 as input or output for coexistence. Signed-off-by: Murali Thokala <[email protected]> (cherry picked from commit 03c5f5f)
1 parent 15c0ced commit 4589ed1

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

drivers/wifi/nrf_wifi/Kconfig.nrfwifi

+12
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ config NRF70_SR_COEX_RF_SWITCH
182182
If this GPIO is asserted (1), the SR side RF switch is connected to the Wi-Fi side (shared antenna).
183183
If this GPIO is de-asserted (0), the SR side RF switch is connected to the SR side (separate antenna).
184184

185+
config NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL
186+
bool "Configuration of GPIO control for coexistence"
187+
default y
188+
189+
config NRF70_SR_COEX_SWCTRL1_OUTPUT
190+
int "Configure SWCTRIL1 as output"
191+
default 0
192+
193+
config NRF70_SR_COEX_BT_GRANT_ACTIVE_LOW
194+
int "Configure BT grant active low"
195+
default 1
196+
185197
config NRF70_WORKQ_STACK_SIZE
186198
int "Stack size for workqueue"
187199
default 4096

drivers/wifi/nrf_wifi/src/coex.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const uint16_t config_buffer_5G[] = {
103103
/* Shared antenna */
104104
const uint32_t ch_config_sha[] = {
105105
0x00000028, 0x00000000, 0x001e1023, 0x00000000, 0x00000000,
106-
0x00000000, 0x00000021, 0x000002ca, 0x00000050, 0x00000000,
106+
0x00000000, 0x00000021, 0x000002ca, 0x0000005A, 0x00000000,
107107
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
108108
0x00000000
109109
};

drivers/wifi/nrf_wifi/src/fmac_main.c

+19
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
581581

582582
unsigned int fw_ver = 0;
583583

584+
#if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \
585+
defined(CONFIG_NRF70_SYSTEM_MODE)
586+
unsigned int alt_swctrl1_function_bt_coex_status1 =
587+
(~CONFIG_NRF70_SR_COEX_SWCTRL1_OUTPUT) & 0x1;
588+
unsigned int invert_bt_coex_grant_output = CONFIG_NRF70_SR_COEX_BT_GRANT_ACTIVE_LOW;
589+
#endif /* CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL && CONFIG_NRF70_SYSTEM_MODE */
590+
584591
rpu_ctx_zep = &drv_priv_zep->rpu_ctx_zep;
585592

586593
rpu_ctx_zep->drv_priv_zep = drv_priv_zep;
@@ -624,6 +631,18 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
624631

625632
configure_board_dep_params(&board_params);
626633

634+
#if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \
635+
defined(CONFIG_NRF70_SYSTEM_MODE)
636+
LOG_INF("Configuring SLEEP CTRL GPIO control register\n");
637+
status = nrf_wifi_coex_config_sleep_ctrl_gpio_ctrl(rpu_ctx_zep->rpu_ctx,
638+
alt_swctrl1_function_bt_coex_status1,
639+
invert_bt_coex_grant_output);
640+
if (status != NRF_WIFI_STATUS_SUCCESS) {
641+
LOG_ERR("%s: Failed to configure GPIO control register", __func__);
642+
goto err;
643+
}
644+
#endif /* CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL && CONFIG_NRF70_SYSTEM_MODE */
645+
627646
#ifdef CONFIG_NRF70_RADIO_TEST
628647
status = nrf_wifi_rt_fmac_dev_init(rpu_ctx_zep->rpu_ctx,
629648
#ifdef CONFIG_NRF_WIFI_LOW_POWER

0 commit comments

Comments
 (0)