Skip to content

Commit 4250055

Browse files
krish2718nordicjm
authored andcommitted
[nrf fromlist] drivers: nrfwifi: Fix the undefined macro usage
This works because undefined macro in conditional is treated as zero, but could end up choosing the wrong divider. Fix the macro with the new name. Upstream PR #: 80780 Signed-off-by: Chaitanya Tata <[email protected]>
1 parent b1c242f commit 4250055

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ BUILD_ASSERT(QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16),
8585
* PCLK192M frequency"), but after that operation is complete, the default
8686
* divider needs to be restored to avoid increased current consumption.
8787
*/
88-
#if (INST_0_SCK_FREQUENCY >= NRF_QSPI_BASE_CLOCK_FREQ)
88+
#if (QSPI_IF_DEVICE_FREQUENCY >= NRF_QSPI_BASE_CLOCK_FREQ)
8989
/* For requested SCK >= 96 MHz, use HFCLK192M / 1 / (2*1) = 96 MHz */
9090
#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1
9191
#define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1
9292
/* If anomaly 159 is to be prevented, only /1 divider can be used. */
9393
#elif NRF53_ERRATA_159_ENABLE_WORKAROUND
9494
#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1
9595
#define INST_0_SCK_CFG (DIV_ROUND_UP(NRF_QSPI_BASE_CLOCK_FREQ, \
96-
INST_0_SCK_FREQUENCY) - 1)
97-
#elif (INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 2))
96+
QSPI_IF_DEVICE_FREQUENCY) - 1)
97+
#elif (QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 2))
9898
/* For 96 MHz > SCK >= 48 MHz, use HFCLK192M / 2 / (2*1) = 48 MHz */
9999
#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_2
100100
#define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1
101-
#elif (INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 3))
101+
#elif (QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 3))
102102
/* For 48 MHz > SCK >= 32 MHz, use HFCLK192M / 1 / (2*3) = 32 MHz */
103103
#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1
104104
#define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV3

0 commit comments

Comments
 (0)