From patchwork Tue Dec 1 13:21:21 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: 11942947 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.7 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, URIBL_BLOCKED,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 5C9B4C64E90 for ; Tue, 1 Dec 2020 13:23:27 +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 677CF207FF for ; Tue, 1 Dec 2020 13:23:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="OLWQ4Gen"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="iEOPqvPg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 677CF207FF 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 7F38F179E; Tue, 1 Dec 2020 14:22:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7F38F179E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606829004; bh=1Rtn3YVm1OW3lOwDdvYUJdJvIMgVb9zeLxwrRUgY9ww=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OLWQ4Gen857S76VKAJHvu3QjAwlYEwkbCLm50IrTMNTECg1xkSbg3SNfiiHT2/bvT 6q4oi8vgW2rozeP3Z/8Y2540EePFvAVCEyAzUDmbuvDQpAgTMxfeMGeZpf61YNTqBD YqnzzpZLIh4nmjKN7CIaYglGeOX12Qz61zjL/Uts= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DDCD4F8026D; Tue, 1 Dec 2020 14:21:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE6A6F80277; Tue, 1 Dec 2020 14:21:49 +0100 (CET) Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) (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 C5064F8016D for ; Tue, 1 Dec 2020 14:21:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C5064F8016D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iEOPqvPg" Received: by mail-pg1-x54a.google.com with SMTP id u26so993289pgl.15 for ; Tue, 01 Dec 2020 05:21:43 -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=zeBdGQi7aQ2RzZ5oYC/vR5oem1skz7Qr9Eoewd69/U0=; b=iEOPqvPgI8ipW99Es2VsiKfDR9kkaC/BaCkeLaru++W1YWGNf0OOLpqSksxR76oXas pF8Mfw2EeICL3z3ehzTLtpECEuX8La1lhRvU9yvjsxwdaLAzW94fRoEYy0sNh6PXCwXT nbyq15rJfVkTGvpQHDo7TDK6GgE78LxsmLYTSN4coyWmFG4oa/IRaDSUO5jYHSrjs0n/ 1iDW+pIK6K2DtVqVbY3wG4Afnz00UT0AtzZIBpVVmDj2jh6e9JgtIezd4Kp0LJrRf8+f F2Mc6xvmUeTz5GVX+IfLtc5ItIRPWV3yBiAJIAbgtuc4KkAe+TQg+qGu8O8Y00iG7spz GSow== 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=zeBdGQi7aQ2RzZ5oYC/vR5oem1skz7Qr9Eoewd69/U0=; b=NL2yz+P6sxBMppPSPQT60R50cMmSYqBUFE/rWauMGZy7Qpo0qt7kxzVxTpX870/gYQ bJlglqjyjdk5dVH7GPqLLVZj/kVDpi94AhRiDbRccgCSzMnPCYMEfTIVWymZGzZKP4Ez XZyxpWcsE7a2Fx6WEupZBv3dPkzMupD8vJp4SRGryKDZjEcB32V0OHC1ZFxUCaO4Xx/W uQDCw0VRZ5/3cUzsV6AWItyVgqaONyTgwkYyuMV8f3WPWZe+T+VcdR4qN6iLIdntATAe bPK9izT/kNiySEaBysrTpiMlpJZ+/CT5EvdPiiL0Uqzs6O1I4a5BiYkn3HkIRKbMhxuN aa0Q== X-Gm-Message-State: AOAM531HCIqGalR4DE+jjFoYtNpRZGc5Q8WVfinOWetl12j3Mh1Y1vyw 4p3RT49sHxKQk4serXlvHrgCjF5rsdHg X-Google-Smtp-Source: ABdhPJyKK+tZoZrVUaO28DgnYTyC8N81B6PTePJ99pr5RvvdiRpCg0sXtWDEImdrbBDsI2UK+BLrRbKf4oSF X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a17:90a:460a:: with SMTP id w10mr294845pjg.1.1606828900143; Tue, 01 Dec 2020 05:21:40 -0800 (PST) Date: Tue, 1 Dec 2020 21:21:21 +0800 In-Reply-To: <20201201132126.1676005-1-tzungbi@google.com> Message-Id: <20201201132126.1676005-2-tzungbi@google.com> Mime-Version: 1.0 References: <20201201132126.1676005-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 1/6] ASoC: mediatek: mt8192: rename common symbols From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.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" Renames common symbols from "mt8192_mt6359_rt1015_rt5682" to "mt8192_mt6359". They will share between a few machine drivers on MT8192 and MT6359 with some different audio components. Signed-off-by: Tzung-Bi Shih --- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index b7f42a530d06..253c028c1630 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -631,7 +631,7 @@ SND_SOC_DAILINK_DEFS(tdm, DAILINK_COMP_ARRAY(COMP_DUMMY()), DAILINK_COMP_ARRAY(COMP_EMPTY())); -static struct snd_soc_dai_link mt8192_mt6359_rt1015_rt5682_dai_links[] = { +static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { /* Front End DAI links */ { .name = "Playback_1", @@ -986,8 +986,8 @@ static struct snd_soc_codec_conf rt1015_amp_conf[] = { static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_soc_card = { .name = "mt8192_mt6359_rt1015_rt5682", .owner = THIS_MODULE, - .dai_link = mt8192_mt6359_rt1015_rt5682_dai_links, - .num_links = ARRAY_SIZE(mt8192_mt6359_rt1015_rt5682_dai_links), + .dai_link = mt8192_mt6359_dai_links, + .num_links = ARRAY_SIZE(mt8192_mt6359_dai_links), .controls = mt8192_mt6359_rt1015_rt5682_controls, .num_controls = ARRAY_SIZE(mt8192_mt6359_rt1015_rt5682_controls), .dapm_widgets = mt8192_mt6359_rt1015_rt5682_widgets, @@ -998,7 +998,7 @@ static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_soc_card = { .num_configs = ARRAY_SIZE(rt1015_amp_conf), }; -static int mt8192_mt6359_rt1015_rt5682_dev_probe(struct platform_device *pdev) +static int mt8192_mt6359_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card = &mt8192_mt6359_rt1015_rt5682_soc_card; struct device_node *platform_node; @@ -1029,32 +1029,32 @@ static int mt8192_mt6359_rt1015_rt5682_dev_probe(struct platform_device *pdev) } #ifdef CONFIG_OF -static const struct of_device_id mt8192_mt6359_rt1015_rt5682_dt_match[] = { +static const struct of_device_id mt8192_mt6359_dt_match[] = { {.compatible = "mediatek,mt8192_mt6359_rt1015_rt5682",}, {} }; #endif -static const struct dev_pm_ops mt8192_mt6359_rt1015_rt5682_pm_ops = { +static const struct dev_pm_ops mt8192_mt6359_pm_ops = { .poweroff = snd_soc_poweroff, .restore = snd_soc_resume, }; -static struct platform_driver mt8192_mt6359_rt1015_rt5682_driver = { +static struct platform_driver mt8192_mt6359_driver = { .driver = { - .name = "mt8192_mt6359_rt1015_rt5682", + .name = "mt8192_mt6359", #ifdef CONFIG_OF - .of_match_table = mt8192_mt6359_rt1015_rt5682_dt_match, + .of_match_table = mt8192_mt6359_dt_match, #endif - .pm = &mt8192_mt6359_rt1015_rt5682_pm_ops, + .pm = &mt8192_mt6359_pm_ops, }, - .probe = mt8192_mt6359_rt1015_rt5682_dev_probe, + .probe = mt8192_mt6359_dev_probe, }; -module_platform_driver(mt8192_mt6359_rt1015_rt5682_driver); +module_platform_driver(mt8192_mt6359_driver); /* Module information */ -MODULE_DESCRIPTION("MT8192-MT6359-RT1015-RT5682 ALSA SoC machine driver"); +MODULE_DESCRIPTION("MT8192-MT6359 ALSA SoC machine driver"); MODULE_AUTHOR("Jiaxin Yu "); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("mt8192_mt6359_rt1015_rt5682 soc card"); +MODULE_ALIAS("mt8192_mt6359 soc card"); From patchwork Tue Dec 1 13:21:22 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: 11942949 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.7 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 440B9C64E7A for ; Tue, 1 Dec 2020 13:23:32 +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 7BA08207FF for ; Tue, 1 Dec 2020 13:23:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eX0F/Pbp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="QlGVESX+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BA08207FF 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 B31D61798; Tue, 1 Dec 2020 14:22:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B31D61798 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606829009; bh=u6Jwv0VMLtSJJ2xG8u1Yr1VRjB9ITuCbj5wIMxgNsbU=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eX0F/Pbpudv0PRbqudVZeEH8632I5zhHScIGGWTJ5S+psB9hHKfX1I2TFtSVX9U67 ETw5YBrCDjjev0GJwz5hayZq5Eq19vCj0vzfkEihr76WfTx/Ep4rL45HfZYCsYWtqe n7OXA7PcnW1BNBfikzdyxzv85KbmdHsVK3dTPdaI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 94FCAF804BD; Tue, 1 Dec 2020 14:21:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1851AF80276; Tue, 1 Dec 2020 14:21:51 +0100 (CET) Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) (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 E4C03F80139 for ; Tue, 1 Dec 2020 14:21:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E4C03F80139 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="QlGVESX+" Received: by mail-qv1-xf4a.google.com with SMTP id b9so1176249qvj.6 for ; Tue, 01 Dec 2020 05:21:45 -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=xpmr0QppfKaZgs1QfZTCXWDbMOfoG2eoYaqppx7TWQc=; b=QlGVESX+qYQNa0pQMtQd2eaDYuP/ad037MM/4wheOZVF+0GzCsicIBtgwksQXa0XYe /FW50tLsz7AVtEWa+58Om4l03iALUJimmhTCot6oeCSAMlQZrPpS8XM8uEe2Up+Sc5xA HkHjrmTDjlVA8xUDQM65mjx+QSEZJBi58cJqmFlEJFFnqfilXomTkyDoFg2+pBgWRqwD fZSVCvqhss+sq5wo1rA61kepgQHPypXRiJwVDmtJIJX6HJzOGcDPVR6pwk2J2/4ht91D HGVq4f5f1+hKJeSO7GKohdjYWB9tFW40mAnk52HxOLVAny0oCagyiJh9KgDvXVDRPjhP /p9Q== 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=xpmr0QppfKaZgs1QfZTCXWDbMOfoG2eoYaqppx7TWQc=; b=pApxWjktT0GaCqcyqsgfsa13rn1Xnt3pMjygUvFT+zY3TlkFHV1PZXlG8UsLQyoknk FcWy8PGeTuJY0NtdN+QGJPu6ykAhiB8hvbLcFlpUL6XNmMn+nFefh/uz+i4SpW9w64rk UCqtWf1U/gxYTBU90F9dGJcbsXEUkKjdWYUZRZEFDwEMiWrQmy++CXXBRMmDJpSm2JFx hfLQAQC1oZEdrps7LG39NtWJ2umDeTujZKlW/jc+X/I+B0fqeNGjFp4t5KxyOzurNTvq t5/W5tjPLF42vMzLG4SfI3+BZG8JOh5XZCYdoHWSJanNq/o3C7Y5/p0j3yFAAcaGZ2t/ psZQ== X-Gm-Message-State: AOAM5333kmLtUH+4F/KO9TNd8A9np+mvcRW1tcYrWbnZuNNzeTULbf97 bZeIvhyV1BB8i2oPSZ2+Q4dRFKB5SGyH X-Google-Smtp-Source: ABdhPJy9OO62JBJqPaFmowVhefh1a5nBvzc5ThO8dkuzseOMIJlNj0ESnJ3WMN0qxWsCAZC0L08xpn7dTDO0 X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a0c:8b99:: with SMTP id r25mr2758559qva.0.1606828904011; Tue, 01 Dec 2020 05:21:44 -0800 (PST) Date: Tue, 1 Dec 2020 21:21:22 +0800 In-Reply-To: <20201201132126.1676005-1-tzungbi@google.com> Message-Id: <20201201132126.1676005-3-tzungbi@google.com> Mime-Version: 1.0 References: <20201201132126.1676005-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 2/6] ASoC: mediatek: mt8192: extract rt1015_rt5682 specific DAI link From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.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" Extracts rt1015_rt5682 specific DAI link from the common one. Fills the DAI link data according to of_match. Signed-off-by: Tzung-Bi Shih --- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index 253c028c1630..e841fd32e8cc 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -576,7 +577,7 @@ SND_SOC_DAILINK_DEFS(i2s2, DAILINK_COMP_ARRAY(COMP_DUMMY()), DAILINK_COMP_ARRAY(COMP_EMPTY())); -SND_SOC_DAILINK_DEFS(i2s3, +SND_SOC_DAILINK_DEFS(i2s3_rt1015, DAILINK_COMP_ARRAY(COMP_CPU("I2S3")), DAILINK_COMP_ARRAY(COMP_CODEC(RT1015_DEV0_NAME, RT1015_CODEC_DAI), @@ -894,8 +895,6 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { .dpcm_playback = 1, .ignore_suspend = 1, .be_hw_params_fixup = mt8192_i2s_hw_params_fixup, - SND_SOC_DAILINK_REG(i2s3), - .ops = &mt8192_rt1015_i2s_ops, }, { .name = "I2S5", @@ -983,7 +982,7 @@ static struct snd_soc_codec_conf rt1015_amp_conf[] = { }, }; -static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_soc_card = { +static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_card = { .name = "mt8192_mt6359_rt1015_rt5682", .owner = THIS_MODULE, .dai_link = mt8192_mt6359_dai_links, @@ -1000,12 +999,11 @@ static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_soc_card = { static int mt8192_mt6359_dev_probe(struct platform_device *pdev) { - struct snd_soc_card *card = &mt8192_mt6359_rt1015_rt5682_soc_card; + struct snd_soc_card *card; struct device_node *platform_node; int ret, i; struct snd_soc_dai_link *dai_link; - - card->dev = &pdev->dev; + const struct of_device_id *match; platform_node = of_parse_phandle(pdev->dev.of_node, "mediatek,platform", 0); @@ -1014,7 +1012,29 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) return -EINVAL; } + match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); + if (!match || !match->data) + return -EINVAL; + + card = (struct snd_soc_card *)match->data; + card->dev = &pdev->dev; + for_each_card_prelinks(card, i, dai_link) { + if (strcmp(dai_link->name, "I2S3") == 0) { + if (card == &mt8192_mt6359_rt1015_rt5682_card) { + dai_link->ops = &mt8192_rt1015_i2s_ops; + dai_link->cpus = i2s3_rt1015_cpus; + dai_link->num_cpus = + ARRAY_SIZE(i2s3_rt1015_cpus); + dai_link->codecs = i2s3_rt1015_codecs; + dai_link->num_codecs = + ARRAY_SIZE(i2s3_rt1015_codecs); + dai_link->platforms = i2s3_rt1015_platforms; + dai_link->num_platforms = + ARRAY_SIZE(i2s3_rt1015_platforms); + } + } + if (!dai_link->platforms->name) dai_link->platforms->of_node = platform_node; } @@ -1030,7 +1050,10 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id mt8192_mt6359_dt_match[] = { - {.compatible = "mediatek,mt8192_mt6359_rt1015_rt5682",}, + { + .compatible = "mediatek,mt8192_mt6359_rt1015_rt5682", + .data = &mt8192_mt6359_rt1015_rt5682_card, + }, {} }; #endif From patchwork Tue Dec 1 13:21:23 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: 11942951 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.7 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 65373C64E7A for ; Tue, 1 Dec 2020 13:24:14 +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 3FF1C2084C for ; Tue, 1 Dec 2020 13:24:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="fMGxHpV1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="APuRAvqt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FF1C2084C 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 0EB0D178C; Tue, 1 Dec 2020 14:23:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0EB0D178C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606829051; bh=qoqYo6GF9T2jOKtn4cIJjlat/DQdgNLsXAPIDDPnY90=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fMGxHpV14najDgXzrj+Oqcry9NHtmFwA+nNiXPhNeLvTvSaRTLhxyFU4OoPpOMPxe 1G8aM5zXeVIXdIk6b6vhdQIQv7zeHefwEFoKHZu4salUmuxO3a3apwhQLeDJmzwDaS 6A/3DqdsgFvL53HfvhL+SUWvb5PDHMyc6ihLUJXY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BC9ABF804C2; Tue, 1 Dec 2020 14:21:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EA4F2F804CC; Tue, 1 Dec 2020 14:21:55 +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 51F87F804B2 for ; Tue, 1 Dec 2020 14:21:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 51F87F804B2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="APuRAvqt" Received: by mail-yb1-xb49.google.com with SMTP id w8so2375257ybq.4 for ; Tue, 01 Dec 2020 05:21:49 -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=Y0+xH3UGiixm7l2bnHVG2So+xIAjdFpqflSxFA1Eik0=; b=APuRAvqtuiSERCQyVPcccB+bxOGCx5A0FyNSEV3jrf3j19TflrFqJlg/3vy1iKi4L8 5+cHnjxtW4A57QcuwZPgLIEZA7lhaaQZ4+WU+GMQIIRm8znhMq56R2VkEclkmK5p7ry1 Jf8hfEbqMsXwmPp4wIOnRFMCJ0tBC4FT5KXzvBVSHGlAKZxaKaRm0MO/cv7NHxuyLw/i F7tQS23y1MWfC8jO949t6sTi5QcrpEtVBtjl5HSPktymqPn/wNjp+05EtMphWI4zHg0N ZatxlLso6HNKk49ZrkMnLjdVKZCW4jTtupEmSZOmy/3YZTh0olZWeP4cm1jiM5fl2Zqc 40pQ== 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=Y0+xH3UGiixm7l2bnHVG2So+xIAjdFpqflSxFA1Eik0=; b=QG/I3sLcpywFGoVFg1TJGKpfqIba5qnxlkdYFG2V7hfnci5UXx6TppqwF2061MA4Cv 5gDqVZ3isYVBsQlzUuo5IIjCrwKvuQ7DviYPkbe8w2+hcx/sT0W09amr9/+9psSHtjWa gSxa/0hrRiomWmR5LEQNRQKA0TxASIqfqlUIq74KT0TnZfbthMjqZnZEq7rQuctE1n1s cCLWmR65QhXHbIqCKp6WSH2YRDUdwQ90v5NPBMEiPKGCoSnTwnAp5ZEU6+Ai3euVY8ju 1T8GFHq+/J+darbbA0totjb4vrnT4Zk6W6xRs9kKo8za1PqLuY6x3yU0F0cBhmD8B2Ee XViw== X-Gm-Message-State: AOAM532o0ToWQBer3OIOf2DdYC5hItdgFJ2mjQVbm7QQOUR8lJWgK9Dz FTfdjm/g6qa9u/TRDsJm1sc+gxeE0XXJ X-Google-Smtp-Source: ABdhPJw+uhY31tURIc5osY3W//1BfP30OlaPMBzGesuEqYcTQ7v7Mvy836XZyCA4EpOmz8dx4BMiREmV3HyS X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a25:1b45:: with SMTP id b66mr2917469ybb.331.1606828908023; Tue, 01 Dec 2020 05:21:48 -0800 (PST) Date: Tue, 1 Dec 2020 21:21:23 +0800 In-Reply-To: <20201201132126.1676005-1-tzungbi@google.com> Message-Id: <20201201132126.1676005-4-tzungbi@google.com> Mime-Version: 1.0 References: <20201201132126.1676005-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 3/6] ASoC: mediatek: mt8192: move rt1015_rt5682 specific data From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.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" Moves rt1015_rt5682 specific data right before the snd_soc_card definition for neat purpose. Signed-off-by: Tzung-Bi Shih --- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index e841fd32e8cc..0d2cc6800f08 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -33,31 +33,6 @@ static struct snd_soc_jack headset_jack; -static const struct snd_soc_dapm_widget -mt8192_mt6359_rt1015_rt5682_widgets[] = { - SND_SOC_DAPM_SPK("Left Spk", NULL), - SND_SOC_DAPM_SPK("Right Spk", NULL), - SND_SOC_DAPM_HP("Headphone Jack", NULL), - SND_SOC_DAPM_MIC("Headset Mic", NULL), -}; - -static const struct snd_soc_dapm_route mt8192_mt6359_rt1015_rt5682_routes[] = { - /* speaker */ - { "Left Spk", NULL, "Left SPO" }, - { "Right Spk", NULL, "Right SPO" }, - /* headset */ - { "Headphone Jack", NULL, "HPOL" }, - { "Headphone Jack", NULL, "HPOR" }, - { "IN1P", NULL, "Headset Mic" }, -}; - -static const struct snd_kcontrol_new mt8192_mt6359_rt1015_rt5682_controls[] = { - SOC_DAPM_PIN_SWITCH("Left Spk"), - SOC_DAPM_PIN_SWITCH("Right Spk"), - SOC_DAPM_PIN_SWITCH("Headphone Jack"), - SOC_DAPM_PIN_SWITCH("Headset Mic"), -}; - static int mt8192_rt1015_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -971,6 +946,31 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { }, }; +static const struct snd_soc_dapm_widget +mt8192_mt6359_rt1015_rt5682_widgets[] = { + SND_SOC_DAPM_SPK("Left Spk", NULL), + SND_SOC_DAPM_SPK("Right Spk", NULL), + SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), +}; + +static const struct snd_soc_dapm_route mt8192_mt6359_rt1015_rt5682_routes[] = { + /* speaker */ + { "Left Spk", NULL, "Left SPO" }, + { "Right Spk", NULL, "Right SPO" }, + /* headset */ + { "Headphone Jack", NULL, "HPOL" }, + { "Headphone Jack", NULL, "HPOR" }, + { "IN1P", NULL, "Headset Mic" }, +}; + +static const struct snd_kcontrol_new mt8192_mt6359_rt1015_rt5682_controls[] = { + SOC_DAPM_PIN_SWITCH("Left Spk"), + SOC_DAPM_PIN_SWITCH("Right Spk"), + SOC_DAPM_PIN_SWITCH("Headphone Jack"), + SOC_DAPM_PIN_SWITCH("Headset Mic"), +}; + static struct snd_soc_codec_conf rt1015_amp_conf[] = { { .dlc = COMP_CODEC_CONF(RT1015_DEV0_NAME), From patchwork Tue Dec 1 13:21:24 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: 11942953 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.7 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 16D08C64E7B for ; Tue, 1 Dec 2020 13:24:20 +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 47237206B6 for ; Tue, 1 Dec 2020 13:24:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="bKVQiXxo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="qhSswhsb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47237206B6 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 221B917BA; Tue, 1 Dec 2020 14:23:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 221B917BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606829057; bh=a45LvJEi5yUW32woI20swc9c1EFIK39Wx3AULm3q9Eg=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bKVQiXxowK2o0o61jFMKEfcI/NFycFEIwgpuV2xz1VDo6qjLc93Dh3BjUnJjYe2B3 +bGRebO4PhXcGk2wz2/7P3gPG5Goa8+RpdMtFInWM6sscwwyvoYtO/AD2N/QMuMp8m T2rBVLWr2A/zT62pDSmhXGUiy4dIxHZViX4Koi+k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D15B6F804DF; Tue, 1 Dec 2020 14:22:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 90106F804CB; Tue, 1 Dec 2020 14:21:56 +0100 (CET) Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) (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 6BE8FF804C2 for ; Tue, 1 Dec 2020 14:21:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6BE8FF804C2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qhSswhsb" Received: by mail-qv1-xf49.google.com with SMTP id b9so1176457qvj.6 for ; Tue, 01 Dec 2020 05:21:52 -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=YyZbO8wYD/ijX6J9aI2QPdV/RaONINl7Yn5VzMFPwgs=; b=qhSswhsb5wDbOnx0jXyVTTfaskMleFUYxkVHhnA9N9GSk3jQa7UeQH5JGLLxlknO4K 8fu68I7CjvSL1wEEbqT5kvqAn7C0hZ1ui9Gk94IdyKXDKxacmGq1dldjyswWiwPH8e57 L4W6tyM2MLZni3u/MqaQJmrP7LYHAzb04Nl6TxJ6dbYENJh8W1l6awrKJu7F6OJgJXxu GCh4DqzcyhYdLZ0qCB6aedC2OOA1/1RWD5gEH6rEBhFHYEUm2AajuNPCnIVluefj60tg FHZXz6C6zMm7ECSfI832JJfpcDmYvNIiIq9Y6iiU8yvrwVm+v7iZ8KYhja3MQLXk4d4g C5zw== 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=YyZbO8wYD/ijX6J9aI2QPdV/RaONINl7Yn5VzMFPwgs=; b=IC2uLjnc9dzoAjK0QnQ3sqazxA5srmI66VdVRHmTeqccNMoODCXno5fINIRWPN+Mrr thDkW07rpYYTduVWPP7xBdYua3HkMYJeB6Xy/Bi73rs9YZ9D7fOI0HZZmyYKLsln61Lh CDn1Zvix3ah2nM+MyAiSkod8AOjCOm+JwXp3ud7ubFTnvF/mNmDy3Ms3PR9POQnhD+U5 UClZ+QLYmqlgc8rtqIpvbWdr6KBrHR+zHNgtiGLRcs1rzFXNWScleUgJn3AH2qQtE9vI xukAVLBoPpV/zJtSADr47gtWz1xy4sPitOqY8cHbMtuQ+hHZPSfA9vCm4Tr2p1P05gQK WgYA== X-Gm-Message-State: AOAM533chfuC5mOQDBDprCnI0XWQuBPDPlrUpWbFu9u7g1tr+ph2ZDXt /pUlUxr+VI0UZte02UQZzn3L+FO4Eo5C X-Google-Smtp-Source: ABdhPJyFormI9mXL0Q9+tuUktIe1//4k7zlvsdy1O1P5VnktrLLfnS+pFrKPRDJWwXkeJeyOnp1bePZQBu+Z X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a05:6214:40d:: with SMTP id z13mr3035612qvx.60.1606828911769; Tue, 01 Dec 2020 05:21:51 -0800 (PST) Date: Tue, 1 Dec 2020 21:21:24 +0800 In-Reply-To: <20201201132126.1676005-1-tzungbi@google.com> Message-Id: <20201201132126.1676005-5-tzungbi@google.com> Mime-Version: 1.0 References: <20201201132126.1676005-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 4/6] ASoC: dt-bindings: mt8192-mt6359: fix typo in the example From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.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" Both driver "sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c" and DT binding property use underscore version compatible string. Fixes the typo in the example. Signed-off-by: Tzung-Bi Shih --- .../devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml index 342232a61cfb..b336a42bbb16 100644 --- a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml +++ b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml @@ -31,7 +31,7 @@ examples: - | sound: mt8192-sound { - compatible = "mediatek,mt8192-mt6359-rt1015-rt5682"; + compatible = "mediatek,mt8192_mt6359_rt1015_rt5682"; mediatek,platform = <&afe>; pinctrl-names = "aud_clk_mosi_off", "aud_clk_mosi_on"; From patchwork Tue Dec 1 13:21:25 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: 11942955 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.7 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 03734C64E7A for ; Tue, 1 Dec 2020 13:25:08 +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 35E4E207FF for ; Tue, 1 Dec 2020 13:25:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="APCK2jj3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="bCh1RcV3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35E4E207FF 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 4A50E1787; Tue, 1 Dec 2020 14:24:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A50E1787 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606829105; bh=05IqQkYYtx7yVBkhV1sKnCol6I3wx97VPaj9k9sz9HQ=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=APCK2jj3B3vrkmkZCmGS3d6+nDsMfosUIaXZtNLMCOGffWCJtqunhpqJkx6h1gNI4 OB2JRfSaXx/VtIP73QZ/AiOc+6Qp093WRzMuS6ULuQwUrToVh/pb4lTzyxBTPcu4cX Mc9ST/U7FYmy5ns5C9Dh2uDlg0kKx72V/f9KVFm4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 83345F804E6; Tue, 1 Dec 2020 14:22:03 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D4D99F804E0; Tue, 1 Dec 2020 14:22:00 +0100 (CET) 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 B7093F804CA for ; Tue, 1 Dec 2020 14:21:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B7093F804CA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bCh1RcV3" Received: by mail-yb1-xb4a.google.com with SMTP id w8so2375632ybq.4 for ; Tue, 01 Dec 2020 05:21:57 -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=JYH8VKIBKyMDH0Ua+cEyxJiCIfU2UCkNUgqzQ0+FSHQ=; b=bCh1RcV3lkdSB+ESsNi2IjgeDqgqSwlR5wBpVzHp+VsAVK0SCPKuB8xPvGe8iEfohB P/A9kfWqY/4O7UuVuj/1TZ/C4fNdHQL8HFH2WvBLD7NR8/+39m2hegnuDthtmLyFXMuw dTJYeyud2vhV1QTgS98OSZwDqAZUMUvpTbCHsaJgEVn3eJznfA5yJRVvj9QoaujSmsbX jERSeMIPZt7AivGDIBum0sZ73+LmUyyLye4Kcgjgb1579zAabx+AAm8eJrj82B8TEm9Y bL7u7NLg2irgh2v7tzOc26yGy2a+/xv5IMYqYox/bvNOgrsC/J+U6HdouTrK/hXWi1n2 4gZw== 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=JYH8VKIBKyMDH0Ua+cEyxJiCIfU2UCkNUgqzQ0+FSHQ=; b=AWWRsavXvhTlDhORhQvLZ29eNlX93/QCtjEpuSvquDJQDxjOQ89cBLTkaYuzvBSifO hppRin5iT5Mh3frUlY1KeNyXn50Ihbi0t105ESgyIEujiUt9azUXq9vAElWeJtU0n3GD cIq812B14njIcPw9nzPwGI6jQmg4Fjl/MJUGhgKISPHYUhD9TpBeqEXj1n/45wUmqNrb 0GWHbiikZX9I72lFCZ6SxFsQtXATAfMUv6ShUWdNT/i+qWzgr6eWf0MGG7Y21UpRejyA U8u569pYdAoIHyeYuJtI0IPBiBJOjycnFKHbazy7tEHfT+tRFb6uewD3fwCmWm2XIEhB fa+g== X-Gm-Message-State: AOAM530BNzcaI9pohi7CSbZ5t7SMQEhrQrcSOBj8+C5dputDgI3Y2leU xqluLHX07z2jbQuLvckRtbgAiepNKBQE X-Google-Smtp-Source: ABdhPJzHFhzDxNs1EtHKiNCBDwNBT3/Igi8dCG5KZOj6ziQ/PXkFbKcM79RhH4DrGPZWaQVgKUT/qgmTFdyr X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a25:5689:: with SMTP id k131mr4997526ybb.257.1606828915829; Tue, 01 Dec 2020 05:21:55 -0800 (PST) Date: Tue, 1 Dec 2020 21:21:25 +0800 In-Reply-To: <20201201132126.1676005-1-tzungbi@google.com> Message-Id: <20201201132126.1676005-6-tzungbi@google.com> Mime-Version: 1.0 References: <20201201132126.1676005-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 5/6] ASoC: dt-bindings: mt8192-mt6359: add new compatible for using rt1015p From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.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 new compatible string "mt8192_mt6359_rt1015p_rt5682" for machines with rt1015p and rt5682. Signed-off-by: Tzung-Bi Shih --- .../bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml index b336a42bbb16..bf8c8ba25009 100644 --- a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml +++ b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml @@ -15,7 +15,9 @@ description: properties: compatible: - const: mediatek,mt8192_mt6359_rt1015_rt5682 + enum: + - mediatek,mt8192_mt6359_rt1015_rt5682 + - mediatek,mt8192_mt6359_rt1015p_rt5682 mediatek,platform: $ref: "/schemas/types.yaml#/definitions/phandle" From patchwork Tue Dec 1 13:21:26 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: 11942957 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.7 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 0801FC64E7B for ; Tue, 1 Dec 2020 13:25:14 +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 D55E22084C for ; Tue, 1 Dec 2020 13:25:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="I6cvSNrn"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="RpVqbs7y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D55E22084C 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 3E76017AA; Tue, 1 Dec 2020 14:24:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3E76017AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606829111; bh=k8NR5XKvM3eZqA9cBL/lGpKp3+xtQCAzKDgPKM4l4rw=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=I6cvSNrnoAod9+eNkLtppzdegh74MJiA1RoNPtugI1MxAJn6as8lgkcq3wwGNPSj4 j1/hR7Y2fGAMTUXfHEUZbmCKd2VEx0dFdtjTCNBjAiHlRgUBEyIUZ0uY1jNPHg9Uz7 4gKo81BZ8M9towjaLG7/RGBKIj0rqhC0JdkFNQvo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 68DAEF804ED; Tue, 1 Dec 2020 14:22:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A767DF804F1; Tue, 1 Dec 2020 14:22:06 +0100 (CET) Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) (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 25BA2F804E4 for ; Tue, 1 Dec 2020 14:22:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 25BA2F804E4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="RpVqbs7y" Received: by mail-pl1-x64a.google.com with SMTP id g1so1155948plt.20 for ; Tue, 01 Dec 2020 05:22:01 -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=SQuaclQlbq8ZR5gX0U6eAnPIjuDHifr/n0O8Gkw3oUU=; b=RpVqbs7ynMH3NNQT4S1PXbyqF/CMbc1ixN5x7ChO1BjkRikK+e50o8hcwzcu4Mp1Pt s+tBbS4rzTY4HFuj6LNIJ9q6GHU/7fhZ7AIt0775ecyyG1Z9xEjD6SnM8zvLjUoYhUTU 0KRDUqZMSb1ISs+FVvM179UCAX0AEdU7YcZV0ua6j4//Nk2mfSvZQffIfXZ8mrUh66xG /Dv5bX7WFR/xHkA+OZajRbq1T9omQT84+wx/wzBZayiFprPyowD155ywBnj6SXgUHkSe BRu1bcypFI2tangbCo2tfZy+82fH/3NDcL9GZhk+swBKvegp8SEPTu2qlaSYobGmrwyB IOog== 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=SQuaclQlbq8ZR5gX0U6eAnPIjuDHifr/n0O8Gkw3oUU=; b=Cx6puck/lA9B7MpsRI2zg8I3V+Lg3UEoutMJtiPWolirO0aynAQ5MoqeiV7Sv8YYBu J3K4Eg7pqQwSBu3LbTdXqv8zFDBwHIHkP9wCwSl4F4lH0dovHAzCtSL3sEbD5l/UuzUW 8QT5yX33LMK9PnDDBOAzasSy/FwMAdowdYOy1MU+Z00BwK82MH9lZDQ/okWmkjoRUNxL SCaK7IKrNQ7kv0yxDqxCKJtIm9Kyr9q0judoaNeSI/AOco/APGNEk4yj7SfvwTc5fK+P bXI5ds+x45S89PxPWJlIP6NHAQghp5ayM1Dnh3V30kC4zIQtynqSvf4Ug0K8dm43yUvP bBOg== X-Gm-Message-State: AOAM5332F1ntINcTluc8kKrHSgLlESXA9XtMfbFvkbn0Cwn6DbzBGSGf ywEZosdX42IEXaFuzx451ku910OfR1uF X-Google-Smtp-Source: ABdhPJwJapXM6q6N8qV6oCXV3BWNBIZODrsiHcJh/5DycnpjqLvjymq2OQLT4NzLtuN1N8enqPCcGN086IWX X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:725a:fff:fe41:c6a5]) (user=tzungbi job=sendgmr) by 2002:a17:90a:aa87:: with SMTP id l7mr2579337pjq.167.1606828919744; Tue, 01 Dec 2020 05:21:59 -0800 (PST) Date: Tue, 1 Dec 2020 21:21:26 +0800 In-Reply-To: <20201201132126.1676005-1-tzungbi@google.com> Message-Id: <20201201132126.1676005-7-tzungbi@google.com> Mime-Version: 1.0 References: <20201201132126.1676005-1-tzungbi@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 6/6] ASoC: mediatek: mt8192: support rt1015p_rt5682 From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.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" Supports machines with rt1015p and rt5682. Uses new proposed compatible string "mt8192_mt6359_rt1015p_rt5682". Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/Kconfig | 1 + .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index 49772dfc92c7..8d3dcfb6a580 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -175,6 +175,7 @@ config SND_SOC_MT8192_MT6359_RT1015_RT5682 depends on SND_SOC_MT8192 select SND_SOC_MT6359 select SND_SOC_RT1015 + select SND_SOC_RT1015P select SND_SOC_RT5682_I2C select SND_SOC_DMIC help diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index 0d2cc6800f08..716fbb4126b5 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -560,6 +560,11 @@ SND_SOC_DAILINK_DEFS(i2s3_rt1015, RT1015_CODEC_DAI)), DAILINK_COMP_ARRAY(COMP_EMPTY())); +SND_SOC_DAILINK_DEFS(i2s3_rt1015p, + DAILINK_COMP_ARRAY(COMP_CPU("I2S3")), + DAILINK_COMP_ARRAY(COMP_CODEC("rt1015p", "HiFi")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + SND_SOC_DAILINK_DEFS(i2s5, DAILINK_COMP_ARRAY(COMP_CPU("I2S5")), DAILINK_COMP_ARRAY(COMP_DUMMY()), @@ -997,6 +1002,41 @@ static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_card = { .num_configs = ARRAY_SIZE(rt1015_amp_conf), }; +static const struct snd_soc_dapm_widget +mt8192_mt6359_rt1015p_rt5682_widgets[] = { + SND_SOC_DAPM_SPK("Speakers", NULL), + SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), +}; + +static const struct snd_soc_dapm_route mt8192_mt6359_rt1015p_rt5682_routes[] = { + /* speaker */ + { "Speakers", NULL, "Speaker" }, + /* headset */ + { "Headphone Jack", NULL, "HPOL" }, + { "Headphone Jack", NULL, "HPOR" }, + { "IN1P", NULL, "Headset Mic" }, +}; + +static const struct snd_kcontrol_new mt8192_mt6359_rt1015p_rt5682_controls[] = { + SOC_DAPM_PIN_SWITCH("Speakers"), + SOC_DAPM_PIN_SWITCH("Headphone Jack"), + SOC_DAPM_PIN_SWITCH("Headset Mic"), +}; + +static struct snd_soc_card mt8192_mt6359_rt1015p_rt5682_card = { + .name = "mt8192_mt6359_rt1015p_rt5682", + .owner = THIS_MODULE, + .dai_link = mt8192_mt6359_dai_links, + .num_links = ARRAY_SIZE(mt8192_mt6359_dai_links), + .controls = mt8192_mt6359_rt1015p_rt5682_controls, + .num_controls = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_controls), + .dapm_widgets = mt8192_mt6359_rt1015p_rt5682_widgets, + .num_dapm_widgets = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_widgets), + .dapm_routes = mt8192_mt6359_rt1015p_rt5682_routes, + .num_dapm_routes = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_routes), +}; + static int mt8192_mt6359_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; @@ -1032,6 +1072,16 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) dai_link->platforms = i2s3_rt1015_platforms; dai_link->num_platforms = ARRAY_SIZE(i2s3_rt1015_platforms); + } else if (card == &mt8192_mt6359_rt1015p_rt5682_card) { + dai_link->cpus = i2s3_rt1015p_cpus; + dai_link->num_cpus = + ARRAY_SIZE(i2s3_rt1015p_cpus); + dai_link->codecs = i2s3_rt1015p_codecs; + dai_link->num_codecs = + ARRAY_SIZE(i2s3_rt1015p_codecs); + dai_link->platforms = i2s3_rt1015p_platforms; + dai_link->num_platforms = + ARRAY_SIZE(i2s3_rt1015p_platforms); } } @@ -1054,6 +1104,10 @@ static const struct of_device_id mt8192_mt6359_dt_match[] = { .compatible = "mediatek,mt8192_mt6359_rt1015_rt5682", .data = &mt8192_mt6359_rt1015_rt5682_card, }, + { + .compatible = "mediatek,mt8192_mt6359_rt1015p_rt5682", + .data = &mt8192_mt6359_rt1015p_rt5682_card, + }, {} }; #endif