Skip to content

Commit 71b592e

Browse files
lrgirdwoclaude
andcommitted
notifier: remove the clock change notification
Nothing sends NOTIFIER_ID_CPU_FREQ or NOTIFIER_ID_SSP_FREQ, and nothing registers for them any more. Remove the event IDs, NOTIFIER_CLK_CHANGE_ID(), and the notification payload struct clock_notify_data with its CLOCK_NOTIFY_PRE and CLOCK_NOTIFY_POST messages. The notifier checked and walked the IDs from NOTIFIER_ID_CPU_FREQ, which was 0. It now starts from 0. The other IDs are renumbered; they are internal to the firmware. This is part of removing the notifier, which is not usable from user space (Phase 5 of the kernel / user-space partition). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 0baf0eb commit 71b592e

4 files changed

Lines changed: 4 additions & 35 deletions

File tree

‎posix/include/rtos/clk.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@
1717

1818
struct timer;
1919

20-
#define CLOCK_NOTIFY_PRE 0
21-
#define CLOCK_NOTIFY_POST 1
22-
23-
struct clock_notify_data {
24-
uint32_t old_freq;
25-
uint32_t old_ticks_per_msec;
26-
uint32_t freq;
27-
uint32_t ticks_per_msec;
28-
uint32_t message;
29-
};
30-
3120
struct freq_table {
3221
uint32_t freq;
3322
uint32_t ticks_per_msec;

‎src/include/sof/lib/notifier.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#define NOTIFIER_TARGET_CORE_ALL_MASK 0xFFFFFFFF
2121

2222
enum notify_id {
23-
NOTIFIER_ID_CPU_FREQ = 0, /* struct clock_notify_data * */
24-
NOTIFIER_ID_SSP_FREQ, /* struct clock_notify_data * */
2523
NOTIFIER_ID_KPB_CLIENT_EVT, /* struct kpb_event_data * */
2624
NOTIFIER_ID_DMA_DOMAIN_CHANGE, /* struct dma_chan_data * */
2725
NOTIFIER_ID_DMA_COPY, /* struct dma_cb_data* */
@@ -44,13 +42,6 @@ struct notify_data {
4442
void *data;
4543
};
4644

47-
#ifdef CLK_SSP
48-
#define NOTIFIER_CLK_CHANGE_ID(clk) \
49-
((clk) == CLK_SSP ? NOTIFIER_ID_SSP_FREQ : NOTIFIER_ID_CPU_FREQ)
50-
#else
51-
#define NOTIFIER_CLK_CHANGE_ID(clk) NOTIFIER_ID_CPU_FREQ
52-
#endif
53-
5445
struct notify **arch_notify_get(void);
5546

5647
typedef void (*notifier_callback_t)(void *receiver_data, enum notify_id event_type,

‎src/lib/notifier.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int notifier_register(void *receiver, void *caller, enum notify_id type,
4444
k_spinlock_key_t key;
4545
int ret = 0;
4646

47-
assert(type >= NOTIFIER_ID_CPU_FREQ && type < NOTIFIER_ID_COUNT);
47+
assert((unsigned int)type < NOTIFIER_ID_COUNT);
4848

4949
key = k_spin_lock(&notify->lock);
5050

@@ -77,7 +77,7 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type)
7777
struct callback_handle *handle;
7878
k_spinlock_key_t key;
7979

80-
assert(type >= NOTIFIER_ID_CPU_FREQ && type < NOTIFIER_ID_COUNT);
80+
assert((unsigned int)type < NOTIFIER_ID_COUNT);
8181

8282
key = k_spin_lock(&notify->lock);
8383

@@ -110,7 +110,7 @@ void notifier_unregister_all(void *receiver, void *caller)
110110
{
111111
int i;
112112

113-
for (i = NOTIFIER_ID_CPU_FREQ; i < NOTIFIER_ID_COUNT; i++)
113+
for (i = 0; i < NOTIFIER_ID_COUNT; i++)
114114
notifier_unregister(receiver, caller, i);
115115
}
116116

@@ -193,7 +193,7 @@ __cold void init_system_notify(struct sof *sof)
193193
}
194194

195195
k_spinlock_init(&(*notify)->lock);
196-
for (i = NOTIFIER_ID_CPU_FREQ; i < NOTIFIER_ID_COUNT; i++)
196+
for (i = 0; i < NOTIFIER_ID_COUNT; i++)
197197
list_init(&(*notify)->list[i]);
198198

199199
if (cpu_get_id() == PLATFORM_PRIMARY_CORE_ID)

‎zephyr/include/rtos/clk.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@
2727

2828
struct timer;
2929

30-
#define CLOCK_NOTIFY_PRE 0
31-
#define CLOCK_NOTIFY_POST 1
32-
33-
struct clock_notify_data {
34-
uint32_t old_freq;
35-
uint32_t old_ticks_per_msec;
36-
uint32_t freq;
37-
uint32_t ticks_per_msec;
38-
uint32_t message;
39-
};
40-
4130
struct freq_table {
4231
uint32_t freq;
4332
uint32_t ticks_per_msec;

0 commit comments

Comments
 (0)