Skip to content

Commit 81bcfe5

Browse files
committed
ipc4: more cleanup
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent ad56b69 commit 81bcfe5

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

src/audio/copier.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ DECLARE_SOF_RT_UUID("copier", copier_comp_uuid, 0x9ba00c83, 0xca12, 0x4a83,
4141

4242
DECLARE_TR_CTX(copier_comp_tr, SOF_UUID(copier_comp_uuid), LOG_LEVEL_INFO);
4343

44+
struct copier_data {
45+
struct comp_dev *host;
46+
struct comp_dev *dai;
47+
struct comp_buffer *buf;
48+
int direction;
49+
pcm_converter_func converter;
50+
51+
struct ipc4_copier_module_cfg config;
52+
};
53+
4454
static enum sof_ipc_frame convert_fmt(int format)
4555
{
4656
enum sof_ipc_frame in;

src/include/ipc4/copier.h

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ union ipc4_cfg_param_id_data {
266266
*/
267267

268268
//! Total number of output pins. TODO: this should be a macro
269-
static const size_t COPIER_MODULE_OUTPUT_PINS_COUNT = 4;
269+
#define IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT 4
270270

271271
enum ipc4_copier_features {
272272
/*!
@@ -318,40 +318,29 @@ struct ipc4_copier_module_cfg {
318318
struct ipc4_copier_gateway_cfg gtw_cfg;
319319
} __attribute__((packed, aligned(4)));
320320

321-
//TODO: is this IPC or state data ???
322-
struct copier_data {
323-
struct comp_dev *host;
324-
struct comp_dev *dai;
325-
struct comp_buffer *buf;
326-
int direction;
327-
pcm_converter_func converter;
328-
329-
struct ipc4_copier_module_cfg config;
330-
};
331-
332321
enum ipc4_copier_module_config_params {
333322
/*!
334323
Use LARGE_CONFIG_SET to initialize timestamp event. Ipc mailbox must
335324
contain properly built CopierConfigTimestampInitData struct.
336325
*/
337-
COPIER_MODULE_CFG_PARAM_TIMESTAMP_INIT = 1,
326+
IPC4_COPIER_MODULE_CFG_PARAM_TIMESTAMP_INIT = 1,
338327
/*!
339328
Use LARGE_CONFIG_SET to initialize copier sink. Ipc mailbox must contain
340329
properly built CopierConfigSetSinkFormat struct.
341330
*/
342-
COPIER_MODULE_CFG_PARAM_SET_SINK_FORMAT = 2,
331+
IPC4_COPIER_MODULE_CFG_PARAM_SET_SINK_FORMAT = 2,
343332
/*!
344333
Use LARGE_CONFIG_SET to initialize and enable on Copier data segment
345334
event. Ipc mailbox must contain properly built DataSegmentEnabled struct.
346335
*/
347-
COPIER_MODULE_CFG_PARAM_DATA_SEGMENT_ENABLED = 3,
336+
IPC4_COPIER_MODULE_CFG_PARAM_DATA_SEGMENT_ENABLED = 3,
348337
/*!
349338
Use LARGE_CONFIG_GET to retrieve Linear Link Position (LLP) value for non
350339
HD-A gateways.
351340
352341
\see LlpReading
353342
*/
354-
COPIER_MODULE_CFG_PARAM_LLP_READING = 4,
343+
IPC4_COPIER_MODULE_CFG_PARAM_LLP_READING = 4,
355344
/*!
356345
Use LARGE_CONFIG_GET to retrieve Linear Link Position (LLP) value for non
357346
HD-A gateways and corresponding total processed data
@@ -371,15 +360,15 @@ enum ipc4_copier_module_config_params {
371360
372361
\endcode
373362
*/
374-
COPIER_MODULE_CFG_PARAM_LLP_READING_EXTENDED = 5,
363+
IPC4_COPIER_MODULE_CFG_PARAM_LLP_READING_EXTENDED = 5,
375364
/*!
376365
Use LARGE_CONFIG_SET to setup attenuation on output pins. Data is just
377366
uint32_t.
378367
379368
\note Config is only allowed when output pin is set up for 32bit and
380369
source is connected to Gateway
381370
*/
382-
COPIER_MODULE_CFG_ATTENUATION = 6
371+
IPC4_COPIER_MODULE_CFG_ATTENUATION = 6
383372
};
384373

385374
struct ipc4_copier_config_timestamp_init_data {
@@ -391,8 +380,7 @@ struct ipc4_copier_config_timestamp_init_data {
391380
uint32_t tsctrl_reg;
392381
} __attribute__((packed, aligned(4)));
393382

394-
struct CopierConfigSetSinkFormat
395-
{
383+
struct ipc4_copier_config_set_sink_format {
396384
//! Id of sink
397385
uint32_t sink_id;
398386
//! Input format used by the source
@@ -404,12 +392,11 @@ struct CopierConfigSetSinkFormat
404392
struct ipc4_audio_format sink_fmt;
405393
} __attribute__((packed, aligned(4)));
406394

407-
static const uint32_t COPIER_DATA_SEGMENT_DISABLE = (0 << 0);
408-
static const uint32_t COPIER_DATA_SEGMENT_ENABLE = (1 << 0);
409-
static const uint32_t COPIER_DATA_SEGMENT_RESTART = (1 << 1);
395+
#define IPC4_COPIER_DATA_SEGMENT_DISABLE (0 << 0)
396+
#define IPC4_COPIER_DATA_SEGMENT_ENABLE (1 << 0)
397+
#define IPC4_COPIER_DATA_SEGMENT_RESTART (1 << 1)
410398

411-
struct DataSegmentEnabled
412-
{
399+
struct ipc4_data_segment_enabled {
413400
//! Gateway node id
414401
uint32_t node_id;
415402
//! Indicates whether notification should be enabled (!=0) or disabled (=0).

0 commit comments

Comments
 (0)