|
15 | 15 | #include <linux/workqueue.h> |
16 | 16 | #include <sound/tlv.h> |
17 | 17 | #include <uapi/sound/sof/tokens.h> |
| 18 | +#include <sound/sof/topology.h> |
18 | 19 | #include "sof-priv.h" |
19 | 20 | #include "sof-audio.h" |
20 | 21 | #include "ops.h" |
@@ -317,6 +318,28 @@ static enum sof_ipc_dai_type find_dai(const char *name) |
317 | 318 | return SOF_DAI_INTEL_NONE; |
318 | 319 | } |
319 | 320 |
|
| 321 | +struct sof_comp_domains { |
| 322 | + const char *name; |
| 323 | + enum sof_comp_domain domain; |
| 324 | +}; |
| 325 | + |
| 326 | +static const struct sof_comp_domains sof_domains[] = { |
| 327 | + { "LL", SOF_COMP_DOMAIN_LL, }, |
| 328 | + { "DP", SOF_COMP_DOMAIN_DP, } |
| 329 | +}; |
| 330 | + |
| 331 | +static enum sof_comp_domain find_domain(const char *name) |
| 332 | +{ |
| 333 | + int i; |
| 334 | + |
| 335 | + for (i = 0; i < ARRAY_SIZE(sof_domains); i++) { |
| 336 | + if (strcmp(name, sof_domains[i].name) == 0) |
| 337 | + return sof_domains[i].domain; |
| 338 | + } |
| 339 | + |
| 340 | + return SOF_COMP_DOMAIN_UNSET; |
| 341 | +} |
| 342 | + |
320 | 343 | /* |
321 | 344 | * Supported Frame format types and lookup, add new ones to end of list. |
322 | 345 | */ |
@@ -405,6 +428,14 @@ int get_token_dai_type(void *elem, void *object, u32 offset) |
405 | 428 | return 0; |
406 | 429 | } |
407 | 430 |
|
| 431 | +int get_token_comp_domain(void *elem, void *object, u32 offset) |
| 432 | +{ |
| 433 | + u32 *val = (u32 *)((u8 *)object + offset); |
| 434 | + |
| 435 | + *val = find_domain((const char *)elem); |
| 436 | + return 0; |
| 437 | +} |
| 438 | + |
408 | 439 | /* PCM */ |
409 | 440 | static const struct sof_topology_token stream_tokens[] = { |
410 | 441 | {SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, |
|
0 commit comments