From patchwork Fri Jul 20 07:27:37 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: 10536089 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 7E83660554 for ; Fri, 20 Jul 2018 07:38:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6347629190 for ; Fri, 20 Jul 2018 07:38:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57F652959F; Fri, 20 Jul 2018 07:38:47 +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 313082953F for ; Fri, 20 Jul 2018 07:38:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AA7F62677B1; Fri, 20 Jul 2018 09:28:12 +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 57C29267784; Fri, 20 Jul 2018 09:27:59 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by alsa0.perex.cz (Postfix) with ESMTP id D80D226774B for ; Fri, 20 Jul 2018 09:27:54 +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 397CC738E6; Fri, 20 Jul 2018 07:27:54 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-117-82.ams2.redhat.com [10.36.117.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76DDB2156897; Fri, 20 Jul 2018 07:27:53 +0000 (UTC) From: Hans de Goede To: alsa-devel@alsa-project.org Date: Fri, 20 Jul 2018 09:27:37 +0200 Message-Id: <20180720072741.4632-11-hdegoede@redhat.com> In-Reply-To: <20180720072741.4632-1-hdegoede@redhat.com> References: <20180720072741.4632-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]); Fri, 20 Jul 2018 07:27:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 20 Jul 2018 07:27:54 +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 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output 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 Split the bytcr-rt5651 config into 1 .conf file per input / output as has already been done for the bytcr-rt5640 and the chtnau8824 profiles. This allows easy creation of long-name profiles with the specific input / output combinations found on a board without needing to copy and paste things. Signed-off-by: Hans de Goede --- src/conf/ucm/bytcr-rt5651/HiFi.conf | 197 +--------------------- src/conf/ucm/rt5651/HeadPhones.conf | 31 ++++ src/conf/ucm/rt5651/IN1-InternalMic.conf | 27 +++ src/conf/ucm/rt5651/IN12-InternalMic.conf | 31 ++++ src/conf/ucm/rt5651/IN2-InternalMic.conf | 27 +++ src/conf/ucm/rt5651/IN3-HeadsetMic.conf | 28 +++ src/conf/ucm/rt5651/Makefile.am | 4 +- src/conf/ucm/rt5651/Speaker.conf | 30 ++++ 8 files changed, 185 insertions(+), 190 deletions(-) create mode 100644 src/conf/ucm/rt5651/HeadPhones.conf create mode 100644 src/conf/ucm/rt5651/IN1-InternalMic.conf create mode 100644 src/conf/ucm/rt5651/IN12-InternalMic.conf create mode 100644 src/conf/ucm/rt5651/IN2-InternalMic.conf create mode 100644 src/conf/ucm/rt5651/IN3-HeadsetMic.conf create mode 100644 src/conf/ucm/rt5651/Speaker.conf diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf index 54c365d9..961b2604 100644 --- a/src/conf/ucm/bytcr-rt5651/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf @@ -1,5 +1,7 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 + + SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" @@ -18,194 +20,11 @@ SectionVerb { } } -SectionDevice."Headphones" { - Comment "Headphones playback" - - ConflictingDevice [ - "Speaker" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Headphones playback enable sequence" - cset "name='Headphone Switch' on" - cset "name='HPO L Playback Switch' on" - cset "name='HPO R Playback Switch' on" - # Done after turning the HP on to keep the bias and clk on - cset "name='Speaker Switch' off" - cset "name='LOUT L Playback Switch' off" - cset "name='LOUT R Playback Switch' off" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Headphones playback disable sequence" - # This is done by the Speaker EnableSequence, so that the - # Platform Clock and BIAS do not temporarily get turned off - # as that breaks audio-streams which are playing when - # switching between Speaker/Headphone - ] - - Value { - PlaybackChannels "2" - JackControl "Headphone Jack" - } -} - -SectionDevice."Speaker" { - Comment "Speaker playback" - - ConflictingDevice [ - "Headphones" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Speaker enable sequence" - cset "name='Speaker Switch' on" - cset "name='LOUT L Playback Switch' on" - cset "name='LOUT R Playback Switch' on" - # Done after turning the speaker on to keep the bias and clk on - cset "name='Headphone Switch' off" - cset "name='HPO L Playback Switch' off" - cset "name='HPO R Playback Switch' off" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Speaker disable sequence" - # This is done by the Headphones EnableSequence, so that the - # Platform Clock and BIAS do not temporarily get turned off - # as that breaks audio-streams which are playing when - # switching between Speaker/Headphone - ] - - Value { - PlaybackChannels "2" - } -} - -SectionDevice."InternalMic-IN1" { - Comment "Internal Microphone on IN1" - - ConflictingDevice [ - "InternalMic-IN2" - "InternalMic-IN12" - "HeadsetMic-IN3" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Internal Mic IN1 Microphone enable sequence" - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Internal Mic IN1 Microphone disable sequence" - cset "name='Internal Mic Switch' off" - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - ] - - Value { - CaptureChannels "2" - } -} - -SectionDevice."InternalMic-IN2" { - Comment "Internal Microphone on IN2" - - ConflictingDevice [ - "InternalMic-IN1" - "InternalMic-IN12" - "HeadsetMic-IN3" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Internal Mic IN2 Microphone enable sequence" - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Internal Mic IN2 Microphone disable sequence" - cset "name='Internal Mic Switch' off" - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - ] - - Value { - CaptureChannels "2" - } -} - -SectionDevice."InternalMic-IN12" { - Comment "Internal Microphones on IN1 and IN2" - - ConflictingDevice [ - "InternalMic-IN1" - "InternalMic-IN2" - "HeadsetMic-IN3" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Internal Mic IN12 Microphone enable sequence" - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - exec "echo Internal Mic IN12 Microphone disable sequence" - cset "name='Internal Mic Switch' off" - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - ] - - Value { - CaptureChannels "2" - } -} - -SectionDevice."HeadsetMic-IN3" { - Comment "Headset Microphone" - - ConflictingDevice [ - "InternalMic-IN1" - "InternalMic-IN2" - "InternalMic-IN12" - ] + + - EnableSequence [ - cdev "hw:bytcrrt5651" - exec "echo HeadsetMic-IN3 Microphone enable sequence" - cset "name='Headset Mic Switch' on" - cset "name='RECMIXL BST3 Switch' on" - cset "name='RECMIXR BST3 Switch' on" - ] - DisableSequence [ - cdev "hw:bytcrrt5651" - exec "echo HeadsetMic-IN3 Microphone disable sequence" - cset "name='Headset Mic Switch' off" - cset "name='RECMIXL BST3 Switch' off" - cset "name='RECMIXR BST3 Switch' off" - ] - - Value { - CaptureChannels "2" - JackControl "Headset Mic Jack" - } -} + + + + diff --git a/src/conf/ucm/rt5651/HeadPhones.conf b/src/conf/ucm/rt5651/HeadPhones.conf new file mode 100644 index 00000000..b9323a36 --- /dev/null +++ b/src/conf/ucm/rt5651/HeadPhones.conf @@ -0,0 +1,31 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headphone Switch' on" + cset "name='HPO L Playback Switch' on" + cset "name='HPO R Playback Switch' on" + # Done after turning the HP on to keep the bias and clk on + cset "name='Speaker Switch' off" + cset "name='LOUT L Playback Switch' off" + cset "name='LOUT R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # This is done by the Speaker EnableSequence, so that the + # Platform Clock and BIAS do not temporarily get turned off + # as that breaks audio-streams which are playing when + # switching between Speaker/Headphone + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } +} diff --git a/src/conf/ucm/rt5651/IN1-InternalMic.conf b/src/conf/ucm/rt5651/IN1-InternalMic.conf new file mode 100644 index 00000000..85e25a5c --- /dev/null +++ b/src/conf/ucm/rt5651/IN1-InternalMic.conf @@ -0,0 +1,27 @@ +SectionDevice."InternalMic-IN1" { + Comment "Internal Microphone on IN1" + + ConflictingDevice [ + "InternalMic-IN2" + "InternalMic-IN12" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' on" + cset "name='RECMIXL BST1 Switch' on" + cset "name='RECMIXR BST1 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' off" + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/rt5651/IN12-InternalMic.conf b/src/conf/ucm/rt5651/IN12-InternalMic.conf new file mode 100644 index 00000000..f1cc17fe --- /dev/null +++ b/src/conf/ucm/rt5651/IN12-InternalMic.conf @@ -0,0 +1,31 @@ +SectionDevice."InternalMic-IN12" { + Comment "Internal Microphones on IN1 and IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' on" + cset "name='RECMIXL BST1 Switch' on" + cset "name='RECMIXR BST1 Switch' on" + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' off" + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/rt5651/IN2-InternalMic.conf b/src/conf/ucm/rt5651/IN2-InternalMic.conf new file mode 100644 index 00000000..18f74e1a --- /dev/null +++ b/src/conf/ucm/rt5651/IN2-InternalMic.conf @@ -0,0 +1,27 @@ +SectionDevice."InternalMic-IN2" { + Comment "Internal Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN12" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' on" + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' off" + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/rt5651/IN3-HeadsetMic.conf new file mode 100644 index 00000000..bfd0b009 --- /dev/null +++ b/src/conf/ucm/rt5651/IN3-HeadsetMic.conf @@ -0,0 +1,28 @@ +SectionDevice."HeadsetMic-IN3" { + Comment "Headset Microphone" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "InternalMic-IN12" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headset Mic Switch' on" + cset "name='RECMIXL BST3 Switch' on" + cset "name='RECMIXR BST3 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headset Mic Switch' off" + cset "name='RECMIXL BST3 Switch' off" + cset "name='RECMIXR BST3 Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am index 8a22159c..abd45ad7 100644 --- a/src/conf/ucm/rt5651/Makefile.am +++ b/src/conf/ucm/rt5651/Makefile.am @@ -1,4 +1,6 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ ucmdir = $(alsaconfigdir)/ucm/rt5651 -ucm_DATA = EnableSeq.conf +ucm_DATA = EnableSeq.conf HeadPhones.conf IN1-InternalMic.conf \ + IN2-InternalMic.conf IN12-InternalMic.conf IN3-HeadsetMic.conf \ + Speaker.conf EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/Speaker.conf new file mode 100644 index 00000000..44168cc5 --- /dev/null +++ b/src/conf/ucm/rt5651/Speaker.conf @@ -0,0 +1,30 @@ +SectionDevice."Speaker" { + Comment "Speakers" + + ConflictingDevice [ + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Speaker Switch' on" + cset "name='LOUT L Playback Switch' on" + cset "name='LOUT R Playback Switch' on" + # Done after turning the speaker on to keep the bias and clk on + cset "name='Headphone Switch' off" + cset "name='HPO L Playback Switch' off" + cset "name='HPO R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # This is done by the Headphones EnableSequence, so that the + # Platform Clock and BIAS do not temporarily get turned off + # as that breaks audio-streams which are playing when + # switching between Speaker/Headphone + ] + + Value { + PlaybackChannels "2" + } +}