Skip to content

Commit a8f858d

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: avs: Prefix SKL/APL-specific members
Prefix members that are platform-specific with 'avs_' to improve code cohesiveness and reduce the chance for naming-conflics with other drivers. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e1a0cba commit a8f858d

File tree

5 files changed

+56
-57
lines changed

5 files changed

+56
-57
lines changed

sound/soc/intel/avs/apl.c

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#include "topology.h"
1515

1616
static int __maybe_unused
17-
apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
18-
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
17+
avs_apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
18+
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
1919
{
20-
struct apl_log_state_info *info;
20+
struct avs_apl_log_state_info *info;
2121
u32 size, num_cores = adev->hw_cfg.dsp_cores;
2222
int ret, i;
2323

@@ -48,9 +48,9 @@ apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri
4848
return 0;
4949
}
5050

51-
static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
51+
static int avs_apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
5252
{
53-
struct apl_log_buffer_layout layout;
53+
struct avs_apl_log_buffer_layout layout;
5454
void __iomem *addr, *buf;
5555

5656
addr = avs_log_buffer_addr(adev, msg->log.core);
@@ -63,11 +63,11 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
6363
/* consume the logs regardless of consumer presence */
6464
goto update_read_ptr;
6565

66-
buf = apl_log_payload_addr(addr);
66+
buf = avs_apl_log_payload_addr(addr);
6767

6868
if (layout.read_ptr > layout.write_ptr) {
6969
avs_dump_fw_log(adev, buf + layout.read_ptr,
70-
apl_log_payload_size(adev) - layout.read_ptr);
70+
avs_apl_log_payload_size(adev) - layout.read_ptr);
7171
layout.read_ptr = 0;
7272
}
7373
avs_dump_fw_log_wakeup(adev, buf + layout.read_ptr, layout.write_ptr - layout.read_ptr);
@@ -77,7 +77,8 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
7777
return 0;
7878
}
7979

80-
static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buffer_layout *layout)
80+
static int avs_apl_wait_log_entry(struct avs_dev *adev, u32 core,
81+
struct avs_apl_log_buffer_layout *layout)
8182
{
8283
unsigned long timeout;
8384
void __iomem *addr;
@@ -99,11 +100,11 @@ static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buf
99100
}
100101

101102
/* reads log header and tests its type */
102-
#define apl_is_entry_stackdump(addr) ((readl(addr) >> 30) & 0x1)
103+
#define avs_apl_is_entry_stackdump(addr) ((readl(addr) >> 30) & 0x1)
103104

