Skip to content

Commit 5e03015

Browse files
Jyri Sarhakv2019i
authored andcommitted
probe: ipc4: Implement IPC4 get_config()
Implement IPC4 get_config() for getting currently active probe points, by using IPC4_PROBE_MODULE_PROBE_POINTS_ADD config_id. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 2be5e68 commit 5e03015

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

src/probe/probe.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,37 @@ static int probe_set_config(struct processing_module *mod, uint32_t param_id,
14911491
}
14921492
}
14931493

1494+
static int probe_get_config(struct processing_module *mod,
1495+
uint32_t config_id, uint32_t *data_offset_size,
1496+
uint8_t *fragment, size_t fragment_size)
1497+
{
1498+
struct sof_ipc_probe_info_params *info =
1499+
(struct sof_ipc_probe_info_params *)ASSUME_ALIGNED(fragment, 8);
1500+
struct probe_pdata *_probe = probe_get();
1501+
struct comp_dev *dev = mod->dev;
1502+
int i, j;
1503+
1504+
comp_dbg(dev, "config_id %u", config_id);
1505+
switch (config_id) {
1506+
case IPC4_PROBE_MODULE_PROBE_POINTS_ADD:
1507+
for (i = 0, j = 0; i < ARRAY_SIZE(_probe->probe_points); i++) {
1508+
if (_probe->probe_points[i].stream_tag == PROBE_POINT_INVALID)
1509+
continue;
1510+
if (offsetof(struct sof_ipc_probe_info_params, probe_point[j]) +
1511+
sizeof(info->probe_point[0]) > fragment_size)
1512+
break;
1513+
info->probe_point[j++] = _probe->probe_points[i];
1514+
}
1515+
info->num_elems = j;
1516+
comp_info(dev, "%u probe points sent", j);
1517+
break;
1518+
default:
1519+
comp_err(dev, "unknown config_id %u", config_id);
1520+
return -EINVAL;
1521+
}
1522+
return 0;
1523+
}
1524+
14941525
static int probe_dummy_process(struct processing_module *mod,
14951526
struct input_stream_buffer *input_buffers, int num_input_buffers,
14961527
struct output_stream_buffer *output_buffers, int num_output_buffers)
@@ -1506,6 +1537,7 @@ static const struct module_interface probe_interface = {
15061537
.init = probe_mod_init,
15071538
.process_audio_stream = probe_dummy_process,
15081539
.set_configuration = probe_set_config,
1540+
.get_configuration = probe_get_config,
15091541
.free = probe_free,
15101542
};
15111543

0 commit comments

Comments
 (0)