From patchwork Tue Dec 5 16:46:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10093365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87DA360327 for ; Tue, 5 Dec 2017 16:56:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7641028B90 for ; Tue, 5 Dec 2017 16:56:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A03E28FB9; Tue, 5 Dec 2017 16:56:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB0FF28E34 for ; Tue, 5 Dec 2017 16:56:17 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 451332677B8; Tue, 5 Dec 2017 17:46:35 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 322F3266DD5; Tue, 5 Dec 2017 17:46:34 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 6E795266DD5 for ; Tue, 5 Dec 2017 17:46:27 +0100 (CET) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 24C6EAE1E; Tue, 5 Dec 2017 16:46:27 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 5 Dec 2017 17:46:19 +0100 Message-Id: <20171205164620.6257-2-tiwai@suse.de> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171205164620.6257-1-tiwai@suse.de> References: <20171205164620.6257-1-tiwai@suse.de> Cc: Hui Wang , Kailang Subject: [alsa-devel] [PATCH 2/3] conf/ucm: Add dual HD-audio codecs config for Lenovo X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Hui Wang Signed-off-by: Takashi Iwai --- configure.ac | 1 + .../HDAudio-Lenovo-DualCodecs.conf | 5 + src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 145 +++++++++++++++++++++ src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am | 4 + src/conf/ucm/Makefile.am | 1 + 5 files changed, 156 insertions(+) create mode 100644 src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf create mode 100644 src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf create mode 100644 src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am diff --git a/configure.ac b/configure.ac index 83724e07459c..286f6bdd74cb 100644 --- a/configure.ac +++ b/configure.ac @@ -698,6 +698,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 index 000000000000..98fdd8cceb7b --- /dev/null +++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf @@ -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 index 000000000000..509678964f3f --- /dev/null +++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf @@ -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 index 000000000000..da285415c145 --- /dev/null +++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am @@ -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) diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index 060d025f1bb5..1d81beeb4ddf 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -6,6 +6,7 @@ chtrt5645 \ DAISY-I2S \ DB410c \ GoogleNyan \ +HDAudio-Lenovo-DualCodecs \ PandaBoard \ PandaBoardES \ PAZ00 \