Skip to content

Commit 03c5f5f

Browse files
muraliThokalakartben
authored andcommitted
drivers: wifi: Swctrl1 configuration for coex
Support to configure swctrl1 as input or output for coexistence. Signed-off-by: Murali Thokala <Murali.Thokala@nordicsemi.no>
1 parent a934af8 commit 03c5f5f

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

drivers/wifi/nrf_wifi/Kconfig.nrfwifi

Lines changed: 12 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,13 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
582582

583583
unsigned int fw_ver = 0;
584584

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

587594
rpu_ctx_zep->drv_priv_zep = drv_priv_zep;
@@ -625,6 +632,18 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
625632

626633
configure_board_dep_params(&board_params);
627634

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

0 commit comments

Comments
 (0)