From patchwork Sat Oct 21 21:16:13 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: 13431589 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 3AF77C001E0 for ; Sat, 21 Oct 2023 21:19:40 +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 2F8EF84D; Sat, 21 Oct 2023 23:18:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2F8EF84D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697923178; bh=8KHUNXQNTO2jTbS7+MfwuYiItYo74A+/0h4X0owalS4=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Ed4nLst93yixtGpOi3iPZK1DH0JWpfdj+/xj4jL1JGJT3g0W/+UuYd1M6PQqlW9n2 dVSwfwFSjS7sFvwVQ+41DPTtgZGKjBVLTEw4BmsGFjJ2qAgjG1JCQvna6saI7MJOoz Rq0n1FGWibEA9tViA7zv808LgzZ3Ah0uY1m1cBFg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B4EB5F8059F; Sat, 21 Oct 2023 23:17:35 +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 C0038F80589; Sat, 21 Oct 2023 23:17:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AECD4F80552; Sat, 21 Oct 2023 23:16:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 D624EF800C9 for ; Sat, 21 Oct 2023 23:16:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D624EF800C9 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=VoCmcDyI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697922987; 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; bh=QRC6Mj4jjk2r1y7jzJuxamy8oam/0O+V83hwFKZBZy8=; b=VoCmcDyIHnzmduBsF3ChhmwtPwv0DmHR8mbR0dXXKQ+Yu/QzhE2cLouBKWmujzc0P7+YWv 1SHJj2nDQbDAIle8HlPwqnbzI2v4CgklAT2HvjQ+B+FO82WrfOoX5LyfX86AJfeOlc5G5d POrJ5NWm5IaB4sN5TES1szlkeSqTssQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-6IpKpkU6MqOyAIkkDxAG6g-1; Sat, 21 Oct 2023 17:16:24 -0400 X-MC-Unique: 6IpKpkU6MqOyAIkkDxAG6g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD043857F8C; Sat, 21 Oct 2023 21:16:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id B008D492BD9; Sat, 21 Oct 2023 21:16:22 +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 1/2] bytcr-wm5102: Add support for speakers connected to HPOUT2 Date: Sat, 21 Oct 2023 23:16:13 +0200 Message-ID: <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: 2IM4QMHEGHAIQLR7WM54XEDUNMJC2JVU X-Message-ID-Hash: 2IM4QMHEGHAIQLR7WM54XEDUNMJC2JVU 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: On the Lenovo Yoga Tab 3 YT3-X90 the speaker amplifiers are connected to the HPOUT2 output pins instead of the the SPK output pins. Check for "cfg-spk:hpout2" in the components string which indicates this setup and add a ucm2/codecs/wm5102/HPOut2-Speaker.conf file for this setup. Signed-off-by: Hans de Goede --- ucm2/Intel/bytcr-wm5102/HiFi.conf | 11 ++++++++++- ucm2/codecs/wm5102/EnableSeq.conf | 2 ++ ucm2/codecs/wm5102/HPOut2-Speaker.conf | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ucm2/codecs/wm5102/HPOut2-Speaker.conf diff --git a/ucm2/Intel/bytcr-wm5102/HiFi.conf b/ucm2/Intel/bytcr-wm5102/HiFi.conf index 1269868..2afc757 100644 --- a/ucm2/Intel/bytcr-wm5102/HiFi.conf +++ b/ucm2/Intel/bytcr-wm5102/HiFi.conf @@ -21,7 +21,16 @@ SectionVerb { } } -Include.spk.File "/codecs/wm5102/Speaker.conf" +If.spk { + Condition { + Type String + Haystack "${CardComponents}" + Needle "cfg-spk:hpout2" + } + True.Include.hpout2.File "/codecs/wm5102/HPOut2-Speaker.conf" + False.Include.spk.File "/codecs/wm5102/Speaker.conf" +} + Include.hp.File "/codecs/wm5102/HeadPhones.conf" Include.mic.File "/codecs/wm5102/IN3-InternalMic.conf" Include.headset.File "/codecs/wm5102/IN1-HeadsetMic.conf" diff --git a/ucm2/codecs/wm5102/EnableSeq.conf b/ucm2/codecs/wm5102/EnableSeq.conf index 6a857a2..87cb3bb 100644 --- a/ucm2/codecs/wm5102/EnableSeq.conf +++ b/ucm2/codecs/wm5102/EnableSeq.conf @@ -4,6 +4,8 @@ EnableSequence [ cset "name='SPKOUTR Input 1' AIF1RX2" cset "name='HPOUT1L Input 1' AIF1RX1" cset "name='HPOUT1R Input 1' AIF1RX2" + cset "name='HPOUT2L Input 1' AIF1RX1" + cset "name='HPOUT2R Input 1' AIF1RX2" # Both mics are quite soft by default, boost then cset "name='IN1L Volume' 28" diff --git a/ucm2/codecs/wm5102/HPOut2-Speaker.conf b/ucm2/codecs/wm5102/HPOut2-Speaker.conf new file mode 100644 index 0000000..375f9ba --- /dev/null +++ b/ucm2/codecs/wm5102/HPOut2-Speaker.conf @@ -0,0 +1,22 @@ +SectionDevice."Speaker" { + Comment "Speakers" + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId}" + } + + ConflictingDevice [ + "Headphones" + ] + + EnableSequence [ + cset "name='HPOUT2 Digital Switch' on" + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cset "name='HPOUT2 Digital Switch' off" + cset "name='Speaker Switch' off" + ] +} 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: 13431590 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" + } +}