|
14 | 14 |
|
15 | 15 | LOG_MODULE_REGISTER(uaol, CONFIG_SOF_LOG_LEVEL); |
16 | 16 |
|
17 | | -struct ipc4_uaol_link_capabilities { |
18 | | - uint32_t input_streams_supported : 4; |
19 | | - uint32_t output_streams_supported : 4; |
20 | | - uint32_t bidirectional_streams_supported : 5; |
21 | | - uint32_t rsvd : 19; |
22 | | - uint32_t max_tx_fifo_size; |
23 | | - uint32_t max_rx_fifo_size; |
24 | | -} __packed __aligned(4); |
25 | | - |
26 | | -struct ipc4_uaol_capabilities { |
27 | | - uint32_t link_count; |
28 | | - struct ipc4_uaol_link_capabilities link_caps[]; |
29 | | -} __packed __aligned(4); |
| 17 | +/* The UAOL capabilities and stream mapping queries of the base firmware, which run in |
| 18 | + * kernel mode, are in src/kernel/audio/intel_uaol-kernel.c |
| 19 | + */ |
30 | 20 |
|
31 | 21 | #define DEV_AND_COMMA(node) DEVICE_DT_GET(node), |
32 | 22 | /* const pointers keep the array in rodata, readable by the user-space LL thread */ |
33 | | -static const struct device *const uaol_devs[] = { |
| 23 | +const struct device *const uaol_devs[] = { |
34 | 24 | DT_FOREACH_STATUS_OKAY(intel_adsp_uaol, DEV_AND_COMMA) |
35 | 25 | }; |
36 | 26 |
|
37 | | -#if !CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY |
38 | | -__cold void tlv_value_set_uaol_caps(struct sof_tlv *tuple, uint32_t type) |
39 | | -{ |
40 | | - const size_t dev_count = ARRAY_SIZE(uaol_devs); |
41 | | - struct uaol_capabilities dev_cap; |
42 | | - struct ipc4_uaol_capabilities *caps = (struct ipc4_uaol_capabilities *)tuple->value; |
43 | | - size_t caps_size = offsetof(struct ipc4_uaol_capabilities, link_caps[dev_count]); |
44 | | - size_t i; |
45 | | - int ret; |
46 | | - |
47 | | - assert_can_be_cold(); |
48 | | - |
49 | | - memset(caps, 0, caps_size); |
50 | | - |
51 | | - caps->link_count = dev_count; |
52 | | - for (i = 0; i < dev_count; i++) { |
53 | | - ret = uaol_get_capabilities(uaol_devs[i], &dev_cap); |
54 | | - if (ret) |
55 | | - continue; |
56 | | - |
57 | | - caps->link_caps[i].input_streams_supported = dev_cap.input_streams; |
58 | | - caps->link_caps[i].output_streams_supported = dev_cap.output_streams; |
59 | | - caps->link_caps[i].bidirectional_streams_supported = dev_cap.bidirectional_streams; |
60 | | - caps->link_caps[i].max_tx_fifo_size = dev_cap.max_tx_fifo_size; |
61 | | - caps->link_caps[i].max_rx_fifo_size = dev_cap.max_rx_fifo_size; |
62 | | - } |
63 | | - |
64 | | - tlv_value_set(tuple, type, caps_size, caps); |
65 | | -} |
66 | | -#endif /* !CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY */ |
67 | | - |
68 | | -__cold int uaol_stream_id_to_hda_link_stream_id(int uaol_stream_id) |
69 | | -{ |
70 | | - size_t dev_count = ARRAY_SIZE(uaol_devs); |
71 | | - size_t i; |
72 | | - |
73 | | - assert_can_be_cold(); |
74 | | - |
75 | | - for (i = 0; i < dev_count; i++) { |
76 | | - int hda_link_stream_id = uaol_get_mapped_hda_link_stream_id(uaol_devs[i], |
77 | | - uaol_stream_id); |
78 | | - if (hda_link_stream_id >= 0) |
79 | | - return hda_link_stream_id; |
80 | | - } |
81 | | - |
82 | | - return -1; |
83 | | -} |
84 | | - |
85 | 27 | const struct device *get_uaol_zdevice(int uaol_link_id) |
86 | 28 | { |
87 | 29 | /* uaol_link_id is just an index for the device tree device */ |
|
0 commit comments