forked from alsa-project/alsa-ucm-conf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sof-soundwire: Use one file for speaker codec initialization
Use macros to minimize configuration blocks. Signed-off-by: Jaroslav Kysela <[email protected]>
- Loading branch information
Showing
10 changed files
with
156 additions
and
189 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,46 @@ | ||
# Use case Configuration for sof-soundwire card | ||
|
||
# | ||
# Arguments: | ||
# ForAmps - regex filter for var:SpeakerAmps | ||
# Amp - amplifier number (1,2 etc.) | ||
# Sel - channel selection (LR LL RL RR) | ||
# | ||
DefineMacro.rt1308spk.If.0 { | ||
Condition { | ||
Type RegexMatch | ||
Regex "${var:__ForAmps}" | ||
String "${var:SpeakerAmps}" | ||
} | ||
True { | ||
EnableSequence [ | ||
cset "name='rt1308-${var:__Amp} RX Channel Select' ${var:__Sel}" | ||
cset "name='rt1308-${var:__Amp} DAC L Switch' 1" | ||
cset "name='rt1308-${var:__Amp} DAC R Switch' 1" | ||
] | ||
DisableSequence [ | ||
cset "name='rt1308-${var:__Amp} DAC L Switch' 0" | ||
cset "name='rt1308-${var:__Amp} DAC R Switch' 0" | ||
] | ||
} | ||
} | ||
|
||
SectionDevice."Speaker" { | ||
Comment "Speaker" | ||
|
||
Macro.num1.rt1308spk { ForAmps "[12]" Amp 1 Sel LL } | ||
Macro.num2.rt1308spk { ForAmps "2" Amp 2 Sel RR } | ||
|
||
EnableSequence [ | ||
cset "name='Speaker Switch' on" | ||
] | ||
|
||
DisableSequence [ | ||
cset "name='Speaker Switch' off" | ||
] | ||
|
||
Value { | ||
PlaybackPriority 100 | ||
PlaybackPCM "hw:${CardId},2" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
# Use case Configuration for sof-soundwire card | ||
|
||
# | ||
# Arguments: | ||
# ForAmps - regex filter for var:SpeakerAmps | ||
# Amp - amplifier number (1,2 etc.) | ||
# Sel - channel selection (L,R L,L L,R L,L+R R,L R,R R,L+R L+R,L L+R,R L+R,L+R) | ||
# | ||
DefineMacro.rt1316spk.If.0 { | ||
Condition { | ||
Type RegexMatch | ||
Regex "${var:__ForAmps}" | ||
String "${var:SpeakerAmps}" | ||
} | ||
True { | ||
EnableSequence [ | ||
cset "name='rt1316-${var:__Amp} RX Channel Select' ${var:__Sel}" | ||
] | ||
If.lrswitch { | ||
Condition { | ||
Type ControlExists | ||
Control "name='rt1316-${var:__Amp} DAC L Switch'" | ||
} | ||
True { | ||
EnableSequence [ | ||
cset "name='rt1316-${var:__Amp} DAC L Switch' 1" | ||
cset "name='rt1316-${var:__Amp} DAC R Switch' 1" | ||
] | ||
DisableSequence [ | ||
cset "name='rt1316-${var:__Amp} DAC L Switch' 0" | ||
cset "name='rt1316-${var:__Amp} DAC R Switch' 0" | ||
] | ||
} | ||
False { | ||
EnableSequence [ | ||
cset "name='rt1316-${var:__Amp} DAC Switch' 1" | ||
] | ||
|
||
DisableSequence [ | ||
cset "name='rt1316-${var:__Amp} DAC Switch' 0" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
SectionDevice."Speaker" { | ||
Comment "Speaker" | ||
|
||
Macro.num1.rt1316spk { ForAmps "[12]" Amp 1 Sel "L,L" } | ||
Macro.num2.rt1316spk { ForAmps "2" Amp 2 Sel "R,R" } | ||
|
||
EnableSequence [ | ||
cset "name='Speaker Switch' on" | ||
] | ||
|
||
DisableSequence [ | ||
cset "name='Speaker Switch' off" | ||
] | ||
|
||
Value { | ||
PlaybackPriority 100 | ||
PlaybackPCM "hw:${CardId},2" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
# Use case Configuration for sof-soundwire card | ||
|
||
# | ||
# Arguments: | ||
# ForAmps - regex filter for var:SpeakerAmps | ||
# Amp - amplifier number (1,2 etc.) | ||
# Sel - channel selection (L,R L,L L,R L,L+R R,L R,R R,L+R L+R,L L+R,R L+R,L+R) | ||
# | ||
DefineMacro.rt1318spk.If.0 { | ||
Condition { | ||
Type RegexMatch | ||
Regex "${var:__RegEx}" | ||
String "${var:SpeakerAmps}" | ||
} | ||
True { | ||
EnableSequence [ | ||
cset "name='rt1308-${var:__Amp} RX Channel Select' ${var:__Sel}" | ||
cset "name='rt1308-${var:__Amp} DAC Switch' 1" | ||
] | ||
DisableSequence [ | ||
cset "name='rt1308-${var:__Amp} DAC Switch' 0" | ||
] | ||
} | ||
} | ||
|
||
SectionDevice."Speaker" { | ||
Comment "Speaker" | ||
|
||
Macro.num1.rt1318spk { ForAmps "[12]" Amp 1 Sel "L,L" } | ||
Macro.num2.rt1318spk { ForAmps "2" Amp 2 Sel "R,R" } | ||
|
||
EnableSequence [ | ||
cset "name='Speaker Switch' on" | ||
] | ||
|
||
DisableSequence [ | ||
cset "name='Speaker Switch' off" | ||
] | ||
|
||
Value { | ||
PlaybackPriority 100 | ||
PlaybackPCM "hw:${CardId},2" | ||
} | ||
} |