Skip to content

Commit 3081ff2

Browse files
Add UAOL to ALH stream conversion
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
1 parent 2e52762 commit 3081ff2

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

src/audio/base_fw_intel.c

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,22 @@ static void tlv_value_set_uaol_caps(struct sof_tlv *tuple, uint32_t type)
129129

130130
tlv_value_set(tuple, type, caps_size, caps);
131131
}
132+
133+
static int uaol_stream_id_to_hda_link_stream_id(int uaol_stream_id)
134+
{
135+
size_t dev_count = ARRAY_SIZE(uaol_devs);
136+
size_t i;
137+
138+
for (i = 0; i < dev_count; i++) {
139+
int hda_link_stream_id = uaol_get_mapped_hda_link_stream_id(uaol_devs[i],
140+
uaol_stream_id);
141+
if (hda_link_stream_id >= 0)
142+
return hda_link_stream_id;
143+
}
144+
145+
return -1;
146+
}
147+
132148
#endif
133149

134150
__cold int basefw_vendor_hw_config(uint32_t *data_offset, char *data)
@@ -479,6 +495,7 @@ __cold int basefw_vendor_set_large_config(struct comp_dev *dev, uint32_t param_i
479495
__cold int basefw_vendor_dma_control(uint32_t node_id, const char *config_data, size_t data_size)
480496
{
481497
union ipc4_connector_node_id node = (union ipc4_connector_node_id)node_id;
498+
int dai_index = node.f.v_index;
482499
int ret, result;
483500
enum dai_type type;
484501

@@ -505,12 +522,27 @@ __cold int basefw_vendor_dma_control(uint32_t node_id, const char *config_data,
505522
case ipc4_alh_uaol_stream_link_output_class:
506523
case ipc4_alh_uaol_stream_link_input_class:
507524
type = SOF_DAI_INTEL_UAOL;
525+
526+
/*
527+
///FIXME: UAOL to ALH stream id mapping !!!
528+
int uaol_to_alh[] = { 13, 14, 15, 16, 29, 30 };
529+
if (node.f.v_index >= 0 && node.f.v_index <= 5)
530+
node.f.v_index = uaol_to_alh[node.f.v_index];
531+
*/
532+
533+
dai_index = uaol_stream_id_to_hda_link_stream_id(node.f.v_index);
534+
if (dai_index < 0) {
535+
tr_err(&basefw_comp_tr,
536+
"Failed to find HDA link stream ID for UAOL node_id: 0x%x",
537+
node_id);
538+
return IPC4_INVALID_RESOURCE_ID;
539+
}
508540
break;
509541
default:
510542
return IPC4_INVALID_RESOURCE_ID;
511543
}
512544

513-
const struct device *dev = dai_get_device(type, node.f.v_index);
545+
const struct device *dev = dai_get_device(type, dai_index);
514546

515547
if (!dev) {
516548
tr_err(&basefw_comp_tr,

0 commit comments

Comments
 (0)