Repository navigation
Conversation
Add support for following definition for global variables:
IncludeByKey.SDW_DMIC_PCM_CHANNELS {
"1" { Define { SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_MONO } }
}
This doesn't currently work as the pre-processor merges the nested
Define into the global define registry as a STRING value
("$CHANNEL_CONFIG_MONO"). Later, during object attribute expansion,
pre_process_object_variables_expand_fcn finds the variable in the global
defines and returns immediately with that unresolved string. The caller
then passes "$CHANNEL_CONFIG_MONO" to the token encoder, which cannot
parse it as an integer and silently substitutes 0.
Add support for double expansion for such global defines. This is
similar to how local variables are already handled (see commit
0029ab7 ("topology: Expand attribute references inside $[]
expressions")), and will help to reduce repeated IncludeByKey statements
in topology files.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Author
|
@perexg This would be useful to allow sort of definitions that are used in: ... we later needed to revert this as upstream alsa-utils cannot support such constructs, but upon review, I concluded this is useful facility and we should add support to upstream. |
singalsu
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for following definition for global variables:
IncludeByKey.SDW_DMIC_PCM_CHANNELS {
"1" { Define { SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_MONO } }
}
This doesn't currently work as the pre-processor merges the nested Define into the global define registry as a STRING value ("$CHANNEL_CONFIG_MONO"). Later, during object attribute expansion, pre_process_object_variables_expand_fcn finds the variable in the global defines and returns immediately with that unresolved string. The caller then passes "$CHANNEL_CONFIG_MONO" to the token encoder, which cannot parse it as an integer and silently substitutes 0.
Add support for double expansion for such global defines. This is similar to how local variables are already handled (see commit 0029ab7 ("topology: Expand attribute references inside $[] expressions")), and will help to reduce repeated IncludeByKey statements in topology files.