-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tools: Topology2: Add support for ALSA enum control
This patch adds to definitions in common.conf a new class "text" to support the enum control values. Signed-off-by: Ranjani Sridharan <[email protected]> Signed-off-by: Seppo Ingalsuo <[email protected]>
- Loading branch information
Showing
2 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# | ||
# Enum kcontrol class. All attributes defined herein are namespaced | ||
# by alsatplg to "Object.Control.enum.N.attribute_name" | ||
# | ||
# Usage: this component can be used by instantiating it in the parent object. i.e. | ||
# | ||
# Object.Control.enum."N" { | ||
# index 1 | ||
# name "Master Playback Enum Control" | ||
# Object.Base.text.1 { | ||
# name "mytext" | ||
# !values [ | ||
# "One" | ||
# "Two" | ||
# "Three" | ||
# ] | ||
# } | ||
# Object.Base.channel.1 { | ||
# name "fc" | ||
# shift 0 | ||
# reg 0 | ||
# } | ||
# Object.Base.ops."ctl" { | ||
# info "enum" | ||
# get "257" | ||
# put "257" | ||
# } | ||
# } | ||
# | ||
# Where N is the unique instance number for the buffer object within the same alsaconf node. | ||
# The enum control object should also include the ops, channels and tlv objects in the object | ||
# instance | ||
|
||
<include/controls/common.conf> | ||
|
||
Class.Control."enum" { | ||
# | ||
# Pipeline ID for the enum object | ||
# | ||
DefineAttribute."index" {} | ||
|
||
# | ||
# Instance of enum object in the same alsaconf node | ||
# | ||
DefineAttribute."instance" {} | ||
|
||
# | ||
# Enum name. A enum object is included in the built topology only if it is given a | ||
# name | ||
# | ||
DefineAttribute."name" { | ||
type "string" | ||
} | ||
|
||
# | ||
# access control for enum | ||
# | ||
DefineAttribute."access" { | ||
type "compound" | ||
constraints { | ||
!valid_values [ | ||
"read_write" | ||
"tlv_read_write" | ||
"read" | ||
"write" | ||
"volatile" | ||
"tlv_read" | ||
"tlv_write" | ||
"tlv_command" | ||
"inactive" | ||
"lock" | ||
"owner" | ||
"tlv_callback" | ||
] | ||
} | ||
} | ||
|
||
attributes { | ||
# | ||
# The Enum object name would be constructed using the index and instance arguments. | ||
# For ex: "enum.1.1" or "enum.10.2" etc. | ||
# | ||
!constructor [ | ||
"index" | ||
"instance" | ||
] | ||
!mandatory [ | ||
name | ||
] | ||
# | ||
# enum control objects instantiated within the same alsaconf node must have unique | ||
# index attribute | ||
# | ||
unique "instance" | ||
} | ||
|
||
} |