]> git.alsa-project.org Git - alsa-lib.git/commitdiff
conf/ucm: Add dual HD-audio codecs config for Lenovo
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Dec 2017 13:53:11 +0000 (14:53 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 5 Dec 2017 22:33:37 +0000 (23:33 +0100)
Some recent Lenovo laptops have dual codecs and we need to switch them
accordingly.  The kernel side already contains a fix and gives the
unique longname string for identifying the board, and here we hook up
the corresponding UCM profile.

The profile was corrected and tested by Hui Wang on Lenovo p520.

Tested-by: Kailang <kailang@realtek.com>
Tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
configure.ac
src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf [new file with mode: 0644]
src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf [new file with mode: 0644]
src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am [new file with mode: 0644]
src/conf/ucm/Makefile.am

index c232236dc193afedea426a0e6c5494e12ab26536..8d95a8b17f0c252cfdcf2c1469292baca92eca6e 100644 (file)
@@ -716,6 +716,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
          src/conf/ucm/DAISY-I2S/Makefile \
          src/conf/ucm/DB410c/Makefile \
          src/conf/ucm/GoogleNyan/Makefile \
+         src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \
          src/conf/ucm/PandaBoard/Makefile \
          src/conf/ucm/PandaBoardES/Makefile \
          src/conf/ucm/PAZ00/Makefile \
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf
new file mode 100644 (file)
index 0000000..98fdd8c
--- /dev/null
@@ -0,0 +1,5 @@
+Comment "Lenovo laptop with dual HD-audio codecs"
+SectionUseCase."HiFi" {
+       File "HiFi.conf"
+       Comment "Default"
+}
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf
new file mode 100644 (file)
index 0000000..5096789
--- /dev/null
@@ -0,0 +1,145 @@
+SectionVerb {
+       Value {
+               TQ "HiFi"
+       }
+
+       EnableSequence [
+               cdev "hw:PCH"
+               cset "name='Front Playback Volume' 100%"
+               cset "name='Front Playback Switch' on"
+               cset "name='Rear-Panel Capture Volume' 100%"
+               cset "name='Rear-Panel Capture Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:PCH"
+               cset "name='Front Playback Volume' 0"
+               cset "name='Front Playback Switch' off"
+               cset "name='Rear-Panel Capture Volume' 0"
+               cset "name='Rear-Panel Capture Switch' off"
+       ]
+}
+
+SectionDevice."Speaker" {
+       Comment "Speaker"
+
+       Value {
+               PlaybackChannels "2"
+               PlaybackPCM "hw:PCH,4"
+       }
+
+       ConflictingDevice [
+               "Headphone"
+       ]
+
+       EnableSequence [
+               cdev "hw:PCH"
+               cset "name='Speaker Playback Switch' on"
+               cset "name='Speaker Playback Volume' 100%"
+       ]
+
+       DisableSequence [
+               cdev "hw:PCH"
+               cset "name='Speaker Playback Volume' 0"
+               cset "name='Speaker Playback Switch' off"
+       ]
+}
+
+SectionDevice."LineOut" {
+       Comment "Line Out"
+
+       Value {
+               PlaybackChannels "2"
+               PlaybackPCM "hw:PCH,0"
+               JackControl "Line Out Jack"
+               JackHWMute "Speaker"
+       }
+}
+
+SectionDevice."Headphone" {
+       Comment "Headphone"
+
+       Value {
+               PlaybackChannels "2"
+               PlaybackPCM "hw:PCH,4"
+               JackControl "Front Headphone Jack"
+               JackHWMute "Speaker"
+       }
+
+       ConflictingDevice [
+               "Speaker"
+       ]
+
+       EnableSequence [
+               cdev "hw:PCH"
+               cset "name='Headphone Playback Switch' on"
+               cset "name='Headphone Playback Volume' 100%"
+       ]
+
+       DisableSequence [
+               cdev "hw:PCH"
+               cset "name='Headphone Playback Volume' 0"
+               cset "name='Headphone Playback Switch' off"
+       ]
+}
+
+SectionDevice."LineIn" {
+       Comment "Rear Line In"
+
+       Value {
+               CaptureChannels "2"
+               CapturePCM "hw:PCH,0"
+               JackControl "Line Jack"
+       }
+
+       ConflictingDevice [
+               "RearMic"
+       ]
+
+       EnableSequence [
+               cdev "hw:PCH"
+               cset "name='Input Source' Line"
+       ]
+}
+
+SectionDevice."RearMic" {
+       Comment "Rear Microphone"
+
+       Value {
+               CaptureChannels "2"
+               CapturePCM "hw:PCH,0"
+               # CapturePriority "150"
+               JackHWMute "LineIn"
+       }
+
+       ConflictingDevice [
+               "LineIn"
+       ]
+
+       EnableSequence [
+               cdev "hw:PCH"
+               cset "name='Input Source' Rear Mic"
+       ]
+}
+
+SectionDevice."FrontMic" {
+       Comment "Front Microphone"
+
+       Value {
+               CaptureChannels "2"
+               CapturePCM "hw:PCH,4"
+               JackControl "Front Mic Jack"
+       }
+
+       EnableSequence [
+               cdev "hw:PCH"
+               cset "name='Front-Panel Capture Volume' 100%"
+               cset "name='Front-Panel Capture Switch' on"
+       ]
+
+       DisableSequence [
+               cdev "hw:PCH"
+               cset "name='Front-Panel Capture Volume' 0"
+               cset "name='Front-Panel Capture Switch' off"
+       ]
+}
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am
new file mode 100644 (file)
index 0000000..da28541
--- /dev/null
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/HDAudio-Lenovo-DualCodecs
+ucm_DATA = HDAudio-Lenovo-DualCodecs.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
index 060d025f1bb51b947884ebcf5125463fe52de928..1d81beeb4ddfe0e9dc48aef858dcddfd27b1a726 100644 (file)
@@ -6,6 +6,7 @@ chtrt5645 \
 DAISY-I2S \
 DB410c \
 GoogleNyan \
+HDAudio-Lenovo-DualCodecs \
 PandaBoard \
 PandaBoardES \
 PAZ00 \