From patchwork Mon Jan 25 06:20:01 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: 12042981 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=-13.9 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=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 B47A9C433E0 for ; Mon, 25 Jan 2021 06:22: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 BB47422CA2 for ; Mon, 25 Jan 2021 06:22:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB47422CA2 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 2E6FF1865; Mon, 25 Jan 2021 07:21:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2E6FF1865 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611555723; bh=/CjGTujXibCK/ajlKG8q0Pxae3UQeMRj7KlvcBroUj8=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lukFhmi/r03XImto85vXr2Q2j7qm4cxICgr7fDIma1hq37Qgppa9b3SgROqXWmugs MaYkYNzV8wPwxHeuuCfRMZqGPMt8SDONCBQOHfHaCEDRH55mcvxitXv4D2UpmEGAYf yczbsp4Kh5rHoHIlUI8InUIeHwlgU3b+rRfrqLGI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C745BF80260; Mon, 25 Jan 2021 07:20:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 621A4F80278; Mon, 25 Jan 2021 07:20:23 +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 61E9BF80130 for ; Mon, 25 Jan 2021 07:20:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 61E9BF80130 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qenXZMIi" Received: by mail-pg1-x54a.google.com with SMTP id 139so7399856pgd.11 for ; Sun, 24 Jan 2021 22:20: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=Ft+RTc9XrDHI7UBxU6EIvS5RRmiSWKiJe9+aA1ZHsS0=; b=qenXZMIiZ5C80BGOOzLbZiqr0Ss4lTUDTzrAfOghwOIo3KL1MAx3PptJ+JoNmQ75G7 D3L17GOzMGitVzjD7Nn4mQP2Nr7m2r2blJ17k3PSZt5UStdQnts24RwORNPNNyfPGroV WE4eF0jPonDdIbcsre8o83Je5msVgMPPzF/iY0ETKfi9TJumeqLPd7hmF4WadZKZLEoC 0/94yXOHIOHwbuzjSAYLt6BMVD+Vn87Mnl0fO8/xDAqGXUYnpdoU7bhujc6IEkSrYTZZ e39CZlV7Pzf7OEialsai7vyZOKRVPFFDrsQ8IMJwqpsDfT218Cu9JJaBnkNjZt7c1TQv Dtug== 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=Ft+RTc9XrDHI7UBxU6EIvS5RRmiSWKiJe9+aA1ZHsS0=; b=C9UIzXz3tt2jORnC23uqoCFPCtpDcEPk6SnShuhUmZ0OECrNVVkii4LTPm1w+2/DrU Z82t4W2dwS0k6hq8ReIXYaYDriVH+nJn6F1aP6loIKbLNx86rsNC/xiHgjbJqtMMo5ab owbjeISET7fygQQdRNNi+kVcZX070DKVJ2t0WkJUA2ofGaKTgw0+gzpu9YDYRgAZJPOS x6CdA5IHNTyQo7071lI/5CKQtl1oit/5FLbEZQdiF39une3blyqrRdO5LHPeSJPtQ7YW CLB0mbm5ANzcQEvxQKTJIoHk6X0/Yf1+UQxcaPO45iyFoV3wXzAu4J3ljYk7DWllN6E7 fc/Q== X-Gm-Message-State: AOAM531UmL+RTQEQCVAkYbs789fXxUtnF7RvR4H+s2WlizIWbcFbLD3o YLRmDXll0PgMlOrDzPit9HuejGtrCDjG X-Google-Smtp-Source: ABdhPJzEFrGqcrcK4wJQwaBQAoVEugPTnlqW2YIp3BUccvGgljpUbb6tLnzT5eUu5zkVb6OTrGOygNYRnqgc X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:b870:8946:4704:f6a0]) (user=tzungbi job=sendgmr) by 2002:aa7:99db:0:b029:1ba:5263:63c4 with SMTP id v27-20020aa799db0000b02901ba526363c4mr16252724pfi.53.1611555616472; Sun, 24 Jan 2021 22:20:16 -0800 (PST) Date: Mon, 25 Jan 2021 14:20:01 +0800 In-Reply-To: <20210125062003.1221810-1-tzungbi@google.com> Message-Id: <20210125062003.1221810-2-tzungbi@google.com> Mime-Version: 1.0 References: <20210125062003.1221810-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH v2 1/3] 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 c368236d8a3a..d2ebf3b6e359 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 Mon Jan 25 06:20:02 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: 12042983 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 37DC8C433DB for ; Mon, 25 Jan 2021 06:22:09 +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 91BB122CA2 for ; Mon, 25 Jan 2021 06:22:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91BB122CA2 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 25DB41875; Mon, 25 Jan 2021 07:21:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 25DB41875 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611555727; 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=mm2cKSBkAeUkNuclJlJzqMFJNwqyWst1CKUcFiI8d//oJdKUsgJCNNP6Td9bRNc+t 9KVbU2IKlSy5ojVgkXaZxH90EG9EdmUMXrCVdcWS+537IoyiLhxWFZNzkHm0LTSgOK KKkudNne+USDPziUu4JNQrl6UDxK8VkZBUXsdKgg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8497DF8028B; Mon, 25 Jan 2021 07:20:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97596F80260; Mon, 25 Jan 2021 07:20:25 +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 15DE0F80260 for ; Mon, 25 Jan 2021 07:20:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 15DE0F80260 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EjG8tmTV" Received: by mail-yb1-xb4a.google.com with SMTP id f127so10427321ybf.12 for ; Sun, 24 Jan 2021 22:20:22 -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=EjG8tmTVksUZWiqpNrVXic+HmbRAQ6e38FafXnSKrzlpLx73g2ZyAYvJspPs6PRkFA dEbI8vyTXoEU3rDJFDebgP/iVxd2PBMrUMeubEWQFo11BDSf6cQ4BhXJz5OA1ifxe2hN SXD63f8kItcSAM27t8iMZ4TwNw0h1kNGF+NJR2kV386J/j3SQeMc5jCoMAG43AZDJ1hm tNdcVkSyIeJGBL2iCeEISPUzoWb5eaWizdXsLniBvMhdTdyydMOgctWFKOpISOzOU5/q yngEp4momNCusFjtLiuVp13vpbEaB/MgS0lpj4Z36twKug7m+ri6Go7UF9FRpAhReTHV IEkQ== 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=A8cvHP6rXCdPS/BP2FLW/qoG3GrTZiIcA58UnirhFoV87RrbOwU5fsDev59QrQgK20 vYoHya8pCA7MmHcywBxR1DhJVC6uOpbCPZpbdGbJU8Iikvsi0utr3YRhDk6WddT88Ohe eGx33UvYmkQ7JMeGawMhaRtY6TOD3eCkmcu7DuukYOLhGv/hsnwJc/Xz0lfakA/+yMcH HE1ttlF2ThcZsQc+g5XdMuGjDOyukZk+SyXj0vTrYu2+342Zr8qfGL/Pf0hAV3cO3IQK Zdw1FkA7za2CH8e9CMON9q7OOJK4P78eh8PljwN/b77oKQBUbT5Qv9rIJ8NdVOPjfRs7 W1Ng== X-Gm-Message-State: AOAM530nefCZEesx3cGA7Odvg6Rw6yJElhEGBmHT0ZviFkQwD0GHbP3j KRyrwSwNcW+5hOYel9LNlN0B2ETK959q X-Google-Smtp-Source: ABdhPJwswAsYiFSbwZmnRshYlc7KPgS8g2jA/6syu/bEV/ja02Igk28PxJ5n4SyMXz7j1C4z+4DFy2kYDV4X X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:b870:8946:4704:f6a0]) (user=tzungbi job=sendgmr) by 2002:a25:328e:: with SMTP id y136mr20628191yby.442.1611555620142; Sun, 24 Jan 2021 22:20:20 -0800 (PST) Date: Mon, 25 Jan 2021 14:20:02 +0800 In-Reply-To: <20210125062003.1221810-1-tzungbi@google.com> Message-Id: <20210125062003.1221810-3-tzungbi@google.com> Mime-Version: 1.0 References: <20210125062003.1221810-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH v2 2/3] 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 Mon Jan 25 06:20:03 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: 12042985 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 3380BC433E0 for ; Mon, 25 Jan 2021 06:22: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 8704B22CF6 for ; Mon, 25 Jan 2021 06:22:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8704B22CF6 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 DFEFE187D; Mon, 25 Jan 2021 07:21:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DFEFE187D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611555765; bh=AuFaUZmR2fag/V5lwIKWZzyCKHi5IIMnrp2d0KKVNcI=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cawJyGsh+uxryOVsU7MR7PezZ6QFxiQtycM6PJos3Ms60adWDeMWGTe8E+avJKRY8 YfGLw3nN6IAAAopQjAzP0d5+nAVODIDoF26VZwdV2j8SJ55FEm3ZiZfBjhtE1/+xMH 10BGEyyG+zL2YUTrkS78mSAaM+UfcOMFxLAvuGa4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 185B0F804CA; Mon, 25 Jan 2021 07:21:12 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 45B3FF80269; Mon, 25 Jan 2021 07:20:31 +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 3294AF80130 for ; Mon, 25 Jan 2021 07:20:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3294AF80130 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="A/FapsVh" Received: by mail-qv1-xf4a.google.com with SMTP id h1so8527236qvr.7 for ; Sun, 24 Jan 2021 22:20:26 -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=qsJTedifcRHswFbHEXuqWZz0QlBXlCEN/jZfm75ZY+g=; b=A/FapsVhD3F2orDZSASSmV6KO0ogDqvKldruyAXTGKJ+I0v+npFDaKjp7wYVFoXCd7 +4JJvnpHlaRvW0t7+5/NssscqjzfxcSDT7+PFDrYOpjIRRs73IDgOBpQ4NOoZiVxZqXn 2+pzhTHX8pKkSZSZo181ur8vAEKqJuDxdlrw+fmw6ShPoCfskKscZrRyPNZrzYrOO+G2 7+uEzkjdN/wFXR1nsQsVckLEWPBBcGSo8R476m5NkX0Ttgd3m1LZYaNXbWNWl5/7Wblx 7O40QJE8pdJLY7SbkJR4GJYVD9ZnniHrHaBgwqnzU+2mTEvIccWD/OuVtXeGiFnwhnRy kOWw== 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=qsJTedifcRHswFbHEXuqWZz0QlBXlCEN/jZfm75ZY+g=; b=r2nrykSgqvxbB5YcY/MAJqp5jnzAQ7HCONypLZbqhpHa3ptZYNW6Bq4cXGxp8chSee ZB90hsJzW7tS8hvpYyO6iqt9F5nn7g+X3id+6mEEAxeQdg5RDeR/AVtlz9H1l75qYfco LERXoaqmstbg46pmzRYzAHD/fMM9qKpIvkTuQeJhmWogYsctVUITaBCFqSACyo/1jv+b DwKSVv860k3ubs566Dw1uKFtte/Ui4zIMRrxAlesXRMO2KWIUbwrBNoq8dLL/gsO7gBK 78Svg8bhVOBqEywpbyqWRr8T1tavkiYYPK6PnP391Bb3k0ARujUnJ8vRySBaPi9+knct BdNg== X-Gm-Message-State: AOAM533QlaZhz+uFPMgBCuSov2qJXdMOqfuRS6NH9prF2OEGVPmfLT9/ I4OIj7WDBHadoBOce0z63oTe/CVNWhMK X-Google-Smtp-Source: ABdhPJw9hd7h4vVPWmorawaVkeodaDT43omKIPrfqJIjyVamioi6Acs+FVxshEdRyVXY1ui+WlNc2IWp+XBE X-Received: from tzungbi-z840.tpe.corp.google.com ([2401:fa00:1:b:b870:8946:4704:f6a0]) (user=tzungbi job=sendgmr) by 2002:ad4:4108:: with SMTP id i8mr4556446qvp.49.1611555623848; Sun, 24 Jan 2021 22:20:23 -0800 (PST) Date: Mon, 25 Jan 2021 14:20:03 +0800 In-Reply-To: <20210125062003.1221810-1-tzungbi@google.com> Message-Id: <20210125062003.1221810-4-tzungbi@google.com> Mime-Version: 1.0 References: <20210125062003.1221810-1-tzungbi@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH v2 3/3] 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 d2ebf3b6e359..a606133951b7 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, }; static int @@ -768,7 +764,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), }, {