From patchwork Wed Aug 2 17:57:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 130052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp650539vqx; Wed, 2 Aug 2023 11:33:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPEqCR97GWRzNApjiuBLmrcYUqR8dme8gVfC9mHm3qiTlndV7bQ0eyOLdgPgYQ8UydKXIt X-Received: by 2002:a05:6a20:4285:b0:13e:fe55:b99f with SMTP id o5-20020a056a20428500b0013efe55b99fmr2537481pzj.56.1691001222413; Wed, 02 Aug 2023 11:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691001222; cv=none; d=google.com; s=arc-20160816; b=CPhm0i2q6XLpRcHfWMYANeUbilQmRVqkt8l+gm3E8o9VOAVZp/ctXi7suIxYpPHEBe UBR+4S/i3zWLfUwdPswO/nCvLiTwhHTEu6wPZpVWkCzEjXzfQ7QZ7o6+0sNSXqCRFWqB Cs7mherHHDw+gSMFKTVlyUSefG3Yv4XCgxxkU+QntotPX9wu5z79Br501182giF9mGSs kA8pQkzwpQR4Yo7jH86aomEMXPU9Xh7mqehpBG2PlN5PTuIqiUacDiW47FVanaqE/jxg w8NRIOgci5LlCm7yx/UGX276dM2FrmEmFfTshwnBtIJy4VRAaXPqK1gs/dJ2R2zOOALA vscw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XyXZmbrejVy6oU7P85KygnAFUmokjdS7T3od5TZzPV0=; fh=GUNhzEJfka7aU6InG/mqeUgtNKAejFmk0vy+CY7S+VM=; b=YRVfqX/yHwSSujBtfPkJC2ilxJOdufHu2uGq+FqMTzZ8SiUqZVmnB47Fp7t0083Ypu EFZJW0sFHC3Wsak8NdiavSWoI7GEEJQeJA4Z+yNMDTSwv8ua9XZzMazpOgj/4zSubbVQ yE418sCGMzIAdI8ePSkRPU/MjbUDtyjyohgSu+jhvA8EKi93XYmht8iKKprB1JQEAzAf AMjEmgE7mZtr1QfqxA2wgIef3NSctk6DxnT7hr6lv9iwiqcuClTSr+98rpCySCFU9twm CUz0m3QCgCACnphFkTFK20UhTzo/7YJii58It+qyArIs5UNmwEiTXCXK1OsTuym9S+tQ JnCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=o61PY30O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b0055baed7e7e6si66774pgb.251.2023.08.02.11.33.28; Wed, 02 Aug 2023 11:33:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=o61PY30O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234388AbjHBR7g (ORCPT + 99 others); Wed, 2 Aug 2023 13:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234266AbjHBR65 (ORCPT ); Wed, 2 Aug 2023 13:58:57 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 016C51734 for ; Wed, 2 Aug 2023 10:58:31 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fbf1b82d9cso1210925e9.2 for ; Wed, 02 Aug 2023 10:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690999110; x=1691603910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XyXZmbrejVy6oU7P85KygnAFUmokjdS7T3od5TZzPV0=; b=o61PY30OWJEqIsIJbqjC2wEfrFt++nmLh2bc7nDkGL4MxB0bYYDOddvwOSTvGgO9/1 RHnKe82BAvOY83+5Xd7YOx6OdqDvUJ9VfsRQaxg410gY6M8Z1JzmF12gvrgEX+EXNG9i Bwn0OqH9bVANcCIpVEZci0Iki55/dZZrXWhvR3962AXTLoDu8IV6Cgx415uAlEIIhQxX P1ta1eLDdskcspu7cWdvn25AoQdd7Ot8Vb4AsPGUfqe40RI/3U7vpm2361KN1PXfCLP2 lKV9u/gO3uLo2KNITq31zmI+fiqfmVrYKpoaPaqovx35yulDGwhwI9Psm2w6ScUR+/1x Kk3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690999110; x=1691603910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XyXZmbrejVy6oU7P85KygnAFUmokjdS7T3od5TZzPV0=; b=KCNqpkArp509rrV5TknS3GF/J9tCMgpmoerL9UoViiLJ/aUB/x5y6fa+EK89weaqnf mscITwZVe21Kv+q5z82Txy7a48hQ/4hSPRhMBYuHdszG+mmW8umfggPMHLHhCNhZBFzb nhnBdwkAYa2pkbyRvJUhdfFBur01dVxhIxfWkWa9yKTK3lgVNrcuWKLOZNyoEYFzu7gk HaYJKowZCH0MDcCnIba1vA4QOGGlRX9g8PWg2Jxo0XKPIY885jpVG0LUulS/27JOh7a4 vNPmhcD1ZPZkGJLfzfgGPO323VZW7XtuAe4ctQKNdRTm7tAY2o4ox2Fg1NCsGqVxH7vg Cqig== X-Gm-Message-State: ABy/qLadoa5sxpJesGWGwixnLPQI/Sv1EPefJ4mnlqak8TpBLKaV87PR VohUuE2t2irOPi/V4rbDLpM= X-Received: by 2002:a1c:7714:0:b0:3fb:be7c:d58a with SMTP id t20-20020a1c7714000000b003fbbe7cd58amr4909567wmi.26.1690999109889; Wed, 02 Aug 2023 10:58:29 -0700 (PDT) Received: from ALPER-PC.. ([178.233.24.1]) by smtp.gmail.com with ESMTPSA id l23-20020a7bc457000000b003fe20db88ebsm2192439wmi.31.2023.08.02.10.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 10:58:29 -0700 (PDT) From: Alper Nebi Yasak To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Alper Nebi Yasak , Mark Brown , Liam Girdwood , Takashi Iwai , AngeloGioacchino Del Regno , Jaroslav Kysela , linux-kernel@vger.kernel.org, Akihiko Odaki , Pierre-Louis Bossart , Matthias Brugger , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= Subject: [PATCH 18/27] ASoC: mediatek: mt8186-mt6366-da7219-max98357: Map missing jack kcontrols Date: Wed, 2 Aug 2023 20:57:28 +0300 Message-Id: <20230802175737.263412-19-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230802175737.263412-1-alpernebiyasak@gmail.com> References: <20230802175737.263412-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773143297567387674 X-GMAIL-MSGID: 1773143297567387674 Commit 8e9867486806 ("ASoC: mediatek: mt8186-da7219: Expose individual headset jack pins") maps kcontrols for Headphone and Headset Mic jacks for this driver so that PulseAudio and PipeWire can handle jack detection events for these peripherals. The DA7219 codec used here can also distinguish between Headphone and Line Out connections that go into the same physical port. Expose the latter to userspace as a kcontrol as well and add the necessary widgets. Signed-off-by: Alper Nebi Yasak --- sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c index 0432f9d89020..aa8e00bba19b 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c @@ -46,6 +46,10 @@ static struct snd_soc_jack_pin mt8186_jack_pins[] = { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, }, + { + .pin = "Line Out", + .mask = SND_JACK_LINEOUT, + }, }; static struct snd_soc_codec_conf mt8186_mt6366_da7219_max98357_codec_conf[] = { @@ -964,6 +968,7 @@ mt8186_mt6366_da7219_max98357_widgets[] = { SND_SOC_DAPM_SPK("Speakers", NULL), SND_SOC_DAPM_HP("Headphones", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_LINE("Line Out", NULL), SND_SOC_DAPM_OUTPUT("HDMI1"), SND_SOC_DAPM_MIXER(SOF_DMA_DL1, SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0), @@ -996,6 +1001,7 @@ mt8186_mt6366_da7219_max98357_controls[] = { SOC_DAPM_PIN_SWITCH("Speakers"), SOC_DAPM_PIN_SWITCH("Headphones"), SOC_DAPM_PIN_SWITCH("Headset Mic"), + SOC_DAPM_PIN_SWITCH("Line Out"), SOC_DAPM_PIN_SWITCH("HDMI1"), };