alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>, Hans de Goede <hdegoede@redhat.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 09/14] conf/ucm: bytcr-rt5651: Add support for mic input on various pins
Date: Fri, 20 Jul 2018 09:27:36 +0200	[thread overview]
Message-ID: <20180720072741.4632-10-hdegoede@redhat.com> (raw)
In-Reply-To: <20180720072741.4632-1-hdegoede@redhat.com>

Note this commit replaces the pre-existing "Handset Microphone" and
"Main Microphone" options, these come from the first commit of the
bytcr-rt5651 UCM profile and were based on wrong assumptions about the
input mappings. None of the existing devices has the Hand/Headset mic
on IN1 as these options assumed.

The rt5651 is used in various configurations with the Internal Mic(s)
hooked up to IN1, IN2, or to IN1 and IN2 and the Headset Mic hooked up
to IN3.

Add support for all these to the generic bytcr-rt5651 profile and name
them accotding to their input + functions.

A follow up commit will add specialized longname configs which
will only expose the inputs actually used on the board with that
longname.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/HiFi.conf | 93 +++++++++++++++++++++++++----
 1 file changed, 82 insertions(+), 11 deletions(-)

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index fd878f4a..54c365d9 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -85,51 +85,91 @@ SectionDevice."Speaker" {
 	}
 }
 
-SectionDevice."Handset" {
-	Comment "Handset Microphone"
+SectionDevice."InternalMic-IN1" {
+	Comment "Internal Microphone on IN1"
 
 	ConflictingDevice [
-		"Mainmic"
+		"InternalMic-IN2"
+		"InternalMic-IN12"
+		"HeadsetMic-IN3"
 	]
 
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo Handset Microphone enable sequence"
+		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 Handset Microphone disable sequence"
+		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"
-		JackControl "Headset Mic Jack"
 	}
 }
 
+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"
+	]
 
-SectionDevice."Mainmic" {
-	Comment "Main Microphone"
+	Value {
+		CaptureChannels "2"
+	}
+}
+
+SectionDevice."InternalMic-IN12" {
+	Comment "Internal Microphones on IN1 and IN2"
 
 	ConflictingDevice [
-		"Handset"
+		"InternalMic-IN1"
+		"InternalMic-IN2"
+		"HeadsetMic-IN3"
 	]
 
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo Main Microphone enable sequence"
+		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 Main Microphone disable sequence"
+		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"
 	]
@@ -138,3 +178,34 @@ SectionDevice."Mainmic" {
 		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"
+	}
+}
-- 
2.17.1

  parent reply	other threads:[~2018-07-20  7:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
2018-07-20  7:27 ` [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
2018-07-20  7:27 ` [PATCH 02/14] conf/ucm: bytcr-rt5651: Add support for boards using SSP0 Hans de Goede
2018-07-20  7:27 ` [PATCH 03/14] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
2018-07-20  7:27 ` [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
2018-07-20 13:48   ` Pierre-Louis Bossart
2018-08-08  9:02     ` Hans de Goede
2018-07-20  7:27 ` [PATCH 05/14] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
2018-07-20  7:27 ` [PATCH 06/14] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
2018-07-20  7:27 ` [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence Hans de Goede
2018-07-20 13:49   ` Pierre-Louis Bossart
2018-08-08  9:03     ` Hans de Goede
2018-07-20  7:27 ` [PATCH 08/14] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
2018-07-20  7:27 ` Hans de Goede [this message]
2018-07-20  7:27 ` [PATCH 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
2018-07-20  7:27 ` [PATCH 11/14] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
2018-07-20  7:27 ` [PATCH 12/14] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
2018-07-20  7:27 ` [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
2018-07-20  7:27 ` [PATCH 14/14] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
2018-07-20 13:51 ` [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Pierre-Louis Bossart
2018-07-22  8:52   ` Takashi Iwai
2018-08-05 16:46     ` Takashi Iwai
2018-08-06  7:41       ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180720072741.4632-10-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).