From nobody Sat Sep 21 17:06:54 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BBE6ECAAD8 for ; Fri, 23 Sep 2022 00:00:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiIWAAT (ORCPT ); Thu, 22 Sep 2022 20:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbiIWAAF (ORCPT ); Thu, 22 Sep 2022 20:00:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5C8929801 for ; Thu, 22 Sep 2022 17:00:04 -0700 (PDT) Received: from notapiano.myfiosgateway.com (unknown [71.190.76.4]) (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) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 183BE6602237; Fri, 23 Sep 2022 01:00:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663891203; bh=/6IQ3lHwKEL60Rke+bM3N44arsfrjzRsLk9Ih45RYHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z97+6eZUDhyTF8wOugnqu9/fwFiMAAjbjL1nrdS6wzEodSgubZyuwkD7ui4mSJQgu J2GN7Ww7qOAztzf1Zsk/RgYeI6rLvvwTC2MWJVD6RIKyjiXw6R0Oxva5S1CmBw62/u 8uwt4znb2ftflJRn0zUYHjgLigjPlcDHtt4fwLQjpBfQ5+k6mZ6Lo02o/JS9zQPeCF w0nnrGBJ/xUGUr/OwLuyWLNFgk3WxNTu9G7vcSD85anyAnTX+Z+/BIxZkATVMgubaV rEXg61vZYCCpLJMOR113J7RrTeLMiiCuoZrkuKn46ABsnlviaXesAJcZHhSD9MCtY3 LqXL0gbRoD8gg== From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Mark Brown Cc: AngeloGioacchino Del Regno , kernel@collabora.com, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Jaroslav Kysela , Jiaxin Yu , Liam Girdwood , Matthias Brugger , Takashi Iwai , alsa-devel@alsa-project.org, "chunxu.li" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/6] ASoC: mediatek: mt8186-da7219: Add headset widgets with switches Date: Thu, 22 Sep 2022 19:59:48 -0400 Message-Id: <20220922235951.252532-4-nfraprado@collabora.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220922235951.252532-1-nfraprado@collabora.com> References: <20220922235951.252532-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add DAPM widgets for headphones and headset microphone, with matching switches, to allow toggling these paths based on the jack connection status. Note that differently from others (mt8192, mt8195 and mt8186-rt5682), the widget here is named "Headphones" (with an 's'), since "Headphone Switch" was already registered by da7219. Signed-off-by: N=C3=ADcolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/so= und/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c index 6f93f9dd4623..8d428bc4a3b2 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c @@ -950,6 +950,8 @@ static struct snd_soc_dai_link mt8186_mt6366_da7219_max= 98357_dai_links[] =3D { static const struct snd_soc_dapm_widget mt8186_mt6366_da7219_max98357_widgets[] =3D { SND_SOC_DAPM_SPK("Speakers", NULL), + SND_SOC_DAPM_HP("Headphones", NULL), + SND_SOC_DAPM_MIC("Headset Mic", 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), @@ -961,6 +963,10 @@ static const struct snd_soc_dapm_route mt8186_mt6366_da7219_max98357_routes[] =3D { /* SPK */ { "Speakers", NULL, "Speaker"}, + /* Headset */ + { "Headphones", NULL, "HPL" }, + { "Headphones", NULL, "HPR" }, + { "MIC", NULL, "Headset Mic" }, /* HDMI */ { "HDMI1", NULL, "TX"}, /* SOF Uplink */ @@ -976,6 +982,8 @@ mt8186_mt6366_da7219_max98357_routes[] =3D { static const struct snd_kcontrol_new mt8186_mt6366_da7219_max98357_controls[] =3D { SOC_DAPM_PIN_SWITCH("Speakers"), + SOC_DAPM_PIN_SWITCH("Headphones"), + SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("HDMI1"), }; =20 --=20 2.37.3