From patchwork Sat Oct 21 21:16:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 736696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F082EC0032E for ; Sat, 21 Oct 2023 21:20:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 81EA3868; Sat, 21 Oct 2023 23:19:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 81EA3868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697923200; bh=+pNMnpzWGGHTQuKIvYKjrfTVwdqNerVSRiSh1iXZQkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=UlnWa3I/lenrio1QYc1MMbZHaA90QViSjP4onnh/m0pj0OgCqewdZb/vMwXunftLV CrKQZSWJnYZIrpEHpbzCzlVKFVQ/X9zZ/hs0W9QH+YGy7hLuFzN0xwm1wt0rUmkzwp P6TAo8M7936uTPq1f1PiGU9QBG+GVRuBoWvpsSb4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D37A3F805B4; Sat, 21 Oct 2023 23:17:36 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4722CF805AC; Sat, 21 Oct 2023 23:17:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93F31F80536; Sat, 21 Oct 2023 23:16:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 10128F8024E for ; Sat, 21 Oct 2023 23:16:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 10128F8024E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WAYPAqmk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697922990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sYIcrz+NKRCM2GaEfcfFX8xws03XcisOZo0WIBAaPg0=; b=WAYPAqmkCHRt6ZgW7Y2n7SBv5OxUZ7MkBKOt45gtKLrUXitkse1IEMUwVxf/nBEx57KzCT qYHrU+gKvrLBnckMYkvEcteXDgD3p9sILO+YQvDlKhGwk3JCp9g1E8zIqirwi7wdAjTDM3 ywTwC9waTPDyNO5b6HFGSpDhieoxqG0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-490-hhC0UEjfNoKps3K_gg_n7Q-1; Sat, 21 Oct 2023 17:16:25 -0400 X-MC-Unique: hhC0UEjfNoKps3K_gg_n7Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B73783804073; Sat, 21 Oct 2023 21:16:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEA8B492BD9; Sat, 21 Oct 2023 21:16:23 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Cc: Pierre-Louis Bossart , Bard Liao , alsa-devel@alsa-project.org, Hans de Goede Subject: [PATCH alsa-ucm-conf 2/2] bytcr-wm5102: Add support for different microphone routes Date: Sat, 21 Oct 2023 23:16:14 +0200 Message-ID: <20231021211614.115152-2-hdegoede@redhat.com> In-Reply-To: <20231021211614.115152-1-hdegoede@redhat.com> References: <20231021211614.115152-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: LJSAXVZOW55X3N53SHYWQMCHNU2UKQH4 X-Message-ID-Hash: LJSAXVZOW55X3N53SHYWQMCHNU2UKQH4 X-MailFrom: hdegoede@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Unlike all designs supported sofar the Lenovo Yoga Tab 3 YT3-X90 does not have its internal microphone (intmic) on IN3L with the headset microphone on IN1L. Instead this tablet has the intmic on IN1L and the hsmic on IN2L. Add IN1-InternalMic.conf and IN2-HeadsetMic.conf config snippets under ucm2/codecs/wm5102/ for this and check the components string to determine which microphone routes should be used. Signed-off-by: Hans de Goede --- ucm2/Intel/bytcr-wm5102/HiFi.conf | 22 ++++++++++++++++++++-- ucm2/codecs/wm5102/EnableSeq.conf | 3 ++- ucm2/codecs/wm5102/IN1-InternalMic.conf | 23 +++++++++++++++++++++++ ucm2/codecs/wm5102/IN2-HeadsetMic.conf | 24 ++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 ucm2/codecs/wm5102/IN1-InternalMic.conf create mode 100644 ucm2/codecs/wm5102/IN2-HeadsetMic.conf diff --git a/ucm2/Intel/bytcr-wm5102/HiFi.conf b/ucm2/Intel/bytcr-wm5102/HiFi.conf index 2afc757..46ef7d1 100644 --- a/ucm2/Intel/bytcr-wm5102/HiFi.conf +++ b/ucm2/Intel/bytcr-wm5102/HiFi.conf @@ -32,5 +32,23 @@ If.spk { } Include.hp.File "/codecs/wm5102/HeadPhones.conf" -Include.mic.File "/codecs/wm5102/IN3-InternalMic.conf" -Include.headset.File "/codecs/wm5102/IN1-HeadsetMic.conf" + +If.intmic { + Condition { + Type String + Haystack "${CardComponents}" + Needle "cfg-intmic:in1l" + } + True.Include.intmic1.File "/codecs/wm5102/IN1-InternalMic.conf" + False.Include.intmic3.File "/codecs/wm5102/IN3-InternalMic.conf" +} + +If.hsmic { + Condition { + Type String + Haystack "${CardComponents}" + Needle "cfg-hsmic:in2l" + } + True.Include.hsmic2.File "/codecs/wm5102/IN2-HeadsetMic.conf" + False.Include.hsmic1.File "/codecs/wm5102/IN1-HeadsetMic.conf" +} diff --git a/ucm2/codecs/wm5102/EnableSeq.conf b/ucm2/codecs/wm5102/EnableSeq.conf index 87cb3bb..11166c0 100644 --- a/ucm2/codecs/wm5102/EnableSeq.conf +++ b/ucm2/codecs/wm5102/EnableSeq.conf @@ -7,8 +7,9 @@ EnableSequence [ cset "name='HPOUT2L Input 1' AIF1RX1" cset "name='HPOUT2R Input 1' AIF1RX2" - # Both mics are quite soft by default, boost then + # mics are quite soft by default, boost then cset "name='IN1L Volume' 28" + cset "name='IN2L Volume' 28" cset "name='IN3L Volume' 28" cset "name='Headphone Switch' off" diff --git a/ucm2/codecs/wm5102/IN1-InternalMic.conf b/ucm2/codecs/wm5102/IN1-InternalMic.conf new file mode 100644 index 0000000..d9a70ce --- /dev/null +++ b/ucm2/codecs/wm5102/IN1-InternalMic.conf @@ -0,0 +1,23 @@ +SectionDevice."Mic" { + Comment "Internal Microphone" + + ConflictingDevice [ + "Headset" + ] + + EnableSequence [ + cset "name='AIF1TX1 Input 1' IN1L" + cset "name='AIF1TX2 Input 1' IN1L" + + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cset "name='Internal Mic Switch' off" + ] + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId}" + } +} diff --git a/ucm2/codecs/wm5102/IN2-HeadsetMic.conf b/ucm2/codecs/wm5102/IN2-HeadsetMic.conf new file mode 100644 index 0000000..8fbbcb1 --- /dev/null +++ b/ucm2/codecs/wm5102/IN2-HeadsetMic.conf @@ -0,0 +1,24 @@ +SectionDevice."Headset" { + Comment "Headset Microphone" + + ConflictingDevice [ + "Mic" + ] + + EnableSequence [ + cset "name='AIF1TX1 Input 1' IN2L" + cset "name='AIF1TX2 Input 1' IN2L" + + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cset "name='Headset Mic Switch' off" + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId}" + JackControl "Headset Mic Jack" + } +}