Skip to content

Commit

Permalink
sof-hda-dsp: adapt to latest alsa-lib
Browse files Browse the repository at this point in the history
- use condition for 'Headphone Jack' / 'Headphone Mic Jack' selection
- remove cdev (not required)
- use ${CardId} where appropriate

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
perexg committed Nov 5, 2019
1 parent cdf8a38 commit 723b6da
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 53 deletions.
12 changes: 3 additions & 9 deletions ucm/sof-hda-dsp/Hdmi.conf
Expand Up @@ -4,17 +4,15 @@ SectionDevice."HDMI1" {
Comment "HDMI1/DP1 Output"

EnableSequence [
cdev "hw:sofhdadsp"
cset "name='IEC958 Playback Switch' on"
]

DisableSequence [
cdev "hw:sofhdadsp"
cset "name='IEC958 Playback Switch' off"
]

Value {
PlaybackPCM "hw:sofhdadsp,3"
PlaybackPCM "hw:${CardId},3"
PlaybackChannels "2"
JackControl "HDMI/DP,pcm=3 Jack"
}
Expand All @@ -24,17 +22,15 @@ SectionDevice."HDMI2" {
Comment "HDMI2/DP2 Output"

EnableSequence [
cdev "hw:sofhdadsp"
cset "name='IEC958 Playback Switch',index=1 on"
]

DisableSequence [
cdev "hw:sofhdadsp"
cset "name='IEC958 Playback Switch',index=1 off"
]

Value {
PlaybackPCM "hw:sofhdadsp,4"
PlaybackPCM "hw:${CardId},4"
PlaybackChannels "2"
JackControl "HDMI/DP,pcm=4 Jack"
}
Expand All @@ -44,17 +40,15 @@ SectionDevice."HDMI3" {
Comment "HDMI3/DP3 Output"

EnableSequence [
cdev "hw:sofhdadsp"
cset "name='IEC958 Playback Switch',index=2 on"
]

DisableSequence [
cdev "hw:sofhdadsp"
cset "name='IEC958 Playback Switch',index=2 off"
]

Value {
PlaybackPCM "hw:sofhdadsp,5"
PlaybackPCM "hw:${CardId},5"
PlaybackChannels "2"
JackControl "HDMI/DP,pcm=5 Jack"
}
Expand Down
64 changes: 25 additions & 39 deletions ucm/sof-hda-dsp/HiFi.conf
Expand Up @@ -2,58 +2,60 @@

SectionVerb {
EnableSequence [
cdev "hw:sofhdadsp"
cset "name='Master Playback Switch' on"
cset "name='Capture Switch' on"
]

DisableSequence [
cdev "hw:sofhdadsp"
]
}

SectionDevice."Headphone" {
Comment "Headphone"

EnableSequence [
cdev "hw:sofhdadsp"
cset "name='Headphone Playback Switch' on"
]

DisableSequence [
cdev "hw:sofhdadsp"
cset "name='Headphone Playback Switch' off"
]

Value {
PlaybackPCM "hw:sofhdadsp,0"
PlaybackVolume "name='Headphone'"
PlaybackSwitch "name='Headphone Playback Switch'"
PlaybackPCM "hw:${CardId},0"
PlaybackVolume "Headphone Playback Volume"
PlaybackSwitch "Headphone Playback Switch"
PlaybackChannels "2"
JackName "sof-hda-dsp Headphone"
JackName "SOF HDA DSP Headphone"
JackType "gpio"
JackSwitch "12"
JackControl "Headphone Jack"
If.1 {
Condition {
Type ControlExists
Control "iface=CARD,name='Headphone Mic Jack'"
}
True {
JackControl "Headphone Mic Jack"
}
False {
JackControl "Headphone Jack"
}
}
}
}

SectionDevice."Speaker" {
Comment "Speaker"

EnableSequence [
cdev "hw:sofhdadsp"
cset "name='Speaker Playback Switch' on"
]

DisableSequence [
cdev "hw:sofhdadsp"
cset "name='Speaker Playback Switch' off"
]

Value {
PlaybackPCM "hw:sofhdadsp,0"
PlaybackVolume "name='Speaker'"
PlaybackSwitch "name='Speaker Playback Switch'"
PlaybackPCM "hw:${CardId},0"
PlaybackVolume "Speaker Playback Volume"
PlaybackSwitch "Speaker Playback Switch"
JackHWMute "Headphone"
PlaybackChannels "2"
}
Expand All @@ -66,18 +68,10 @@ SectionDevice."HeadsetMic" {
"DigitalMic"
]

EnableSequence [
cdev "hw:sofhdadsp"
]

DisableSequence [
cdev "hw:sofhdadsp"
]

Value {
CapturePCM "hw:sofhdadsp,0"
CaptureVolume "name='Capture'"
CaptureSwitch "name='Capture Switch'"
CapturePCM "hw:${CardId},0"
CaptureVolume "Capture Volume"
CaptureSwitch "Capture Switch"
CaptureChannels "2"
JackControl "Mic Jack"
}
Expand All @@ -90,18 +84,10 @@ SectionDevice."DigitalMic" {
"HeadsetMic"
]

EnableSequence [
cdev "hw:sofhdadsp"
]

DisableSequence [
cdev "hw:sofhdadsp"
]

Value {
CapturePCM "hw:sofhdadsp,6"
CaptureVolume "name='Dmic0 Capture Volume'"
CaptureSwitch "name='Dmic0 Capture Switch'"
CapturePCM "hw:${CardId},6"
CaptureVolume "Dmic0 Capture Volume"
CaptureSwitch "Dmic0 Capture Switch"
CaptureChannels "2"
}
}
5 changes: 0 additions & 5 deletions ucm/sof-hda-dsp/sof-hda-dsp.conf
Expand Up @@ -7,8 +7,3 @@ SectionUseCase."Hdmi" {
File "Hdmi.conf"
Comment "Play to HDMI/DP"
}

ValueDefaults {
PlaybackCTL "hw:sofhdadsp"
CaptureCTL "hw:sofhdadsp"
}

0 comments on commit 723b6da

Please sign in to comment.