From patchwork Fri Jul 10 05:25:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11655701 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10A4C13B4 for ; Fri, 10 Jul 2020 05:28:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 989CD20720 for ; Fri, 10 Jul 2020 05:28:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="f0MYh6OW"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="CNGVSJ/w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 989CD20720 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2C6061669; Fri, 10 Jul 2020 07:27:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2C6061669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594358883; bh=P2/4doVFwZYtfy2p7HkahOZXUbpYZUR1eNTwZUSvM6o=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=f0MYh6OWO9gdmLvDu5bhaypIJL4a0Y+wiFIXyUMcNM6nIYz//obw3lnA2FWQTyYEU PQHJX3K75zgz4mOi9yP7VqZj+hKJF50BHwQzqj3I6a43foa9tZc4VmUbIw8fcT3ySb RADErngMpTKSOs07FmXStsKy519Jq7Ngke/+pIRA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 81491F802A0; Fri, 10 Jul 2020 07:25:41 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0C33BF8015C; Fri, 10 Jul 2020 07:25:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 74A76F80150 for ; Fri, 10 Jul 2020 07:25:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 74A76F80150 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CNGVSJ/w" Received: by mail-pf1-x44a.google.com with SMTP id g85so2925268pfb.11 for ; Thu, 09 Jul 2020 22:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Y3EnggORWF57ZGrCyAOh8m6NEpj3i0woYDKiuIiNxkM=; b=CNGVSJ/w2CjjKVrEYvQCv4OOefV+Hd1i3GxaKDWstjvFqwC2HnTNtl0+7zDdhc/KJm OE17u3CuJ5Ezxcznzbr/ocM8CDKE5N/1c/XmO48OP+zGI1YzFe2jKzZYW/TihiOhr/6h crnexX0iC8SQ2FS4OWLkf7MlSWjddZDZ31NDz2sGywrqCdAxvoy47S+ztfcpzr//DlOi Zv1oUq1obOyVQv0eqUFDa/5Nxd5xGX5h0YClMJ4MlOODK3yGRoVPrdINUb9mgdxnSSfQ SUmy8Yc1LWLuKfy0XzJdAlPk7L2VdwXqGx/2Ysrd4w58N+2n/8gyf5aUWAJgEigafIJM g7Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Y3EnggORWF57ZGrCyAOh8m6NEpj3i0woYDKiuIiNxkM=; b=uFmtbjGSQTLsc77BDMc1BTw5fP2AcrE8abUGEJV/4+Mjf1Csw3Gma7M2qhJRbmGABi uC/q3dqSDAc0OCuD/OjGHmAxhb9fPKiEi8uHAh2DoSD/trwNRDPRAmfCroLOHM65Br2e u9AFRh1w+poD09psMZllO5frZoq4ZVxmqtK6M4zv/v7YMgcolhX4IUwU/Q4eG4K2MgYG smuGi6+nnDxSqjKnbeta8KtLhURZnGW2CQqUS4PrI4pZu3jM9dWHNDt2OO1Ou3YB845W 867kg/r04pEvjV+SYYdHU/reIzLRDzzOrj9UlMG+WhQKdsk93yvF3kzN/8s79CS4s66N fTcA== X-Gm-Message-State: AOAM531Y+0505PgsHeNXsZHupeggUFcP6oZDekpjl0xksBIzsrLyJLsj sHgw1P2FC3J4jXStOyhqxKXOdJLw4xgC X-Google-Smtp-Source: ABdhPJx7Q4sBEZvytM2P7Fdfv06kQBXfBYR8li9S1VV5buJUiQWhcdM4KNipGKo3SyEuxPkBzRNSi0NV3qOW X-Received: by 2002:a17:902:b287:: with SMTP id u7mr47682560plr.107.1594358717464; Thu, 09 Jul 2020 22:25:17 -0700 (PDT) Date: Fri, 10 Jul 2020 13:25:00 +0800 In-Reply-To: <20200710052505.3664118-1-tzungbi@google.com> Message-Id: <20200710052505.3664118-2-tzungbi@google.com> Mime-Version: 1.0 References: <20200710052505.3664118-1-tzungbi@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 1/6] ASoC: dt-bindings: mt8183: add a property "mediatek, hdmi-codec" From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Rob Herring , tzungbi@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Adds an optional property "mediatek,hdmi-codec". Acked-by: Rob Herring Signed-off-by: Tzung-Bi Shih --- .../bindings/sound/mt8183-mt6358-ts3a227-max98357.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt8183-mt6358-ts3a227-max98357.txt b/Documentation/devicetree/bindings/sound/mt8183-mt6358-ts3a227-max98357.txt index 5afd3d8dab84..5e455129eb96 100644 --- a/Documentation/devicetree/bindings/sound/mt8183-mt6358-ts3a227-max98357.txt +++ b/Documentation/devicetree/bindings/sound/mt8183-mt6358-ts3a227-max98357.txt @@ -9,6 +9,7 @@ Optional properties: - mediatek,headset-codec: the phandles of ts3a227 codecs - mediatek,ec-codec: the phandle of EC codecs. See google,cros-ec-codec.txt for more details. +- mediatek,hdmi-codec: the phandles of HDMI codec Example: @@ -16,6 +17,7 @@ Example: compatible = "mediatek,mt8183_mt6358_ts3a227_max98357"; mediatek,headset-codec = <&ts3a227>; mediatek,ec-codec = <&ec_codec>; + mediatek,hdmi-codec = <&it6505dptx>; mediatek,platform = <&afe>; }; From patchwork Fri Jul 10 05:25:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11655697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF40413BD for ; Fri, 10 Jul 2020 05:27:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5575B20720 for ; Fri, 10 Jul 2020 05:27:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="nVep4OXg"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="BKscopTz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5575B20720 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CEE5C165D; Fri, 10 Jul 2020 07:26:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEE5C165D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594358834; bh=2UqRbmC/xGW5fDKLDLFVu+Z5aurK6jXm2JakoKJIyEM=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nVep4OXgSK6700HtRygiHaJQf3Wb/0QBwms+HjUuNqalWwDQfu9bB85NRRkE74Cxw nSDuySXo02a33Jm6lh8XZH4sfNMEE/qoCzKaUgDjK05auXTpiLs3j62mMV7n9wm04S uqLIiIv/3b4FUX+xH6lejEo4MZZMip2PX5PPRKuk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 40434F80258; Fri, 10 Jul 2020 07:25:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D49BBF8015C; Fri, 10 Jul 2020 07:25:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B37E3F80112 for ; Fri, 10 Jul 2020 07:25:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B37E3F80112 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BKscopTz" Received: by mail-yb1-xb49.google.com with SMTP id w35so5781327ybi.16 for ; Thu, 09 Jul 2020 22:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=waFmwNjvn8zrzF+MflfsEtX07GKV6zTcqXH2BQIDo6I=; b=BKscopTznRI/6PlxNEk0SE0fxVRhoo+fn7dYCuemGdOZIADZEwhPo+ULx0QJjgfT+7 +PpgH+n/5j3YZS63+Z1hnzoLJIPmPncek9CugDTRvHQ23oS3U5GCn6/elW1K2CnAzUtE Ud4kLm8bieJUsuWXMAKjtzaRMe2DKNe6dkj/hIPYueVn74t5rH+wd0V5VmrhoO4SCVQ7 TveVFJ9J1ykqLXcMNWycZAYCDgE07/HDR0qsBhiwTJPekKdVw+aiiIfFimfAzgA4TUwp cNS3YrzX1BVIz4dqspdVMhiPFxB5jkBoDBDQ3BBS01WiPB/1O5eds/f/ZGZMOar1Tz+4 W6Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=waFmwNjvn8zrzF+MflfsEtX07GKV6zTcqXH2BQIDo6I=; b=JGsxDPuwxSE3HGWoW/amltp3wMfk5PAOYeb7/5enHufujlRR3hLBTFn5le5Hs+1T42 HKZcna58rzCDDcg0ZGpZzpfMFy78Gey9KNUKl5OdFOsjtQZm+Td4awB15/kN8/N0YLgJ DGNr8NSHcD2Av49Zdtm5ohCp0C5JMY61ic/c3kIXob+pESZ+ngTkWamh+y6zk8/KbjF5 MSaZBWGv9z/Wgz9w9xZuTgccl1qkRGAE0p7kTsIPafs1Yk260xs7nZaCRRouXurEQwfe uCyddO4EXI13+AoElWVR4urB/0L73qGrHsr5+gT56yh6M64rBDP42Dax/UsVaS2f90rC SMyA== X-Gm-Message-State: AOAM531tPeuPOl9BnKeFclxgp9yzqiflA+XTITqkFsCOBStep39sfpXu qelF7315A5QEIdegm+PCm99hnZKuQuoj X-Google-Smtp-Source: ABdhPJwP7e8k+tjpxgJCNtpdCpHvOKoiQ2NdP3VBQyiLvLA0NAeFA8ZUuQe5WMXbfnvgbYoF7V2Yrys14mtZ X-Received: by 2002:a25:abd0:: with SMTP id v74mr23431860ybi.222.1594358721171; Thu, 09 Jul 2020 22:25:21 -0700 (PDT) Date: Fri, 10 Jul 2020 13:25:01 +0800 In-Reply-To: <20200710052505.3664118-1-tzungbi@google.com> Message-Id: <20200710052505.3664118-3-tzungbi@google.com> Mime-Version: 1.0 References: <20200710052505.3664118-1-tzungbi@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 2/6] ASoC: mediatek: mt8183: use hdmi-codec From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, tzungbi@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Adds DAI link to use hdmi-codec. Signed-off-by: Tzung-Bi Shih --- .../soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index 964f2f821782..c375e9f91a34 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -258,7 +258,7 @@ SND_SOC_DAILINK_DEFS(i2s5, SND_SOC_DAILINK_DEFS(tdm, DAILINK_COMP_ARRAY(COMP_CPU("TDM")), - DAILINK_COMP_ARRAY(COMP_DUMMY()), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")), DAILINK_COMP_ARRAY(COMP_EMPTY())); static int mt8183_mt6358_tdm_startup(struct snd_pcm_substream *substream) @@ -562,7 +562,7 @@ static int mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; - struct device_node *platform_node, *ec_codec; + struct device_node *platform_node, *ec_codec, *hdmi_codec; struct snd_soc_dai_link *dai_link; struct mt8183_mt6358_ts3a227_max98357_priv *priv; const struct of_device_id *match; @@ -583,6 +583,8 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) card->dev = &pdev->dev; ec_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,ec-codec", 0); + hdmi_codec = of_parse_phandle(pdev->dev.of_node, + "mediatek,hdmi-codec", 0); for_each_card_prelinks(card, i, dai_link) { if (ec_codec && strcmp(dai_link->name, "Wake on Voice") == 0) { @@ -626,6 +628,9 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) } } + if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) + dai_link->codecs->of_node = hdmi_codec; + if (!dai_link->platforms->name) dai_link->platforms->of_node = platform_node; } From patchwork Fri Jul 10 05:25:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11655705 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7051313BD for ; Fri, 10 Jul 2020 05:28:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 06AAC2076A for ; Fri, 10 Jul 2020 05:28:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="W0ky0KOm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="VWwToPDP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06AAC2076A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9039B15DC; Fri, 10 Jul 2020 07:27:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9039B15DC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594358917; bh=BAtaCAuhTuY+rglUGgeJN5y4Boy7Nrfv25Jp13fvMV4=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=W0ky0KOmyqDFFNevLVQ2RecUHeXWFN1M74wGGZLUJ3msp53pfxDVoGs4c7sH4Mltv O7eotsmvjJ+Kb7eUkgy10wqm9OgxrKzIVzbX9x8p1htyToartoTU3+jMK1DvQrQQO1 nGZQdYhgn022PuADziNFjvqQ7tjQMvMDk32WdJfg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7ABEAF802C2; Fri, 10 Jul 2020 07:25:44 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3B922F80268; Fri, 10 Jul 2020 07:25:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D38ABF8011C for ; Fri, 10 Jul 2020 07:25:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D38ABF8011C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VWwToPDP" Received: by mail-yb1-xb49.google.com with SMTP id g10so5816353ybd.0 for ; Thu, 09 Jul 2020 22:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=i2NhQTpZuhCYWTnxTi14iTiCHJsPokmxWx+SDqUiObw=; b=VWwToPDPM0rGsgdyXx/MPzUW2/SUmATrBTK/cVKkCbVOG57hyj0/7MaNB26EhSt0J8 Ime7xaCK6wahKUFxUHqAPrrf5uzNNen9Pnz5GK2LmkS84Y4xZUwN2cbHM+3fpiv1tnCR gJdrh1puHrnTOK19Aaa531xhgtHEtW/23Gdk/5RDzNWleHEv8BTC8wm/Qod2SR2ocr1g /BZb2oPsB+2USOHWcs0mFdSboheF7YB+1KrfRrwUxdDYj4P/R3T6B6g01GhtP9AnPdn2 Y5qiFKx15E/18d7prk1YpciA4Js8VqJApyoKaQTd/of3WGBmtRgm1b3rUOl9XX1E/4ye 4PXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=i2NhQTpZuhCYWTnxTi14iTiCHJsPokmxWx+SDqUiObw=; b=rivymRqNZo+qBjzx6EOfiul23OGYWoo2nackqcj4cGmHXoXc6OPDKF3a5M47MMfU8R +vV3lzUQO0A7YtupoIdULl/E/AEk+CTqCszTDmfrcazil4K6GZ2uIB1VEXD5PvpwkO6l wyCdB7Br0mHJ0v9kv/HWB9huZrZSp5SuV9BR98NLD+ZiAaXlA2uuMLhjLWhGkdNzVCeo eEefxsffwgCdGi0ZsC0RKovg9TpZ0gFFpJ6urCJ2HkWqVqdm3la2tC4unqE84chP1BDV yXD58EQnqWhfMo92XC1SyELL0nQzID4XLAb2cHTWwyIgF94XHs61ImNzxs/lAQrW9GH/ vAmA== X-Gm-Message-State: AOAM530AbmDq1JHcOYgWelKkXGfu/CBYIznwgnZDQk/XmzdSyI/ZySuq hwvBvxOVZgeVorwmOxlJVmwCCrOiNf+v X-Google-Smtp-Source: ABdhPJyxdVQdC7BceZ8J2XZQ+dXvuO4Jq88o+nRWRKXh9lYZoRE6UwV4YfwXKJyNApczRBaWatW2bG5w5N0t X-Received: by 2002:a25:cb42:: with SMTP id b63mr45668907ybg.266.1594358725304; Thu, 09 Jul 2020 22:25:25 -0700 (PDT) Date: Fri, 10 Jul 2020 13:25:02 +0800 In-Reply-To: <20200710052505.3664118-1-tzungbi@google.com> Message-Id: <20200710052505.3664118-4-tzungbi@google.com> Mime-Version: 1.0 References: <20200710052505.3664118-1-tzungbi@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 3/6] ASoC: mediatek: mt8183: support HDMI jack reporting From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, tzungbi@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Supports HDMI jack reporting. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/Kconfig | 1 + .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index 786a8d5031e4..ba120e9441d0 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -127,6 +127,7 @@ config SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A select SND_SOC_BT_SCO select SND_SOC_TS3A227E select SND_SOC_CROS_EC_CODEC if CROS_EC + select SND_SOC_HDMI_CODEC help This adds ASoC driver for Mediatek MT8183 boards with the MT6358 TS3A227E MAX98357A RT1015 audio codec. diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index c375e9f91a34..bd04c4bd309b 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,7 @@ static const char * const mt8183_pin_str[PIN_STATE_MAX] = { struct mt8183_mt6358_ts3a227_max98357_priv { struct pinctrl *pinctrl; struct pinctrl_state *pin_states[PIN_STATE_MAX]; - struct snd_soc_jack headset_jack; + struct snd_soc_jack headset_jack, hdmi_jack; }; static int mt8183_mt6358_i2s_hw_params(struct snd_pcm_substream *substream, @@ -337,6 +338,22 @@ static const struct snd_soc_ops mt8183_mt6358_ts3a227_max98357_wov_ops = { .shutdown = mt8183_mt6358_ts3a227_max98357_wov_shutdown, }; +static int +mt8183_mt6358_ts3a227_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) +{ + struct mt8183_mt6358_ts3a227_max98357_priv *priv = + snd_soc_card_get_drvdata(rtd->card); + int ret; + + ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, + &priv->hdmi_jack, NULL, 0); + if (ret) + return ret; + + return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, + &priv->hdmi_jack); +} + static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = { /* FE */ { @@ -499,6 +516,7 @@ static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = { .ignore_suspend = 1, .be_hw_params_fixup = mt8183_i2s_hw_params_fixup, .ops = &mt8183_mt6358_tdm_ops, + .init = mt8183_mt6358_ts3a227_max98357_hdmi_init, SND_SOC_DAILINK_REG(tdm), }, }; From patchwork Fri Jul 10 05:25:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11655727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 432EF13BD for ; Fri, 10 Jul 2020 05:30:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CBBBF2063A for ; Fri, 10 Jul 2020 05:30:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Kzslc/Ls"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="maYPiFAt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CBBBF2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5BDC3851; Fri, 10 Jul 2020 07:29:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5BDC3851 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594359024; bh=zGZTqxNQIgbkxp05vfVNwztZfscsolCMJMQoRKHsT80=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Kzslc/LsklrKwXjfNAKxWUD5JX3bWDq4tz2zKnxsE62sMumnw5Ay25/d8uYfcGR+E Z0g6kmuCCRGanRNwsdvF5TNDbnrA6Zvxi2uDROskbLkpCrUFkFKnjl7acU81+c7wvh hQH29bu5YEHtOdlaT9JVxil6Bz5RonohhNpCgyr8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46F50F802F7; Fri, 10 Jul 2020 07:26:02 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BA320F802F8; Fri, 10 Jul 2020 07:26:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AEF38F8015C for ; Fri, 10 Jul 2020 07:25:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AEF38F8015C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="maYPiFAt" Received: by mail-yb1-xb4a.google.com with SMTP id z7so5780539ybz.1 for ; Thu, 09 Jul 2020 22:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=1jgnVvQzDsXT/ABFTj8+H2Are3uSraKIFsDEibLg2UM=; b=maYPiFAtUWbNvEVYCQbJ0xZgO544WdZF+qGkUgj5D0CAMiaMnNp8ukl9f8ziqkaRRX KxTO6PQouhv2cl/ipll0JDu2CYJbji4IsHatUzHX2N/ItDIeXvIEI2xtW1o8PRkGKzST naAk9HBTvAJQ0in2CLfoZAUmIkU5/Qh+Lu8IcXa58hMs5+23Fi6ea37BaVVmz001xdFJ KhZWDWjgMq8LsZnOor8E7vgSSv6YZhe5HGrOjj+07qN6uCGaytnHvMH9xBsLK0zCjrFC B3b8PkJqDFt7ZAu2/j1m911rsgdHlgimf4GL1eoKvVtkm9IAMa/pnVxnzI9AmXheYIYp KYgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=1jgnVvQzDsXT/ABFTj8+H2Are3uSraKIFsDEibLg2UM=; b=EgQmg898Z57hwvauRNNkZwFfDOWzIXyXfKl4JhbfCwU9NxEDaTmZTvZj86XIxQ9O+f bH2r92FZpv1nSwRxpCbRLhQjo4mBkWqKv78Tijr05lGEoVxIjPeTczvbV7pUw/AXY9N5 Q/SB1DWVgGSjjdRPqpnqmiMhpuKSSndCgTXVxl6XMwgOdDXCM+OfM6KS9GpMyBRPqbH/ zAH6ji3Qdny+ILmLwhVYkqEDWfHD57v2f2LXqsW7NA6ZeBBTWU4+1qRn6vgdjbxQaR3p 6c82sVrGp8+UupOHd/+Kz4nVdoOO0jI42vo6NDaB3M0KXCHsPtgQUjoIzrAG41dX3Bwh 98gQ== X-Gm-Message-State: AOAM533x0mzpvaUjNq0rg6Atq1Bc0VuT9dJHTgF0Nzh1xpZ3ujMKknHi t54AvqgBOGbxxqW7qIlSUNOoMaeVr+gM X-Google-Smtp-Source: ABdhPJyx/h8lcECiwFUQlr3JTA9UJv+40MDFq2/PvWa59T/tFgBoeQhHHSGd7vysVm70fuwLFQLRvZcyhcUi X-Received: by 2002:a25:e481:: with SMTP id b123mr98012144ybh.126.1594358729312; Thu, 09 Jul 2020 22:25:29 -0700 (PDT) Date: Fri, 10 Jul 2020 13:25:03 +0800 In-Reply-To: <20200710052505.3664118-1-tzungbi@google.com> Message-Id: <20200710052505.3664118-5-tzungbi@google.com> Mime-Version: 1.0 References: <20200710052505.3664118-1-tzungbi@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 4/6] ASoC: dt-bindings: mt8183-da7219: add a property "mediatek, hdmi-codec" From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, tzungbi@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Adds an optional property "mediatek,hdmi-codec". Signed-off-by: Tzung-Bi Shih --- .../devicetree/bindings/sound/mt8183-da7219-max98357.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt8183-da7219-max98357.txt b/Documentation/devicetree/bindings/sound/mt8183-da7219-max98357.txt index f7f3b83da630..6787ce8789dd 100644 --- a/Documentation/devicetree/bindings/sound/mt8183-da7219-max98357.txt +++ b/Documentation/devicetree/bindings/sound/mt8183-da7219-max98357.txt @@ -6,11 +6,15 @@ Required properties: - mediatek,headset-codec: the phandles of da7219 codecs - mediatek,platform: the phandle of MT8183 ASoC platform +Optional properties: +- mediatek,hdmi-codec: the phandles of HDMI codec + Example: sound { compatible = "mediatek,mt8183_da7219_max98357"; mediatek,headset-codec = <&da7219>; + mediatek,hdmi-codec = <&it6505dptx>; mediatek,platform = <&afe>; }; From patchwork Fri Jul 10 05:25:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11655707 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB2A413BD for ; Fri, 10 Jul 2020 05:28:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 64F552076A for ; Fri, 10 Jul 2020 05:28:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ffwQUHqJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="rutmYKmp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64F552076A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BC1DB1674; Fri, 10 Jul 2020 07:28:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BC1DB1674 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594358935; bh=qrimL7S3JsAXPMWHFcaQcqkSKO6TJv2+4NhSTo/Agd0=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ffwQUHqJtvdsl0Zft1TqE1+K8LfHT6hZCEvAJzpKa0dEXm0IMzDaAFkkem1Z46tGE gu60KXaSsX4sjxxPM8N8HwhOYOJtbZRjjXEc+y/1ZbKw/QGahROU/yN5PSFOCl3ym2 axVJRppUBHSl6zuN54+XTMPhLaLYftM5viDBcCQA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9CB1BF802DC; Fri, 10 Jul 2020 07:25:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B637F802A0; Fri, 10 Jul 2020 07:25:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4F2E8F8015D for ; Fri, 10 Jul 2020 07:25:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4F2E8F8015D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rutmYKmp" Received: by mail-yb1-xb49.google.com with SMTP id g10so5816624ybd.0 for ; Thu, 09 Jul 2020 22:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=tgx1/z4Ge0ad0sjsQ0jzGb9TfRKIZ57I3cV4cHGoXqQ=; b=rutmYKmpo55/0BSQcjnPDCi6fy7cob+iyDnew8FHrRmGG6eK5GPZxfao7BsnRL0Eqj ceILUQ7K4tgLgE8urMWT9//tvXOzb6nvwEHswxIcio3V8HPjz+Fc23yTsYu1dfdDvN/q Hc5ipY/vWNIaMza/1gXL2b66T50xc8INqmaFMcjauJn/jyuFt9VAzAWY0Rpksww4rMC5 sh33Z51bw6daP+mA+kFHaaT9+j7GGJgmFlmAh8WVXTTMQGnvJJziw8Quh4+sK4cnkW2R nucDGElIpNXT0aN2gMdjxbphdpx3SqNHEwH2m0BgIJ5O+m69dnKe/wUKoAyYZEGWBcyr huHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=tgx1/z4Ge0ad0sjsQ0jzGb9TfRKIZ57I3cV4cHGoXqQ=; b=QJnr0rmf92s/d6haqXTYbZILmc2BikLXDW1pLDbV5W2p3tQnHAJHMsbAg7ZH6NDDLw mOqkmUFUVPqqjRLnWR7ZWO+tRVdBZJppAaVIFn+26n6b0q7Gw+SEzRumUDQEWBIGLxJW w/QP9rbECN4dngZb27GNvOHKEmlui+Oi4qkkc18xw5cTSz9oCmDOY3FpCdR0Wpa5sVwa X5Dpuz3qC1e8Pu8WAaIUFLRgC3RFl54zpv5HmbGENtxAsAOXZUz6E/6RnmUzw8U/cAq1 Kf9VNSxneqAnysRx8PCsqfAXF2v312C2+BbUM65t/uWKyWj3o7BYmO09ER/2LlkGeHIT iPYA== X-Gm-Message-State: AOAM532JefXLc7i3+6Fa+aaRrA/MlrAAEk8LJ8PeNlICDGFFK9wdruQE cVOYOGY53z5Y4e/LIIMlq/8MsdqmDsle X-Google-Smtp-Source: ABdhPJyMCZkNSLsFKUn19G/Sps8R3ThNMrUeAs+hIRt2DUgCQ+qabdLdWdlMWWvA+cdoaIq0gJlmVD+jPP7f X-Received: by 2002:a25:f603:: with SMTP id t3mr20443714ybd.49.1594358732859; Thu, 09 Jul 2020 22:25:32 -0700 (PDT) Date: Fri, 10 Jul 2020 13:25:04 +0800 In-Reply-To: <20200710052505.3664118-1-tzungbi@google.com> Message-Id: <20200710052505.3664118-6-tzungbi@google.com> Mime-Version: 1.0 References: <20200710052505.3664118-1-tzungbi@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 5/6] ASoC: mediatek: mt8183-da7219: use hdmi-codec From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, tzungbi@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Adds DAI link to use hdmi-codec. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index bc551a4af25f..cbef4a538224 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -354,7 +354,7 @@ SND_SOC_DAILINK_DEFS(i2s5, SND_SOC_DAILINK_DEFS(tdm, DAILINK_COMP_ARRAY(COMP_CPU("TDM")), - DAILINK_COMP_ARRAY(COMP_DUMMY()), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")), DAILINK_COMP_ARRAY(COMP_EMPTY())); static struct snd_soc_dai_link mt8183_da7219_dai_links[] = { @@ -627,7 +627,7 @@ static struct snd_soc_card mt8183_da7219_rt1015_card = { static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; - struct device_node *platform_node; + struct device_node *platform_node, *hdmi_codec; struct snd_soc_dai_link *dai_link; struct mt8183_da7219_max98357_priv *priv; struct pinctrl *pinctrl; @@ -648,6 +648,9 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) card = (struct snd_soc_card *)match->data; card->dev = &pdev->dev; + hdmi_codec = of_parse_phandle(pdev->dev.of_node, + "mediatek,hdmi-codec", 0); + for_each_card_prelinks(card, i, dai_link) { if (strcmp(dai_link->name, "I2S3") == 0) { if (card == &mt8183_da7219_max98357_card) { @@ -679,6 +682,9 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) } } + if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) + dai_link->codecs->of_node = hdmi_codec; + if (!dai_link->platforms->name) dai_link->platforms->of_node = platform_node; } From patchwork Fri Jul 10 05:25:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11655717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C6E213B4 for ; Fri, 10 Jul 2020 05:29:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A712A207BC for ; Fri, 10 Jul 2020 05:29:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="LigsWD/1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="Ock+IgY9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A712A207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3CB371665; Fri, 10 Jul 2020 07:28:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3CB371665 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594358981; bh=2CVI5YUDzKnJkPYnyAt/ktXPsZQAdZwbKSJZ01bEL74=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LigsWD/16k4y+E0qo32p588+/n5mgaQRWrNWzZOQNU3YQXACrplTlXKswkO6+XrDz 1+6o/z1m+/3LmFD1MdYK57kDBLGwsvBwURpKzANeHFey0DY3JIXtjzw3lCM/7PM2mw qlrhBuJKAh1OdKucgDHtOVDUzDmEecqD8b9cJALA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AE6FEF802DF; Fri, 10 Jul 2020 07:25:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5425DF802BC; Fri, 10 Jul 2020 07:25:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 16A21F8015D for ; Fri, 10 Jul 2020 07:25:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 16A21F8015D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ock+IgY9" Received: by mail-yb1-xb4a.google.com with SMTP id s9so5748677ybj.18 for ; Thu, 09 Jul 2020 22:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=rvt07E/G4Y3HgzjtCgi9q4wlTsU980JvgAHfFfxfTkk=; b=Ock+IgY9qdX4YDm3IA6N1vBTSz6q6HQ3LMZJu3aWh7PUhb/fSa7/e/vFX7G/ZnASle YhC3Y16TeMnAe8u4GcoRTXeyLI2uFB6O+aohMVj2BvyBrMg9Kgxz8U0P4aeoSJEZE+DU ykz7XAifBqYDXsh2WmTbwt2nYlW2YNDAqkDbkkPUJXEr+bQxh2ax34gFS60X5zP/C8sB 0UewzbA0s3JcwlET+ATFS5hUUZmgiSMosrGudMnSP1PUHSKQZFdbnhGwOWLQ3AXKJmzj DV1FD135KWEosQLnY63INaDy4x9uVvJyFALB3S/Zdw1b5SKNuVAKVZygFOX/fYGPhmD7 l63g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=rvt07E/G4Y3HgzjtCgi9q4wlTsU980JvgAHfFfxfTkk=; b=CUMtg011X3xN1A1P/6cwq6w7vYBBPLV+sv5XvUZ+SsdFDr6yDT49gT6e92zxoTjDN7 6DykFxd5ui7KGIq3HCs8NR0LzpzmEjdCSx1FXlqSP3QKzvggYnM2KRvzn96VFJfr/hSq jRmeIryhMoAlH88PrmWfr3GRShUM8WP4mub++ydAyAhae5z/IgAjEI+wWMZg+ZvP3Lts phFG5mEzWn6DDw3X+8r9vEAtX/fsy3j2QheYXA/zaG00rdLKZOkASSDu8PkmCdTmmutJ UOPEEk1RsZbD/MaQ4+Y4LXGmswtOrd/v+ZnZqOR7JfzcND+na1X6Q5VoILrGsCa909qH j+NQ== X-Gm-Message-State: AOAM531FwaQvbbeQpoSbB8VeZg3Ixuy/ULuPKjUYJcbQNwyzlp5lt9o+ iCzhAzCnqPFzDTwHZLrAARqpqLOoQAWr X-Google-Smtp-Source: ABdhPJywn1lcKRT98+mACJg5K/qX5eN7ZPxXtFLfkUv1EO1uiB+3ueV8J3p6VYMYWvGCYE74XQheqyTaFl71 X-Received: by 2002:a25:be02:: with SMTP id h2mr110770934ybk.315.1594358736784; Thu, 09 Jul 2020 22:25:36 -0700 (PDT) Date: Fri, 10 Jul 2020 13:25:05 +0800 In-Reply-To: <20200710052505.3664118-1-tzungbi@google.com> Message-Id: <20200710052505.3664118-7-tzungbi@google.com> Mime-Version: 1.0 References: <20200710052505.3664118-1-tzungbi@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 6/6] ASoC: mediatek: mt8183-da7219: support HDMI jack reporting From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, tzungbi@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Supports HDMI jack reporting. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/Kconfig | 1 + .../mediatek/mt8183/mt8183-da7219-max98357.c | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index ba120e9441d0..f7bc007bbdec 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -142,6 +142,7 @@ config SND_SOC_MT8183_DA7219_MAX98357A select SND_SOC_RT1015 select SND_SOC_DA7219 select SND_SOC_BT_SCO + select SND_SOC_HDMI_CODEC help This adds ASoC driver for Mediatek MT8183 boards with the DA7219 MAX98357A RT1015 audio codec. diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index cbef4a538224..edfbf34a2f45 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,7 @@ #define RT1015_DEV1_NAME "rt1015.6-0029" struct mt8183_da7219_max98357_priv { - struct snd_soc_jack headset_jack; + struct snd_soc_jack headset_jack, hdmi_jack; }; static int mt8183_mt6358_i2s_hw_params(struct snd_pcm_substream *substream, @@ -357,6 +358,21 @@ SND_SOC_DAILINK_DEFS(tdm, DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")), DAILINK_COMP_ARRAY(COMP_EMPTY())); +static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) +{ + struct mt8183_da7219_max98357_priv *priv = + snd_soc_card_get_drvdata(rtd->card); + int ret; + + ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, + &priv->hdmi_jack, NULL, 0); + if (ret) + return ret; + + return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, + &priv->hdmi_jack); +} + static struct snd_soc_dai_link mt8183_da7219_dai_links[] = { /* FE */ { @@ -511,6 +527,7 @@ static struct snd_soc_dai_link mt8183_da7219_dai_links[] = { .dpcm_playback = 1, .ignore_suspend = 1, .be_hw_params_fixup = mt8183_i2s_hw_params_fixup, + .init = mt8183_da7219_max98357_hdmi_init, SND_SOC_DAILINK_REG(tdm), }, };