From patchwork Fri Jan 22 10:07:39 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: 12038799 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, TVD_SPACE_RATIO,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 D306BC433DB for ; Fri, 22 Jan 2021 10:09:47 +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 DCE61235E4 for ; Fri, 22 Jan 2021 10:09:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCE61235E4 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 30FE01ADF; Fri, 22 Jan 2021 11:08:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 30FE01ADF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611310184; bh=JobWVsImbx/HeNrz380pUlxc9lbAmVEgSclfNk4Flec=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IC8v5kSo0iQnj/K5Dvt5SULay7fbBMP7AIlbaxbtDCCxLNqk4VlrwFyp3xwlWpa4W eeircREvu5mfPOwOezsLdVG1u+eGiLO+0dmP0p4mv87X2iatEvh525/uBDh1yMhY2k gqnLznQoAMOcqPeZpLzyx97qDnxBUxa2+E4jWHjs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DEFBCF8019B; Fri, 22 Jan 2021 11:08:04 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A6CDF8019B; Fri, 22 Jan 2021 11:08:03 +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 7D2F0F80166 for ; Fri, 22 Jan 2021 11:07:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7D2F0F80166 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CAKTvPaK" Received: by mail-pl1-x64a.google.com with SMTP id c5so2817749plr.4 for ; Fri, 22 Jan 2021 02:07:58 -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=lqV301/f4HwfH+PWft19AnXErmDhDNoZA8wK7+4bESc=; b=CAKTvPaKGPHx6JA99/PRgf/mZEk5M4yQS/Bx/RZhlLLB3pAqXeHq2CADMLem+Oiaeu pqnVU1L6komSngDhQGZ1pKCbDEbFCcwUhNuAM50mo5jvXXkU2OuioCyJyXQrytcDSrAR PHbYdXd61CRRWCg2DrLfec6oqpFi3Vkm3LMNtb55CVkrAhp021lhXmOQ9Wy1RGbN1YWE t45lGgswT2jDM6X96h1SSWMDViGiHYDaXbrym0k6/W6zuiIbTfa3U0722yuTT8k3Osmv kzxofyausxkJL+XAjTRLhDks1Lxe4Y8EW/58+yHe872EVzBrhsZpcJvE7Tu8UXLf+dlq IJcA== 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=lqV301/f4HwfH+PWft19AnXErmDhDNoZA8wK7+4bESc=; b=ezk6ScKBwx8gEGi7VC+YegiiW9S7IdMb0Pn5YtCPwSELd7uFPjVtoC5yptUA9ZQ+xy +9mRqgn9ij22AUC1l4/kjn9/m534DnqZov8DNfmDcjkbahugEVVKaF8grXU7cWnEDVtB PnprFharynP60SYYqhe0y3h3CaROv7thMN24e/mVqx7EAprILupFPuZAKeK5mvlUt+ae 6E/boDl+AotGa19v9+qnE2xUYhbJRAMQotLnKRxJe88gWaygD1tkGOSSg+ogfck5P7aM HRvhdTaFFpYz/NIanbW1crGgi00wfaoJ6VUGFQ2i20uyWjHcdUkLhND8jIw4lUV1b0Om 4f0g== X-Gm-Message-State: AOAM5305zqN5bA8hiGp7xWfxX39/+t3coh+sXZu/n+xM7RaO3lEWdXGF ilcB8k16ml2QIDknEh9JXdSXkMm0PS6u X-Google-Smtp-Source: ABdhPJwCzaO7gucZTlP+cSjbZjTzkI764wa7qqapxJPVLKtZQc0tHf9zazmJwuFXOvmKXlVI9/2QP7WhBWHK X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:4552:5bc1:d50a:b3ff]) (user=tzungbi job=sendgmr) by 2002:a17:903:230f:b029:dc:9b7f:bd0e with SMTP id d15-20020a170903230fb02900dc9b7fbd0emr3717278plh.47.1611310074804; Fri, 22 Jan 2021 02:07:54 -0800 (PST) Date: Fri, 22 Jan 2021 18:07:39 +0800 In-Reply-To: <20210122100742.3699128-1-tzungbi@google.com> Message-Id: <20210122100742.3699128-2-tzungbi@google.com> Mime-Version: 1.0 References: <20210122100742.3699128-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH 1/4] ASoC: mediatek: mt8192-mt6359: use asoc_substream_to_rtd() 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" Uses asoc_substream_to_rtd() helper. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index cc0fc72305d2..f5c1c10408c9 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -39,7 +39,7 @@ struct mt8192_mt6359_priv { static int mt8192_rt1015_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_card *card = rtd->card; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *codec_dai; @@ -74,7 +74,7 @@ static int mt8192_rt1015_i2s_hw_params(struct snd_pcm_substream *substream, static int mt8192_rt5682_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_card *card = rtd->card; struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); @@ -362,7 +362,7 @@ static int mt8192_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static int mt8192_mt6359_rt1015_rt5682_cap1_startup(struct snd_pcm_substream *substream) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); From patchwork Fri Jan 22 10:07:40 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: 12038801 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 8BDB4C433DB for ; Fri, 22 Jan 2021 10:09:50 +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 D2F40239EF for ; Fri, 22 Jan 2021 10:09:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2F40239EF 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 26E131AE4; Fri, 22 Jan 2021 11:08:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 26E131AE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611310188; bh=DW/L42FzV0B1yJ5q6SNG8Ti1I20WNptRWTBTA5tAQ4k=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=M2XqU/C4/u0wjRIxFrGvAs0p2Biodsu0o8+UjBuOmhtLVtkvIuyj9S06D4/W9DUrO KZgrOKSsS+8AeXHUQcDN+UVB4i9HWwtxyOmZdPOkpJnnvcle3qIHdMeZHSCdTWSjOh pKtQf6qd65WaZSTmFYlcGhhEE0A8JI0ZKW9zTsno= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 85456F804BD; Fri, 22 Jan 2021 11:08:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B1B33F804BD; Fri, 22 Jan 2021 11:08:07 +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 3D3CAF80218 for ; Fri, 22 Jan 2021 11:08:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D3CAF80218 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Z0v6Y+wS" Received: by mail-yb1-xb49.google.com with SMTP id y1so4996029ybe.11 for ; Fri, 22 Jan 2021 02:08: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=v0aGf6GESKmGuuzroZCK6d4SzanQPWilzAzV1+qKSgM=; b=Z0v6Y+wSq4pyl+Q1641+wtOBTgshl6SBfhuUkWX8uKyijVdB85/3ARoRx2Teg36e13 tm1oQvUq03VVqaI5eFIGpqLRx94cyCEAguUy/EqS6xnbyHKJA0cGX3M/Nfy/tOQALg9Z RBISXcmnSRhP7rFDBq2KUnyjAoD1rcQpQq9vPH+/XI639ndRWpsd/JGhTrTfLhQslu1c UYEIyJcOR6mVjZfGgDqrQGi7K9lkL/JMx7So2RmEYvhRKBM763mLpW7yUPou4Re8azHV J644Wmn7L6kVEex6gxOxAFqeTxWaeTHgZoqmWmvxDDsSx0qSyDSkIA7+NePrIjQagu51 Nv6w== 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=v0aGf6GESKmGuuzroZCK6d4SzanQPWilzAzV1+qKSgM=; b=U8rjKMBgP694wwE//+vnCGwGHiKQLYIQWDuGc0b/sn4XDw8bIzKs3df5zlYB77dT07 pX6uPuq0/qXj+1Uglxy/ONblbhnBQHXf5c3CKAgfQcsnbrIa/28kVqea4k8fXslqYJRM t56KJpZRrN34UILtYXRPDoLHewvv6rgtE+r1zuhrNfUwyPkN2jafvWWdOAHPerp60G3r uMv+cCeBOQmAA+MprRMtVRx0ttAyb82GTWveCuWBmysOZNUMyaS3UVV6twlxvvGsGLY7 4HtUoxAs8FR5jm/C2nbKSexfCbLahJ3okJGjHyMQYtFbPIwM43e6bUh3xMKPx9TpHFPQ GA8Q== X-Gm-Message-State: AOAM531wAU6sDBpEhv8STeKA8apkTNgu3m6Q6s5kEsR9wK20UoMev0kG AAQtnRC1T+Y2ed8ZQouq31NJ9XdYix1p X-Google-Smtp-Source: ABdhPJy3aywJ0ct+IKjL8LxDV0+crdoO7BMWrjlfPz6ZeLnP8ySUM05lXS/byJJSxRIEPK24ORT6Uc3gPxv2 X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:4552:5bc1:d50a:b3ff]) (user=tzungbi job=sendgmr) by 2002:a25:ca09:: with SMTP id a9mr5463018ybg.48.1611310078441; Fri, 22 Jan 2021 02:07:58 -0800 (PST) Date: Fri, 22 Jan 2021 18:07:40 +0800 In-Reply-To: <20210122100742.3699128-1-tzungbi@google.com> Message-Id: <20210122100742.3699128-3-tzungbi@google.com> Mime-Version: 1.0 References: <20210122100742.3699128-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH 2/4] ASoC: mediatek: mt8192: use asoc_substream_to_rtd() 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" Uses asoc_substream_to_rtd() helper. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c index e7fec2d75e3d..7a1724f5ff4c 100644 --- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c +++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c @@ -42,7 +42,7 @@ static const struct snd_pcm_hardware mt8192_afe_hardware = { static int mt8192_memif_fs(struct snd_pcm_substream *substream, unsigned int rate) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); @@ -59,7 +59,7 @@ static int mt8192_get_dai_fs(struct mtk_base_afe *afe, static int mt8192_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); From patchwork Fri Jan 22 10:07:41 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: 12038803 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 A9CDAC433E0 for ; Fri, 22 Jan 2021 10:10:37 +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 8DA23239EF for ; Fri, 22 Jan 2021 10:10:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DA23239EF 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 D9F071AF4; Fri, 22 Jan 2021 11:09:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D9F071AF4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611310234; bh=JSrcH25uU6k+4IdJ0WxUZZ9HydDPuRmuHb50hFIQ3pc=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DcU0MWqXAiIgLm7iPoFJKTgePk7eS4BLwQEdOcA8Dn2yVAFLr80BMDJMhncoxSG0c EXr4qW4dDDDzJx1yXsq+rEyIVSE/KYBrXpTow4jgsJt1GQuM52FwyqFsJxJJBQxlLW T7XMbGrK2nH6n3gzNGV+KV4DPMVk/RWgWBCcQMUE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2A8FCF804DF; Fri, 22 Jan 2021 11:08:14 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C65DBF804DF; Fri, 22 Jan 2021 11:08:12 +0100 (CET) Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) (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 7ED1CF80218 for ; Fri, 22 Jan 2021 11:08:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7ED1CF80218 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gQb84yUJ" Received: by mail-qt1-x84a.google.com with SMTP id d26so3246660qto.7 for ; Fri, 22 Jan 2021 02:08:05 -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=mpdOlUQG7HCH3v6aSqXckNjDcNbTAl3Fz0V1ytYnX38=; b=gQb84yUJnfXmWVFSvExrzLPdjHMQZfJHtT0Zx438VwFU3iQcpiZOAQPjtoLLFY0B6o Sjnpe+HYiFFxYbKFYbd+GOQTlVPSN3CVhLnDjJ/fJ0vjY80R2dvLEd+NEAXdbEyxbf9d mZ6RFRiCX7iYFhi02ItKuYpQufoj+uth6VoAw2Q40HPEoRbsOaknXFCNf73FfzqfBm2W tRIivHTQ6NbbgoP4OQdbS6yoN1jKCi3sjiYagNcNfTMwX9TWEi666G6sZpbyGHzTRkRd vxpjo9DwX7YmzdUCESBGWqSzVzsUbmHQo7WGrlZrCRoYCr+mWnRBZGf7R5i7/YZtDakp /w7w== 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=mpdOlUQG7HCH3v6aSqXckNjDcNbTAl3Fz0V1ytYnX38=; b=VsgbKcVO59nqENXBNy7bVWacjwj5Dh/opRplX440RFT3fS7aT8I98n82L+s8Ch1hbr mR5rsjJKecP2KRDY4XruT1ZujZf59rZliulJ9aGGKIRicaAF8yvsWq5h+Nf2iAah7c1m 58fXolUpoJpRzNi1s5pVH2NPR6wnIAzECUKcESx6qhc7jJA+7qOvHzxAvnM5+Ezsi/Z4 E91p+z42iIGJ9aHXzjK6Iw01+7s4xK4hfl3JEzv7RAQra7CkMGn3ZrjJyDijd2E2Aqdx N3oOGrb5QZhCJHAADbQaBotBTvsXZolbKMLe4NJRE1RoO2YVqvIxKkahXywJalB14JPN cKXg== X-Gm-Message-State: AOAM533UhJwZvlq6gKE9AJ9IqlNnvHQ3xoX8kRrSXiwaa1L/eTpGjgAb hqAlTdIyfvFlePLRC0o9QkwGyqTH/G+x X-Google-Smtp-Source: ABdhPJz5Bia5WknNGmpRpRe3GnYpkvei+Ebh1fW3g09SQRzznPNAgPoy6OstoeS2SLsCG1xPiizbh7hdtSxZ X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:4552:5bc1:d50a:b3ff]) (user=tzungbi job=sendgmr) by 2002:ad4:4108:: with SMTP id i8mr3512825qvp.49.1611310081790; Fri, 22 Jan 2021 02:08:01 -0800 (PST) Date: Fri, 22 Jan 2021 18:07:41 +0800 In-Reply-To: <20210122100742.3699128-1-tzungbi@google.com> Message-Id: <20210122100742.3699128-4-tzungbi@google.com> Mime-Version: 1.0 References: <20210122100742.3699128-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH 3/4] ASoC: mediatek: mt8192-mt6359: simply ops for Capture1 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" 1. Uses rtd->dev to get the device. 2. Generalizes the variable name. Signed-off-by: Tzung-Bi Shih --- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index f5c1c10408c9..f4b09672af8f 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -360,14 +360,8 @@ static int mt8192_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, } static int -mt8192_mt6359_rt1015_rt5682_cap1_startup(struct snd_pcm_substream *substream) +mt8192_mt6359_cap1_startup(struct snd_pcm_substream *substream) { - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct snd_soc_component *component = - snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); - struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); - int ret; - static const unsigned int channels[] = { 1, 2, 4 }; @@ -385,13 +379,15 @@ mt8192_mt6359_rt1015_rt5682_cap1_startup(struct snd_pcm_substream *substream) .mask = 0, }; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_pcm_runtime *runtime = substream->runtime; + int ret; ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &constraints_channels); if (ret < 0) { - dev_err(afe->dev, "hw_constraint_list channels failed\n"); + dev_err(rtd->dev, "hw_constraint_list channels failed\n"); return ret; } @@ -399,15 +395,15 @@ mt8192_mt6359_rt1015_rt5682_cap1_startup(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); if (ret < 0) { - dev_err(afe->dev, "hw_constraint_list rate failed\n"); + dev_err(rtd->dev, "hw_constraint_list rate failed\n"); return ret; } return 0; } -static const struct snd_soc_ops mt8192_mt6359_rt1015_rt5682_capture1_ops = { - .startup = mt8192_mt6359_rt1015_rt5682_cap1_startup, +static const struct snd_soc_ops mt8192_mt6359_capture1_ops = { + .startup = mt8192_mt6359_cap1_startup, }; /* FE */ @@ -720,7 +716,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { SND_SOC_DPCM_TRIGGER_PRE}, .dynamic = 1, .dpcm_capture = 1, - .ops = &mt8192_mt6359_rt1015_rt5682_capture1_ops, + .ops = &mt8192_mt6359_capture1_ops, SND_SOC_DAILINK_REG(capture1), }, { From patchwork Fri Jan 22 10:07:42 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: 12038805 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 9443AC433DB for ; Fri, 22 Jan 2021 10:10:44 +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 01130239EF for ; Fri, 22 Jan 2021 10:10:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01130239EF 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 1498E1AE5; Fri, 22 Jan 2021 11:09:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1498E1AE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611310242; bh=LUKqp8zqxEUdgBwtwNKAn/i6W9Y5KlxQ8UolIAMkn5Q=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Lvt8j4FQUqVRddQCqDU+wZoBEinbCNAI81oTaNdNRIN8fqOqlQxIqjQtoOLznmHNS apPEGZ4we+GkRbKRs1DhXQYpdVTIWN3az6bou4LvvFdD4YZQEdD3pZmzv6Wvw7Vge+ +9pSInjkRmsLVV6awrFrAmED4OldUC+YFPbRk6ao= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3ED02F804E3; Fri, 22 Jan 2021 11:08:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 95CD6F804E3; Fri, 22 Jan 2021 11:08:15 +0100 (CET) Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) (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 A6234F804D6 for ; Fri, 22 Jan 2021 11:08:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6234F804D6 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EtDTq9s2" Received: by mail-qk1-x749.google.com with SMTP id i82so3656813qke.19 for ; Fri, 22 Jan 2021 02:08:09 -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=VT8zktz3TEuCCmQwwCyPljrpKbHnT0KhRcyC9M4v2Tk=; b=EtDTq9s2q602ngX2RA2foe1xZBNf3l1Y5VikPZ/qc430h0+pFqC8VaR0DMZhqQvG5D ojpuL7MzZCOEOJUtXW5fdwFQBSkmSry8Stop5R7jjLxKZeqUkbzThULAAT63lz5QV5qK wZCvrJPFDLcJClUOg/l5JUdLFgqh5YVAXRoln1v6IwpYrZJ2My87e6ACe2ZOjGk84u8D KBE79NCuAXJHGMdLvQG+ar2LpRf+NHPZs56D5Wj1e0DflI4F4AJn+zmlklvT2KNd9vsi vxPYjtD1XtKHordn8Tvh66aZzplrHsjgXZktDRz6Lg6UgsUeBWxTC0PWlss+rr+SjuV8 hAaA== 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=VT8zktz3TEuCCmQwwCyPljrpKbHnT0KhRcyC9M4v2Tk=; b=IIzwpX8A597Wu1k0h7RACP93LqWCXbT5cQNoB5RnpGw5+D/mxiWgBEw9hQ+J3c2WjQ i2CxQQhrZex7z055VaE2CQJrmjhYfmHOvdg8UpoWPjnCjw78n0+SSfIQb4XHnugKjrQX i7lS4kM27BayYBf9nBzQlK+XatFX5eBdBntpz/rqh5PLWLHgIMXUygIeZuDnPJd+Ygk2 WYztYo3pp5wxRv+4lurC9Ta4CW0LU3th7EU8Izi3FPpqD8J1q8X2MTwQa9IQEsRN+MVV H1pGArtDgyk3mJn/Lj3BCStB2cOkSFdY6SR69ozelMjxb24BVXkPnQg2vXNaHNdCRo7B WOHA== X-Gm-Message-State: AOAM530YOS5KMVQru3tGHZHhm1PF9s4jUir8doQPbViyfH7bRgkvghSi HnqiFd9RaOhuIAunDKqZ6RTR1sFSJQP9 X-Google-Smtp-Source: ABdhPJwwQ0e+ZbLtxylzuXJVDTJwTtYcukwPhfStqB4s/8MdP+MmRFcXgVQzCRyk6uxUbG8eyRPMwACV0q6l X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:4552:5bc1:d50a:b3ff]) (user=tzungbi job=sendgmr) by 2002:ad4:4e8a:: with SMTP id dy10mr3719151qvb.14.1611310085892; Fri, 22 Jan 2021 02:08:05 -0800 (PST) Date: Fri, 22 Jan 2021 18:07:42 +0800 In-Reply-To: <20210122100742.3699128-1-tzungbi@google.com> Message-Id: <20210122100742.3699128-5-tzungbi@google.com> Mime-Version: 1.0 References: <20210122100742.3699128-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH 4/4] ASoC: mediatek: mt8192-mt6359: add format constraints for 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" There is only 1 set of I2S in between MT8192 and RT5682. Adds format constraints to the corresponding DAI links to make sure the settings are symmetric. Signed-off-by: Tzung-Bi Shih --- .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index f4b09672af8f..a606133951b7 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -406,6 +406,53 @@ static const struct snd_soc_ops mt8192_mt6359_capture1_ops = { .startup = mt8192_mt6359_cap1_startup, }; +static int +mt8192_mt6359_rt5682_startup(struct snd_pcm_substream *substream) +{ + static const unsigned int channels[] = { + 1, 2 + }; + static const struct snd_pcm_hw_constraint_list constraints_channels = { + .count = ARRAY_SIZE(channels), + .list = channels, + .mask = 0, + }; + static const unsigned int rates[] = { + 48000 + }; + static const struct snd_pcm_hw_constraint_list constraints_rates = { + .count = ARRAY_SIZE(rates), + .list = rates, + .mask = 0, + }; + + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + int ret; + + ret = snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + if (ret < 0) { + dev_err(rtd->dev, "hw_constraint_list channels failed\n"); + return ret; + } + + ret = snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + if (ret < 0) { + dev_err(rtd->dev, "hw_constraint_list rate failed\n"); + return ret; + } + + return 0; +} + +static const struct snd_soc_ops mt8192_mt6359_rt5682_ops = { + .startup = mt8192_mt6359_rt5682_startup, +}; + /* FE */ SND_SOC_DAILINK_DEFS(playback1, DAILINK_COMP_ARRAY(COMP_CPU("DL1")), @@ -653,6 +700,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { SND_SOC_DPCM_TRIGGER_PRE}, .dynamic = 1, .dpcm_playback = 1, + .ops = &mt8192_mt6359_rt5682_ops, SND_SOC_DAILINK_REG(playback3), }, { @@ -726,6 +774,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { SND_SOC_DPCM_TRIGGER_PRE}, .dynamic = 1, .dpcm_capture = 1, + .ops = &mt8192_mt6359_rt5682_ops, SND_SOC_DAILINK_REG(capture2), }, {