Skip to content

Commit a39caf0

Browse files
ppryga-nordicrlubos
authored andcommitted
mpsl: pm: Fix wrong macro to enable integration with MRAM lat service
There was wrong macro used to wrap the core responsible for integration with MRAM latency service for nRF54h20 SoC. The macro shoudl be a Kconfig option so that the feature is enabled with MPSL PM is enabled. The commit fixes the code. Signed-off-by: Piotr Pryga <[email protected]>
1 parent 420b406 commit a39caf0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

subsys/mpsl/pm/mpsl_pm_utils.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <zephyr/pm/policy.h>
1111
#include <zephyr/logging/log.h>
1212

13-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
13+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
1414
#include <mram_latency.h>
15-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE */
15+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE */
1616

1717
#include <mpsl/mpsl_pm_utils.h>
1818

@@ -32,7 +32,7 @@ static uint32_t m_prev_lat_value_us;
3232
static struct pm_policy_latency_request m_latency_req;
3333
static struct pm_policy_event m_evt;
3434

35-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
35+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
3636
#define LOW_LATENCY_ATOMIC_BITS_NUM 2
3737
#define LOW_LATENCY_PM_BIT 0
3838
#define LOW_LATENCY_MRAM_BIT 0
@@ -44,7 +44,7 @@ struct onoff_client m_mram_req_cli;
4444

4545
static void m_mram_low_latency_request(void);
4646
static void m_mram_low_latency_release(void);
47-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE */
47+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE */
4848

4949
static void m_update_latency_request(uint32_t lat_value_us)
5050
{
@@ -103,13 +103,13 @@ static void m_register_latency(void)
103103
if (mpsl_pm_low_latency_requested()) {
104104
mpsl_pm_low_latency_state_set(MPSL_PM_LOW_LATENCY_STATE_REQUESTING);
105105

106-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
106+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
107107
/* Request MRAM latency first because the call goes to system controller */
108108
m_mram_low_latency_request();
109-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE */
109+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE */
110110

111111
m_update_latency_request(0);
112-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
112+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
113113
atomic_set_bit(m_low_latency_req_state, LOW_LATENCY_PM_BIT);
114114

115115
/* Attempt to notify MPLS about change. Most likely it will happen later
@@ -118,7 +118,7 @@ static void m_register_latency(void)
118118
if (atomic_test_bit(m_low_latency_req_state, LOW_LATENCY_MRAM_BIT)) {
119119
#else
120120
if (true) {
121-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE*/
121+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE*/
122122
mpsl_pm_low_latency_state_set(MPSL_PM_LOW_LATENCY_STATE_ON);
123123
}
124124
}
@@ -127,13 +127,13 @@ static void m_register_latency(void)
127127
if (!mpsl_pm_low_latency_requested()) {
128128
mpsl_pm_low_latency_state_set(MPSL_PM_LOW_LATENCY_STATE_RELEASING);
129129

130-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
130+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
131131
m_mram_low_latency_release();
132-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE */
132+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE */
133133
m_update_latency_request(PM_MAX_LATENCY_HCI_COMMANDS_US);
134-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
134+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
135135
atomic_clear_bit(m_low_latency_req_state, LOW_LATENCY_PM_BIT);
136-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE*/
136+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE*/
137137

138138
/* MRAM low release is handled sunchronously, hence the MPLS notification
139139
* happens here.
@@ -146,7 +146,7 @@ static void m_register_latency(void)
146146
}
147147
}
148148

149-
#if defined(MPSL_PM_USE_MRAM_LATENCY_SERVICE)
149+
#if defined(CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE)
150150
static void m_mram_request_cb(struct onoff_manager *mgr, struct onoff_client *cli, uint32_t state,
151151
int res)
152152
{
@@ -199,7 +199,7 @@ static void m_mram_low_latency_release(void)
199199
*/
200200
atomic_clear_bit(m_low_latency_req_state, LOW_LATENCY_MRAM_BIT);
201201
}
202-
#endif /* MPSL_PM_USE_MRAM_LATENCY_SERVICE */
202+
#endif /* CONFIG_MPSL_PM_USE_MRAM_LATENCY_SERVICE */
203203

204204
void mpsl_pm_utils_work_handler(void)
205205
{

0 commit comments

Comments
 (0)