104-
static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
105+
static int avs_apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
105106
{
106-
struct apl_log_buffer_layout layout;
107+
struct avs_apl_log_buffer_layout layout;
107108
void __iomem *addr, *buf;
108109
size_t dump_size;
109110
u16 offset = 0;
@@ -124,9 +125,9 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
124125
if (!addr)
125126
goto exit;
126127

127-
buf = apl_log_payload_addr(addr);
128+
buf = avs_apl_log_payload_addr(addr);
128129
memcpy_fromio(&layout, addr, sizeof(layout));
129-
if (!apl_is_entry_stackdump(buf + layout.read_ptr)) {
130+
if (!avs_apl_is_entry_stackdump(buf + layout.read_ptr)) {
130131
union avs_notify_msg lbs_msg = AVS_NOTIFICATION(LOG_BUFFER_STATUS);
131132

132133
/*
@@ -142,11 +143,11 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
142143
do {
143144
u32 count;
144145

145-
if (apl_wait_log_entry(adev, msg->ext.coredump.core_id, &layout))
146+
if (avs_apl_wait_log_entry(adev, msg->ext.coredump.core_id, &layout))
146147
break;
147148

148149
if (layout.read_ptr > layout.write_ptr) {
149-
count = apl_log_payload_size(adev) - layout.read_ptr;
150+
count = avs_apl_log_payload_size(adev) - layout.read_ptr;
150151
memcpy_fromio(pos + offset, buf + layout.read_ptr, count);
151152
layout.read_ptr = 0;
152153
offset += count;
@@ -165,7 +166,7 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
165166
return 0;
166167
}
167168

168-
static bool apl_lp_streaming(struct avs_dev *adev)
169+
static bool avs_apl_lp_streaming(struct avs_dev *adev)
169170
{
170171
struct avs_path *path;
171172

@@ -201,7 +202,7 @@ static bool apl_lp_streaming(struct avs_dev *adev)
201202
return true;
202203
}
203204

204-
static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
205+
static bool avs_apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
205206
{
206207
/* wake in all cases */
207208
if (wake)
@@ -215,10 +216,10 @@ static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool w
215216
* Note: for cAVS 1.5+ and 1.8, D0IX is LP-firmware transition,
216217
* not the power-gating mechanism known from cAVS 2.0.
217218
*/
218-
return apl_lp_streaming(adev);
219+
return avs_apl_lp_streaming(adev);
219220
}
220221

221-
static int apl_set_d0ix(struct avs_dev *adev, bool enable)
222+
static int avs_apl_set_d0ix(struct avs_dev *adev, bool enable)
222223
{
223224
bool streaming = false;
224225
int ret;
@@ -231,7 +232,7 @@ static int apl_set_d0ix(struct avs_dev *adev, bool enable)
231232
return AVS_IPC_RET(ret);
232233
}
233234

234-
const struct avs_dsp_ops apl_dsp_ops = {
235+
const struct avs_dsp_ops avs_apl_dsp_ops = {
235236
.power = avs_dsp_core_power,
236237
.reset = avs_dsp_core_reset,
237238
.stall = avs_dsp_core_stall,
@@ -241,10 +242,10 @@ const struct avs_dsp_ops apl_dsp_ops = {
241242
.load_basefw = avs_hda_load_basefw,
242243
.load_lib = avs_hda_load_library,
243244
.transfer_mods = avs_hda_transfer_modules,
244-
.log_buffer_offset = skl_log_buffer_offset,
245-
.log_buffer_status = apl_log_buffer_status,
246-
.coredump = apl_coredump,
247-
.d0ix_toggle = apl_d0ix_toggle,
248-
.set_d0ix = apl_set_d0ix,
245+
.log_buffer_offset = avs_skl_log_buffer_offset,
246+
.log_buffer_status = avs_apl_log_buffer_status,
247+
.coredump = avs_apl_coredump,
248+
.d0ix_toggle = avs_apl_d0ix_toggle,
249+
.set_d0ix = avs_apl_set_d0ix,
249250
AVS_SET_ENABLE_LOGS_OP(apl)
250251
};

sound/soc/intel/avs/avs.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ struct avs_dsp_ops {
6464
#define avs_dsp_op(adev, op, ...) \
6565
((adev)->spec->dsp_ops->op(adev, ## __VA_ARGS__))
6666

67-
extern const struct avs_dsp_ops skl_dsp_ops;
68-
extern const struct avs_dsp_ops apl_dsp_ops;
67+
extern const struct avs_dsp_ops avs_skl_dsp_ops;
68+
extern const struct avs_dsp_ops avs_apl_dsp_ops;
6969

7070
#define AVS_PLATATTR_CLDMA BIT_ULL(0)
7171
#define AVS_PLATATTR_IMR BIT_ULL(1)
@@ -249,7 +249,7 @@ void avs_ipc_block(struct avs_ipc *ipc);
249249
int avs_dsp_disable_d0ix(struct avs_dev *adev);
250250
int avs_dsp_enable_d0ix(struct avs_dev *adev);
251251

252-
int skl_log_buffer_offset(struct avs_dev *adev, u32 core);
252+
int avs_skl_log_buffer_offset(struct avs_dev *adev, u32 core);
253253

254254
/* Firmware resources management */
255255

@@ -343,21 +343,21 @@ static inline int avs_log_buffer_status_locked(struct avs_dev *adev, union avs_n
343343
return ret;
344344
}
345345

346-
struct apl_log_buffer_layout {
346+
struct avs_apl_log_buffer_layout {
347347
u32 read_ptr;
348348
u32 write_ptr;
349349
u8 buffer[];
350350
} __packed;
351351

352-
#define apl_log_payload_size(adev) \
353-
(avs_log_buffer_size(adev) - sizeof(struct apl_log_buffer_layout))
352+
#define avs_apl_log_payload_size(adev) \
353+
(avs_log_buffer_size(adev) - sizeof(struct avs_apl_log_buffer_layout))
354354

355-
#define apl_log_payload_addr(addr) \
356-
(addr + sizeof(struct apl_log_buffer_layout))
355+
#define avs_apl_log_payload_addr(addr) \
356+
(addr + sizeof(struct avs_apl_log_buffer_layout))
357357

358358
#ifdef CONFIG_DEBUG_FS
359359
#define AVS_SET_ENABLE_LOGS_OP(name) \
360-
.enable_logs = name##_enable_logs
360+
.enable_logs = avs_##name##_enable_logs
361361

362362
bool avs_logging_fw(struct avs_dev *adev);
363363
void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len);

sound/soc/intel/avs/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ static const struct avs_spec skl_desc = {
738738
.hotfix = 0,
739739
.build = 4732,
740740
},
741-
.dsp_ops = &skl_dsp_ops,
741+
.dsp_ops = &avs_skl_dsp_ops,
742742
.core_init_mask = 1,
743743
.attributes = AVS_PLATATTR_CLDMA,
744744
.sram_base_offset = SKL_ADSP_SRAM_BASE_OFFSET,
@@ -754,7 +754,7 @@ static const struct avs_spec apl_desc = {
754754
.hotfix = 1,
755755
.build = 4323,
756756
},
757-
.dsp_ops = &apl_dsp_ops,
757+
.dsp_ops = &avs_apl_dsp_ops,
758758
.core_init_mask = 3,
759759
.attributes = AVS_PLATATTR_IMR,
760760
.sram_base_offset = APL_ADSP_SRAM_BASE_OFFSET,

sound/soc/intel/avs/messages.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,21 +359,21 @@ enum avs_skl_log_priority {
359359
AVS_SKL_LOG_VERBOSE,
360360
};
361361

362-
struct skl_log_state {
362+
struct avs_skl_log_state {
363363
u32 enable;
364364
u32 min_priority;
365365
} __packed;
366366

367-
struct skl_log_state_info {
367+
struct avs_skl_log_state_info {
368368
u32 core_mask;
369-
struct skl_log_state logs_core[];
369+
struct avs_skl_log_state logs_core[];
370370
} __packed;
371371

372-
struct apl_log_state_info {
372+
struct avs_apl_log_state_info {
373373
u32 aging_timer_period;
374374
u32 fifo_full_timer_period;
375375
u32 core_mask;
376-
struct skl_log_state logs_core[];
376+
struct avs_skl_log_state logs_core[];
377377
} __packed;
378378

379379
int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size);

sound/soc/intel/avs/skl.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#include "messages.h"
1414

1515
static int __maybe_unused
16-
skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
17-
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
16+
avs_skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
17+
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
1818
{
19-
struct skl_log_state_info *info;
19+
struct avs_skl_log_state_info *info;
2020
u32 size, num_cores = adev->hw_cfg.dsp_cores;
2121
int ret, i;
2222

@@ -45,16 +45,15 @@ skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri
4545
return 0;
4646
}
4747

48-
int skl_log_buffer_offset(struct avs_dev *adev, u32 core)
48+
int avs_skl_log_buffer_offset(struct avs_dev *adev, u32 core)
4949
{
5050
return core * avs_log_buffer_size(adev);
5151
}
5252

5353
/* fw DbgLogWp registers */
5454
#define FW_REGS_DBG_LOG_WP(core) (0x30 + 0x4 * core)
5555

56-
static int
57-
skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
56+
static int avs_skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
5857
{
5958
void __iomem *buf;
6059
u16 size, write, offset;
@@ -74,7 +73,7 @@ skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
7473
return 0;
7574
}
7675

77-
static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
76+
static int avs_skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
7877
{
7978
u8 *dump;
8079

@@ -88,20 +87,19 @@ static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
8887
return 0;
8988
}
9089

91-
static bool
92-
skl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
90+
static bool avs_skl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
9391
{
9492
/* unsupported on cAVS 1.5 hw */
9593
return false;
9694
}
9795

98-
static int skl_set_d0ix(struct avs_dev *adev, bool enable)
96+
static int avs_skl_set_d0ix(struct avs_dev *adev, bool enable)
9997
{
10098
/* unsupported on cAVS 1.5 hw */
10199
return 0;
102100
}
103101

104-
const struct avs_dsp_ops skl_dsp_ops = {
102+
const struct avs_dsp_ops avs_skl_dsp_ops = {
105103
.power = avs_dsp_core_power,
106104
.reset = avs_dsp_core_reset,
107105
.stall = avs_dsp_core_stall,
@@ -111,10 +109,10 @@ const struct avs_dsp_ops skl_dsp_ops = {
111109
.load_basefw = avs_cldma_load_basefw,
112110
.load_lib = avs_cldma_load_library,
113111
.transfer_mods = avs_cldma_transfer_modules,
114-
.log_buffer_offset = skl_log_buffer_offset,
115-
.log_buffer_status = skl_log_buffer_status,
116-
.coredump = skl_coredump,
117-
.d0ix_toggle = skl_d0ix_toggle,
118-
.set_d0ix = skl_set_d0ix,
112+
.log_buffer_offset = avs_skl_log_buffer_offset,
113+
.log_buffer_status = avs_skl_log_buffer_status,
114+
.coredump = avs_skl_coredump,
115+
.d0ix_toggle = avs_skl_d0ix_toggle,
116+
.set_d0ix = avs_skl_set_d0ix,
119117
AVS_SET_ENABLE_LOGS_OP(skl)
120118
};

0 commit comments

Comments
 (0)