From patchwork Wed Jan 20 08:08:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 367134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F52EC433DB for ; Wed, 20 Jan 2021 08:11: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 EBD4C2313A for ; Wed, 20 Jan 2021 08:11:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBD4C2313A 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 8942417DD; Wed, 20 Jan 2021 09:10:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8942417DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611130261; bh=Rox+b31XUfmFBIV2tScdBycsItmOk3nlyxUoxlusdKI=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Wy2yd9WKFN/hSz7NG4KvgS/w9KzOcc03+m0CnKecCmsidqGSyoJjQ68hwyAf4XW1s S952IMPrS4S25n6mWoTuC2JXWA4fSBM38HHPDLjIArTpZ0aQSETB2QCjUk4598oPGE 7drGpBF1tRGvl6U0WzRbUCeOARnKFg8tOGHuDFIw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CD760F80253; Wed, 20 Jan 2021 09:09:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 53CF6F8019D; Wed, 20 Jan 2021 09:09:20 +0100 (CET) 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 0DBECF80227 for ; Wed, 20 Jan 2021 09:09:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0DBECF80227 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TT4sKjt+" Received: by mail-yb1-xb49.google.com with SMTP id b62so19633260ybg.1 for ; Wed, 20 Jan 2021 00:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=SmiqRyWwl+9YuN8tC28z3cuRSiSYFs1m5Wjro9iC9Ms=; b=TT4sKjt+gSjbsCN6+pFJiq4W7jnq2vEr5ZAJoj4n+MV7aD/ZAb/7zSNbnUoihwfwaF RVRq5rGq6g0pqX7kIIWCWZdEFASqCVfUeJu54j1nUGEu+V7d5mLdTT5DBBpicnbtSypm GvrikyajuQosd5G1B4w2ngQnytrhBWzNs09TUt85mIL8K40uzw7mgrXkXBxFk9wFA+D5 WHf33hEVZ0wwAJn3g2IFXtZsFyMwm0IFHcOSDsFa1I9etxi57K5X/U+UI1yhv3krXZDI idv5WEOoZtJSap8l0eN6uA3AhEGKRcNBz/gROaELrpWXBNq975Qw/C6zPTqtnQJjR1dL U7Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=SmiqRyWwl+9YuN8tC28z3cuRSiSYFs1m5Wjro9iC9Ms=; b=SmNVa998wtPKMygFjZavNSV9HT5Br/rX/438U7ULbdLRahHUBiNv8743FrCGQdJf0+ bSu/EG2/4NSdVsONQlnd7VlMTncDntZvUnb3flZG/9qlTs/0WTM6YdsJmNsBw0wl9i98 Wvt1GKIPFtGNfpTg61safzz6dspavwMd9Vk9raLldbCgcKcTEG1dcc+kT23+wHMtjxQv GTTgK+jJnIR7ttvrGGrddqRLdbS5fqGiyUhKMm2cA34WfIflC19ZNQeqEfDnl/2MLbil a7XQMwMBCJ5oRlu62Djhlaxb9BMplV92zMhIK1Jiv6krysFBtvTx4pqR/LtJAzCprOCU i94g== X-Gm-Message-State: AOAM532YnAIYy/0V5bvqk6PNTTzMOYB21A9lJ17e7HJA7qRWxFhkkY6/ KvfoGQbM7TecO3GxsNSdgAH1X6HjzLFx X-Google-Smtp-Source: ABdhPJwgsQAWglOCEGtKoVUzqAnU2tsXXNDSVYHjY2bZzGFR74ahzBGi0FOePYDzZ4UL/6irz4aCUWlI3X8a X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:1164:8893:969a:b338]) (user=tzungbi job=sendgmr) by 2002:a25:d84:: with SMTP id 126mr11341755ybn.145.1611130154567; Wed, 20 Jan 2021 00:09:14 -0800 (PST) Date: Wed, 20 Jan 2021 16:08:48 +0800 In-Reply-To: <20210120080850.699354-1-tzungbi@google.com> Message-Id: <20210120080850.699354-4-tzungbi@google.com> Mime-Version: 1.0 References: <20210120080850.699354-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH 3/5] ASoC: mediatek: mt8192: change mclk_multiple of TDM from 128 to 512 From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" mclk = rate * mclk_multiple bclk = rate * channel * sample_width If TDM outputs 8 channels and 32 bits, bclk will be greater than mclk. Changes the ratio from 128 to 512. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/mt8192/mt8192-dai-tdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c b/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c index 8383536b7ae0..f5de1d769679 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c @@ -738,7 +738,7 @@ static struct mtk_afe_tdm_priv *init_tdm_priv_data(struct mtk_base_afe *afe) if (!tdm_priv) return NULL; - tdm_priv->mclk_multiple = 128; + tdm_priv->mclk_multiple = 512; tdm_priv->bck_id = MT8192_I2S4_BCK; tdm_priv->mclk_id = MT8192_I2S4_MCK; tdm_priv->id = MT8192_DAI_TDM; From patchwork Wed Jan 20 08:08:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 367133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0231BC433E0 for ; Wed, 20 Jan 2021 08:11:48 +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 D90372313A for ; Wed, 20 Jan 2021 08:11:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D90372313A 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 33D6817FA; Wed, 20 Jan 2021 09:10:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 33D6817FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611130305; bh=OzC7CsePra3CrHhlsLsyRRkWFKOMYd3kPeZahderIv4=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=R7FRbeDD2Cd6IT3E5q1q/FnzK1DInAFopFwKl5aDsRpOHv3MpbaGCliBa4HlTjxDO KctOMZDgEP1k6HWW/WaET1ZvjF4xtwyAhvah5j3Co/nXJ57SOgQ0vR3R/B26vH+sgS CwllLqXuq26WrpXxzFTjVq8+R9RBayhJfDzZxwco= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7C56FF804CB; Wed, 20 Jan 2021 09:09:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC293F804BD; Wed, 20 Jan 2021 09:09:22 +0100 (CET) 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 621E4F80227 for ; Wed, 20 Jan 2021 09:09:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 621E4F80227 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vxgOFOds" Received: by mail-yb1-xb49.google.com with SMTP id c9so29379255ybs.8 for ; Wed, 20 Jan 2021 00:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=Y+Fx4Q3xTRwBEn5hZJB1lpjzFFSmiRd0H1yYDfLlDsM=; b=vxgOFOdsDQzr5aEd2YVIbLvshnoCoC/VERiplfYPU24l+TSlB98fGzz2Obmxp+OUKm cu4aBejiuqpcX2Lr2v2PrD0Y/Mo2cofT8fHOxIWKNEHkIpCHviRli0zXK7TPUqmL8dAS 7ofKtcHbvMbcvZGIR4xh0jwTqDuaCVvQnpa7g2ZY828MIeTlXa9rzwE5HY8TBuQ24EbH F22E2Kfua9yrRPawIekUNYvseOiatHx/U31JkBNQsHUwozXQHKraFxhjuSmKzxyN+gwJ Xr49ZK74JsNUX3+kAcVd/1urKJdvVtkWU8Q+BBHHkIV6lWQYc4pQ7CHcAWwxhVYqIn8Z AU6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Y+Fx4Q3xTRwBEn5hZJB1lpjzFFSmiRd0H1yYDfLlDsM=; b=cNispcUdC96m6CCWqXaeoFlZ3lZPK3GmQ8fYPHVZzRA3Nl9Jwin1ooXDVfjbojcgGm hl0nfqSDgPC8JihdyD0OgePVtqAaZiALxY6FEYAOM0M6Q6mQuTluSpm+gkXfdszkISDZ cENr+H8zar9LiTbYHkihflrAyuieZNrLbo7sNHnpI/s7aIbdIswmgpCYewbu41R2H2oZ F3RaZvt8zme8KL+OmyabUXeTzCUSnY/DWlXMja1ESmNQ6dwIOEfnqkS5y71rodPCfCUr cp6FDCtL7Ek11Z55s1PlLwWMxkNqhviXv6K3IvUPc40vGRLW+SfZcReA88W4mE9usVdT yaPA== X-Gm-Message-State: AOAM5320IAm/5n1VMFWNQJ8lSOwzq2SzPrKJWRsJgEQfDgODGJRged7M vUWAtmo4oWFHBS3WKa4fPeeBBGh8KsC/ X-Google-Smtp-Source: ABdhPJxqem2Ny4Ah8ScsPr/Hgjfex9iupmb+ZO1O4sdHmta+oHMFwOypJuwrF8TGgOpJyI/ofGdmGNQUpdMy X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:1164:8893:969a:b338]) (user=tzungbi job=sendgmr) by 2002:a25:f02:: with SMTP id 2mr11570686ybp.190.1611130158185; Wed, 20 Jan 2021 00:09:18 -0800 (PST) Date: Wed, 20 Jan 2021 16:08:49 +0800 In-Reply-To: <20210120080850.699354-1-tzungbi@google.com> Message-Id: <20210120080850.699354-5-tzungbi@google.com> Mime-Version: 1.0 References: <20210120080850.699354-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH 4/5] ASoC: dt-bindings: mt8192-mt6359: add hdmi-codec property From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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 optional property "hdmi-codec". If specified, the machine driver should: - Exposes a device that can write audio data to the DP bridge. - Detects jack plug events. Signed-off-by: Tzung-Bi Shih --- .../bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml index 54650823b29a..5a5b765b859a 100644 --- a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml +++ b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml @@ -23,6 +23,10 @@ properties: $ref: "/schemas/types.yaml#/definitions/phandle" description: The phandle of MT8192 ASoC platform. + mediatek,hdmi-codec: + $ref: "/schemas/types.yaml#/definitions/phandle" + description: The phandle of HDMI codec. + additionalProperties: false required: @@ -35,6 +39,7 @@ examples: sound: mt8192-sound { compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; mediatek,platform = <&afe>; + mediatek,hdmi-codec = <&anx_bridge_dp>; pinctrl-names = "aud_clk_mosi_off", "aud_clk_mosi_on"; pinctrl-0 = <&aud_clk_mosi_off>; From patchwork Wed Jan 20 08:08:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 367132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF23FC433E0 for ; Wed, 20 Jan 2021 08:12:40 +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 02A1A2313A for ; Wed, 20 Jan 2021 08:12:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02A1A2313A 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 6073D181E; Wed, 20 Jan 2021 09:11:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6073D181E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611130358; bh=Df24PrR4ZHSTi17K/cmXn/adg/JFPFc//H80xDdjKaU=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=P1WlrAizfbsbqDo/BJUxhz+RtWQdeUfevp8kE9aWawf3vSeLzWbWBzZDZWLxPmp4+ k5cfk1aoZE7EmdX0KMpUAulZpwizPHSB5ym2KPu875ppGkaPQKKtLucj3brklvpAIX H60Yyraxjh3BkdPl/jy5Tr7mWrVJykVD/AQ98sM8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3A318F804E7; Wed, 20 Jan 2021 09:09:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 47EFBF804D6; Wed, 20 Jan 2021 09:09:32 +0100 (CET) Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) (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 9A16CF804D6 for ; Wed, 20 Jan 2021 09:09:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9A16CF804D6 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XHin27U/" Received: by mail-qt1-x849.google.com with SMTP id 22so20582410qty.14 for ; Wed, 20 Jan 2021 00:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=sQhmAabxwvCN6VVpbop+UBorAEcNt9ytsxAM/0+JvF8=; b=XHin27U/N0fQ34PIArxAW2shOw/rjlWwDl3nOAM2NMubmTTzcW1XTDK74gQ1R7RMEn 0aa47E5WiPHsN90DZqMoVTSTOV08s7sQ19nN53hYxydGfm6dhzAMlaG3+yIFqub69tcx q+DRAUhp8hQ7PFUV1nS+QZT91phyTujh4P56fcQXiwRQRyF3lQIpUjAmcz+oMUK4FnNW zQxJ9H5GWUx/uyuccaQsFx1a9wFkGDuklQiNxKQf8cuvSrp8S1Qz1z4iTNme3UdcoiwF 4OaMlf0ltrlbVm5XpTIlWa6vO/e0tAmw86z0AmM3QnLQtLHN0hZE28oWI1YOvnOLeorc v01w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=sQhmAabxwvCN6VVpbop+UBorAEcNt9ytsxAM/0+JvF8=; b=B5VsOo1YYPiqyuc3qws1S7h6WLP32MF2wPVFQylvQpwIm0v71gJW07rzOO7pBvfENe WZylrMWgTTiBKYyxSVJg25HfIToc9+UfqwmI+2OgoHLc+CEpZztV3NRpcnmZfx8hP4S3 8d/zAJXj44lkbmKsH38TJ8Wobafw+3IW6OGCSn2w3XJzYpYTsx0qnWhYt8zyJO9uImDv Jfb8TI5bmuTGu/kTPrsdDlxiArNfgL3PlbFNXe73GLyGMO3MWufrMBzAtf9rz4+a3Kvu VXfEJvlDwEAWOXvoxirvoVqUaiZs5atW5XhRa1T47JXNiaKWdNz6Rv6b/EePPA24zXPh vGKQ== X-Gm-Message-State: AOAM530RQB2bIuqLCbfJlTzMN5O+FQysWPQOLKMrFNt+o4qc1fDo8ztl 29iRWRN1AeZbnnDftlZCJ8w5ehmP0u9i X-Google-Smtp-Source: ABdhPJxehndhb8u41XwHipFb3V90nONbfNuOZLuAMKwJz+KEqMbLrtwgT3VtjA53R1Q3SW2jghvJY22UV08P X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:1164:8893:969a:b338]) (user=tzungbi job=sendgmr) by 2002:a05:6214:14ae:: with SMTP id bo14mr8437792qvb.16.1611130161829; Wed, 20 Jan 2021 00:09:21 -0800 (PST) Date: Wed, 20 Jan 2021 16:08:50 +0800 In-Reply-To: <20210120080850.699354-1-tzungbi@google.com> Message-Id: <20210120080850.699354-6-tzungbi@google.com> Mime-Version: 1.0 References: <20210120080850.699354-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH 5/5] ASoC: mediatek: mt8192-mt6359: support audio over DP From: Tzung-Bi Shih To: broonie@kernel.org, robh+dt@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org 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" If the DTS property is specified, the DP bridge should populate a "hdmi-codec" platform device (sound/soc/codecs/hdmi-codec.c). The "hdmi-codec" device is the communication relayer between the ASoC machine driver and the DP bridge. For example: - Notifies DP bridge when setting hw_param. - Notifies ASoC when jack detection events. Signed-off-by: Tzung-Bi Shih --- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index 8ea24b32a535..cc0fc72305d2 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -33,6 +33,7 @@ struct mt8192_mt6359_priv { struct snd_soc_jack headset_jack; + struct snd_soc_jack hdmi_jack; }; static int mt8192_rt1015_i2s_hw_params(struct snd_pcm_substream *substream, @@ -329,6 +330,23 @@ static int mt8192_rt5682_init(struct snd_soc_pcm_runtime *rtd) return snd_soc_component_set_jack(cmpnt_codec, jack, NULL); }; +static int mt8192_mt6359_hdmi_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_component *cmpnt_codec = + asoc_rtd_to_codec(rtd, 0)->component; + struct mt8192_mt6359_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) { + dev_err(rtd->dev, "HDMI Jack creation failed: %d\n", ret); + return ret; + } + + return snd_soc_component_set_jack(cmpnt_codec, &priv->hdmi_jack, NULL); +} + static int mt8192_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { @@ -600,7 +618,7 @@ SND_SOC_DAILINK_DEFS(pcm2, 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 mt8192_mt6359_dai_links[] = { @@ -936,8 +954,14 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { { .name = "TDM", .no_pcm = 1, + .dai_fmt = SND_SOC_DAIFMT_DSP_A | + SND_SOC_DAIFMT_IB_NF | + SND_SOC_DAIFMT_CBM_CFM, .dpcm_playback = 1, .ignore_suspend = 1, + .be_hw_params_fixup = mt8192_i2s_hw_params_fixup, + .ignore = 1, + .init = mt8192_mt6359_hdmi_init, SND_SOC_DAILINK_REG(tdm), }, }; @@ -948,6 +972,7 @@ mt8192_mt6359_rt1015_rt5682_widgets[] = { SND_SOC_DAPM_SPK("Right Spk", NULL), SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_OUTPUT("TDM Out"), }; static const struct snd_soc_dapm_route mt8192_mt6359_rt1015_rt5682_routes[] = { @@ -958,6 +983,8 @@ static const struct snd_soc_dapm_route mt8192_mt6359_rt1015_rt5682_routes[] = { { "Headphone Jack", NULL, "HPOL" }, { "Headphone Jack", NULL, "HPOR" }, { "IN1P", NULL, "Headset Mic" }, + /* TDM */ + { "TDM Out", NULL, "TDM" }, }; static const struct snd_kcontrol_new mt8192_mt6359_rt1015_rt5682_controls[] = { @@ -1031,7 +1058,7 @@ static struct snd_soc_card mt8192_mt6359_rt1015p_rt5682_card = { static int mt8192_mt6359_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; - struct device_node *platform_node; + struct device_node *platform_node, *hdmi_codec; int ret, i; struct snd_soc_dai_link *dai_link; const struct of_device_id *match; @@ -1051,6 +1078,9 @@ static int mt8192_mt6359_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 == &mt8192_mt6359_rt1015_rt5682_card) { @@ -1077,6 +1107,11 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) } } + if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) { + dai_link->codecs->of_node = hdmi_codec; + dai_link->ignore = 0; + } + if (!dai_link->platforms->name) dai_link->platforms->of_node = platform_node; }