From patchwork Tue Oct 22 11:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 11205891 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 8802A112C for ; Wed, 23 Oct 2019 08:10:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 7079221906 for ; Wed, 23 Oct 2019 08:10:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7079221906 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B06436E9A3; Wed, 23 Oct 2019 08:10:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by gabe.freedesktop.org (Postfix) with ESMTPS id B54EC6E5F0 for ; Tue, 22 Oct 2019 11:47:05 +0000 (UTC) Received: by mail-pl1-x64a.google.com with SMTP id r13so2011987pls.4 for ; Tue, 22 Oct 2019 04:47:05 -0700 (PDT) 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=bhx4XpOMOAvSvKbY+GNWUpjZmdRh9xAzVtH8yGRzOsQ=; b=tWXrNucZ78UOeJ/6rT4+Vm/EIQUS8cWTbFEoFHR5l7CwE8hNCx1G8yeje4Rjrr4/JK QHJKtcn0H6kGOJxBKNTT6B3z1iTqoE9OpqXpBjnsswIfQEG+3noNupwj59ec282Q8qqF 9jV4v0msrEZpMrVBpjR1oV3XJPwPbn3n+LN87gSU+CgiHE9jP6DGNLLliADJF+DvX1ap Zu6rvJR+OVkXDAdqY1o7JZQHo0MiaWuhMIcgi2SuMGFnYf2h+yoeB84ikK4f/zPVI/LN BN+a89wVl7+2Gk+KYR/iGK9xILJCeKXHNt6ZxbisI7IE/hFNnyliiIoXAIZVq83UgZQI dqtg== X-Gm-Message-State: APjAAAUPOGB28h3Aa7VxptD4Z5Syf5W/MbvxzEKRx3mZIZw8qdkvmIgN 9LCWKzWCiRs7fDyDTvi2dYMLKMSMR5Ae X-Google-Smtp-Source: APXvYqxav0HrOfMpw4960RSWWzv7KqgN4pnD2wXbdoyd8cYu/tGEv/ffv9S5k7+O4gnGu3yAJgDijmZjv4MQ X-Received: by 2002:a63:6116:: with SMTP id v22mr3089716pgb.95.1571744825052; Tue, 22 Oct 2019 04:47:05 -0700 (PDT) Date: Tue, 22 Oct 2019 19:45:03 +0800 In-Reply-To: <20191022114505.196852-1-tzungbi@google.com> Message-Id: <20191022193301.4.I659b5e6b25155890b85eb1c361e60f92d2500b7e@changeid> Mime-Version: 1.0 References: <20191022114505.196852-1-tzungbi@google.com> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog Subject: [PATCH 4/6] ASoC: mediatek: mt8183: use hdmi-codec From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org, narmstrong@baylibre.com X-Mailman-Approved-At: Wed, 23 Oct 2019 08:09:38 +0000 X-Mailman-Original-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=bhx4XpOMOAvSvKbY+GNWUpjZmdRh9xAzVtH8yGRzOsQ=; b=SIBiN9miBukP2vHVz9yb1Z7FzYKWBp7bstUfIx/l48YcGQot4ut6+8V5YUJL6c1Vqp 0A/NHXnagesp/88Em+/Q++21OMqJgdwe9fSH0k6LaOG4jpyJyc5tDwISjoBwE6mLxDSa 5veKygBQcZRHA4AZSjrCwhGgXe5MlbkeCUSywhc1nboAqBjXAADehO5RiEnoH+Ya/rkn 8ncAtmX9QmchPk8cZwR0wLlGED4guLq/cpUFd7MfjP5n9FZtZt9lRPqBFKOrIKm+5r9x hpFDohJpJTr9QNLCYOEN8Ii6mALgfaNKpGwWnkxxYn5ezvpwhygwN7nAytfE7CPmcqJN cXOw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, cychiang@google.com, jonas@kwiboo.se, allen.chen@ite.com.tw, jernej.skrabec@siol.net, dri-devel@lists.freedesktop.org, Laurent.pinchart@ideasonboard.com, tzungbi@google.com, dgreid@google.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add DAI link to use hdmi-codec. Signed-off-by: Tzung-Bi Shih --- .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index 0555f7d73d05..258f1416fae1 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -191,7 +191,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) @@ -479,7 +479,7 @@ static int mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card = &mt8183_mt6358_ts3a227_max98357_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; int ret; @@ -496,9 +496,12 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) 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 (dai_link->platforms->name) - continue; + if (!dai_link->platforms->name) + dai_link->platforms->of_node = platform_node; if (ec_codec && strcmp(dai_link->name, "Wake on Voice") == 0) { dai_link->cpus[0].name = NULL; @@ -509,9 +512,10 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) dai_link->codecs[0].dai_name = "Wake on Voice"; dai_link->platforms[0].of_node = ec_codec; dai_link->ignore = 0; - } else { - dai_link->platforms->of_node = platform_node; } + + if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) + dai_link->codecs->of_node = hdmi_codec; } mt8183_mt6358_ts3a227_max98357_headset_dev.dlc.of_node =