Skip to content

Commit

Permalink
ucm2: Separate the configuration lookups (hw based) from the configur…
Browse files Browse the repository at this point in the history
…ation tree

Introduce ucm2/conf.d/ tree with symlinks to the real hardware configurations.
In this way, we do not rely to create the configuration paths based on
simple driver / device identification, but we can store the configurations
more logically to make the maintenance (code reuse, multiple changes)
more easy.

BugLink: alsa-project#70
BugLink: alsa-project#76
BugLink: alsa-project#78
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
perexg committed Feb 3, 2021
1 parent 889c5b9 commit cfb86a8
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions ucm2/ucm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
Syntax 3

Define.V1 "" # non-empty string to enable ucm v1 paths
Define.V2Module yes # empty string to disable
Define.V2Name yes # empty string to disable
Define.V2ConfD yes # empty string to disable
Define.V2Module "" # non-empty string to enable module name lookups (obsolete)
Define.V2Name "" # non-empty string to enable driver & card name lookups (obsolete)

If.driver {
Condition {
Expand All @@ -40,11 +41,41 @@ If.driver {
#
# The probed path when hw-card is found:
#
# ucm2/${KernelModule}/${KernelModule}.conf
# ucm2/${CardDriver}/${CardLongName}.conf
# ucm2/${CardDriver}/${CardDriver}.conf
# ucm2/db/[${CardDriver}|${KernelDriver}]/${CardLongName}.conf
# ucm2/db/[${CardDriver}|${KernelDriver}]/[${CardDriver}|${KernelDriver}].conf
# ucm2/${KernelModule}/${KernelModule}.conf (obsolete)
# ucm2/${CardDriver}/${CardLongName}.conf (obsolete)
# ucm2/${CardDriver}/${CardDriver}.conf (obsolete)
#

If.V2ConfD {
Condition {
Type String
Empty "${var:V2ConfD}"
}
False {
Define.Driver "${CardDriver}"
If.nodrv {
Condition {
Type String
Empty "${var:Driver}"
}
True.Define {
KernelDriverPath "class/sound/card${CardNumber}/device/driver"
Driver "${sys:$KernelDriverPath}"
}
False.Define.Driver "${CardDriver}"
}
UseCasePath.driver1 {
Directory "conf.d/${var:Driver}"
File "${CardLongName}.conf"
}
UseCasePath.driver {
Directory "conf.d/${var:Driver}"
File "${var:Driver}.conf"
}
}
}
If.V2Module {
Condition {
Type String
Expand Down

0 comments on commit cfb86a8

Please sign in to comment.