From patchwork Thu May 31 15:10:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10441295 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 4CB07603B5 for ; Thu, 31 May 2018 15:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3927B28595 for ; Thu, 31 May 2018 15:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CDCD2859A; Thu, 31 May 2018 15:11:22 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 1A99128595 for ; Thu, 31 May 2018 15:11:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ADCC8267950; Thu, 31 May 2018 17:10:46 +0200 (CEST) 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 1D0CE26792D; Thu, 31 May 2018 17:10:37 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by alsa0.perex.cz (Postfix) with ESMTP id 337EB267932 for ; Thu, 31 May 2018 17:10:33 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A49EBB43F; Thu, 31 May 2018 15:10:32 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-177.ams2.redhat.com [10.36.116.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1C01208C6C1; Thu, 31 May 2018 15:10:31 +0000 (UTC) From: Hans de Goede To: alsa-devel@alsa-project.org Date: Thu, 31 May 2018 17:10:25 +0200 Message-Id: <20180531151026.29521-5-hdegoede@redhat.com> In-Reply-To: <20180531151026.29521-1-hdegoede@redhat.com> References: <20180531151026.29521-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 31 May 2018 15:10:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 31 May 2018 15:10:32 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' Cc: Takashi Iwai , Hans de Goede , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH 4/5] conf/ucm: chtnau8824: Add UCM profile for chtnau8824 boards 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 Add UCM profile for chtnau8824 boards based on: https://github.com/plbossart/UCM/blob/master/chtnau8824 Split into multiple files in the same way as this was done for the bytcr-rt5640 support, re-using the existing ucm/PlatformEnableSeq.conf and ucm/PlatformDisableSeq.conf files for the SST mixer settings. Signed-off-by: Hans de Goede --- configure.ac | 2 ++ src/conf/ucm/Makefile.am | 2 ++ src/conf/ucm/chtnau8824/HiFi.conf | 28 ++++++++++++++++++++++ src/conf/ucm/chtnau8824/Makefile.am | 4 ++++ src/conf/ucm/chtnau8824/chtnau8824.conf | 6 +++++ src/conf/ucm/nau8824/EnableSeq.conf | 15 ++++++++++++ src/conf/ucm/nau8824/HeadPhones.conf | 25 ++++++++++++++++++++ src/conf/ucm/nau8824/HeadsetMic.conf | 31 +++++++++++++++++++++++++ src/conf/ucm/nau8824/InternalMic.conf | 31 +++++++++++++++++++++++++ src/conf/ucm/nau8824/Makefile.am | 5 ++++ src/conf/ucm/nau8824/MonoSpeaker.conf | 29 +++++++++++++++++++++++ src/conf/ucm/nau8824/Speaker.conf | 28 ++++++++++++++++++++++ 12 files changed, 206 insertions(+) create mode 100644 src/conf/ucm/chtnau8824/HiFi.conf create mode 100644 src/conf/ucm/chtnau8824/Makefile.am create mode 100644 src/conf/ucm/chtnau8824/chtnau8824.conf create mode 100644 src/conf/ucm/nau8824/EnableSeq.conf create mode 100644 src/conf/ucm/nau8824/HeadPhones.conf create mode 100644 src/conf/ucm/nau8824/HeadsetMic.conf create mode 100644 src/conf/ucm/nau8824/InternalMic.conf create mode 100644 src/conf/ucm/nau8824/Makefile.am create mode 100644 src/conf/ucm/nau8824/MonoSpeaker.conf create mode 100644 src/conf/ucm/nau8824/Speaker.conf diff --git a/configure.ac b/configure.ac index 57e0c354..ce21c7fb 100644 --- a/configure.ac +++ b/configure.ac @@ -729,6 +729,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/Makefile \ src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/Makefile \ src/conf/ucm/bytcr-rt5651/Makefile \ + src/conf/ucm/chtnau8824/Makefile \ src/conf/ucm/chtrt5645/Makefile \ src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile \ src/conf/ucm/DAISY-I2S/Makefile \ @@ -739,6 +740,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile \ src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \ src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile \ + src/conf/ucm/nau8824/Makefile \ src/conf/ucm/PandaBoard/Makefile \ src/conf/ucm/PandaBoardES/Makefile \ src/conf/ucm/PAZ00/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index a524921b..c350c526 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -11,6 +11,7 @@ bytcr-rt5640-stereo-spk-dmic1-mic \ bytcr-rt5640-stereo-spk-in1-mic \ bytcr-rt5640-stereo-spk-in3-mic \ bytcr-rt5651 \ +chtnau8824 \ chtrt5645 \ chtrt5645-mono-speaker-analog-mic \ DAISY-I2S \ @@ -21,6 +22,7 @@ gpd-win-pocket-rt5645 \ HDAudio-Gigabyte-ALC1220DualCodecs \ HDAudio-Lenovo-DualCodecs \ LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216 \ +nau8824 \ PandaBoard \ PandaBoardES \ PAZ00 \ diff --git a/src/conf/ucm/chtnau8824/HiFi.conf b/src/conf/ucm/chtnau8824/HiFi.conf new file mode 100644 index 00000000..dc52800e --- /dev/null +++ b/src/conf/ucm/chtnau8824/HiFi.conf @@ -0,0 +1,28 @@ + + +SectionVerb { + + Value { + TQ "HiFi" + # ALSA PCM device for HiFi + PlaybackPCM "hw:chtnau8824" + CapturePCM "hw:chtnau8824" + } + + EnableSequence [ + cdev "hw:chtnau8824" + + + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + ] +} + + + + + + diff --git a/src/conf/ucm/chtnau8824/Makefile.am b/src/conf/ucm/chtnau8824/Makefile.am new file mode 100644 index 00000000..e197d3e6 --- /dev/null +++ b/src/conf/ucm/chtnau8824/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/chtnau8824 +ucm_DATA = chtnau8824.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/chtnau8824/chtnau8824.conf b/src/conf/ucm/chtnau8824/chtnau8824.conf new file mode 100644 index 00000000..189b0dbe --- /dev/null +++ b/src/conf/ucm/chtnau8824/chtnau8824.conf @@ -0,0 +1,6 @@ +Comment "chtnau8824 internal card" + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} diff --git a/src/conf/ucm/nau8824/EnableSeq.conf b/src/conf/ucm/nau8824/EnableSeq.conf new file mode 100644 index 00000000..05f5f0b4 --- /dev/null +++ b/src/conf/ucm/nau8824/EnableSeq.conf @@ -0,0 +1,15 @@ +# Playback TDM configuration +cset "name='DACL Channel Source' 0" +cset "name='DACR Channel Source' 1" +# Input Configuration +cset "name='DMIC1 Enable Switch' off" +cset "name='DMIC2 Enable Switch' off" +cset "name='DMIC3 Enable Switch' off" +cset "name='DMIC4 Enable Switch' off" +cset "name='MIC1 Volume' 10" +cset "name='MIC2 Volume' 10" +# Button Configuration +cset "name='THD for key media' 10" +cset "name='THD for key voice command' 16" +cset "name='THD for key volume up' 38" +cset "name='THD for key volume down' 115" diff --git a/src/conf/ucm/nau8824/HeadPhones.conf b/src/conf/ucm/nau8824/HeadPhones.conf new file mode 100644 index 00000000..8ed6f194 --- /dev/null +++ b/src/conf/ucm/nau8824/HeadPhones.conf @@ -0,0 +1,25 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } + + ConflictingDevice [ + "MonoSpeaker" + "Speaker" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Headphone Switch' off" + ] +} diff --git a/src/conf/ucm/nau8824/HeadsetMic.conf b/src/conf/ucm/nau8824/HeadsetMic.conf new file mode 100644 index 00000000..11b0b52a --- /dev/null +++ b/src/conf/ucm/nau8824/HeadsetMic.conf @@ -0,0 +1,31 @@ +SectionDevice."HeadsetMic" { + Comment "Headset Microphone" + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } + + ConflictingDevice [ + "InternalMic" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='ADC CH0 Select' 1" + cset "name='ADC CH1 Select' 1" + + cset "name='Headset Mic Switch' on" + cset "name='Right ADC HSMIC Switch' on" + cset "name='Left ADC HSMIC Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Headset Mic Switch' off" + cset "name='Right ADC HSMIC Switch' off" + cset "name='Left ADC HSMIC Switch' off" + ] +} diff --git a/src/conf/ucm/nau8824/InternalMic.conf b/src/conf/ucm/nau8824/InternalMic.conf new file mode 100644 index 00000000..c6a741cc --- /dev/null +++ b/src/conf/ucm/nau8824/InternalMic.conf @@ -0,0 +1,31 @@ +SectionDevice."InternalMic" { + Comment "Internal Microphone" + + Value { + CaptureChannels "2" + CapturePriority "150" + } + + ConflictingDevice [ + "HeadsetMic" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='ADC CH0 Select' 0" + cset "name='ADC CH1 Select' 0" + + cset "name='Int Mic Switch' on" + cset "name='Right ADC MIC Switch' on" + cset "name='Left ADC MIC Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Int Mic Switch' off" + cset "name='Right ADC MIC Switch' off" + cset "name='Left ADC MIC Switch' off" + ] +} diff --git a/src/conf/ucm/nau8824/Makefile.am b/src/conf/ucm/nau8824/Makefile.am new file mode 100644 index 00000000..b39b8bb4 --- /dev/null +++ b/src/conf/ucm/nau8824/Makefile.am @@ -0,0 +1,5 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/nau8824 +ucm_DATA = EnableSeq.conf HeadPhones.conf HeadsetMic.conf InternalMic.conf \ + MonoSpeaker.conf Speaker.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/nau8824/MonoSpeaker.conf b/src/conf/ucm/nau8824/MonoSpeaker.conf new file mode 100644 index 00000000..86735181 --- /dev/null +++ b/src/conf/ucm/nau8824/MonoSpeaker.conf @@ -0,0 +1,29 @@ +SectionDevice."MonoSpeaker" { + Comment "Mono Speaker" + + Value { + PlaybackChannels "2" + } + + ConflictingDevice [ + "Speaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + # nau8824 mono speaker boards have the speaker on the right chan + cset "name='Speaker Left DACL Volume' 0" + cset "name='Speaker Left DACR Volume' 0" + cset "name='Speaker Right DACL Volume' 1" + cset "name='Speaker Right DACR Volume' 1" + cset "name='Ext Spk Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Ext Spk Switch' off" + ] +} diff --git a/src/conf/ucm/nau8824/Speaker.conf b/src/conf/ucm/nau8824/Speaker.conf new file mode 100644 index 00000000..e4d25b08 --- /dev/null +++ b/src/conf/ucm/nau8824/Speaker.conf @@ -0,0 +1,28 @@ +SectionDevice."Speaker" { + Comment "Speaker" + + Value { + PlaybackChannels "2" + } + + ConflictingDevice [ + "MonoSpeaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='Speaker Left DACL Volume' 1" + cset "name='Speaker Left DACR Volume' 0" + cset "name='Speaker Right DACL Volume' 0" + cset "name='Speaker Right DACR Volume' 1" + cset "name='Ext Spk Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Ext Spk Switch' off" + ] +}