From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3E55DC433DF for ; Mon, 10 Aug 2020 08:50:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E21020729 for ; Mon, 10 Aug 2020 08:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="de+5jf2K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgHJIuW (ORCPT ); Mon, 10 Aug 2020 04:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgHJIuW (ORCPT ); Mon, 10 Aug 2020 04:50:22 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7143C061756 for ; Mon, 10 Aug 2020 01:50:21 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id o22so6135599qtt.13 for ; Mon, 10 Aug 2020 01:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nd+KGdIV03ZDNVLVq/+Q/ATX3ww0wvxrVThg94dncCE=; b=de+5jf2K1ZqwDSsbSIkMiHfDdBuBPN1wwq2KpeqVKD3Dn8C++08xSBeuzhqHRqsh3k A//1yK1EsW31DJmZQg8bOZfon/fjhmRXanUEY81Nd+9akPoto21VQQFBH+5ySmgasI8v 6O1mIDiPj1QpwalGOW1HlLJCva8THeH7PcceRnSnH3OHEKgvJWV8AXR8D3nz6bhvo9V6 1S+n+IMWxrUWwbrDnPdsOlYiw7pX6UikVtIqgzqHJdyrGDuQmdIiXyr6KS3ICvA3SF2Q 0Um8jB4/ps3KjbdgcNMbxXrkeW64BxD+atuwdFxHO7d2KQ9R75OJ+HIfLu4QpXR61Vfs U+RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nd+KGdIV03ZDNVLVq/+Q/ATX3ww0wvxrVThg94dncCE=; b=QbWH+P52s0IqLOrNhHJQGQumNSootfVs9oZ6mzV93Md9Zbe9qWEfGVuLl34Ttf4SUm fTATlkv5jWI1CYyc+ZK7V7CN74QeC0IGUHov8Vig3TTIFY3+NmTLvJ15tyggb2VPGirl 8Yc42QIdVCwhvjM48uBwFT6YSSwQZsqQ60znyXtqWOTVYkz+F+/bZlm3mZcLcb5GrQwj wos9U6acpeMngweqpszhSvaA9WIdmod3pZAO6tD/i9mldF33a3NvMiXgcSe2pMx1SxWA lXQ4jmjNaPT1NrbNIirmKFEK5qpMPqzdItOJFHpEmSJjeOJPqOW0BJR/ZtUX78QBNooF CxUQ== X-Gm-Message-State: AOAM533L8V2pU8dyKK8LHr+ytJoy/8PHGkiDsZrhQtEAoR3+Pq1mvRnM 5vt639s6s/S1nPk2W1/nQsS7kaTt1f2Ax/uGWfnp3w== X-Google-Smtp-Source: ABdhPJwQZN3wjUk9e2RerROvjSA6KbTeAzJFLgIrN6bfeIV50G58IGJM27E6joMW6fVh+7DW7jJ1yMB19OH8aYMwSRo= X-Received: by 2002:ac8:6d0f:: with SMTP id o15mr25763620qtt.121.1597049421042; Mon, 10 Aug 2020 01:50:21 -0700 (PDT) MIME-Version: 1.0 References: <1597047103-6863-1-git-send-email-shengjiu.wang@nxp.com> <20200810083728.GA7560@Asurada-Nvidia> In-Reply-To: <20200810083728.GA7560@Asurada-Nvidia> From: Shengjiu Wang Date: Mon, 10 Aug 2020 16:50:10 +0800 Message-ID: Subject: Re: [PATCH v2] ASoC: fsl-asoc-card: Get "extal" clock rate by clk_get_rate To: Nicolin Chen Cc: Shengjiu Wang , Linux-ALSA , Timur Tabi , Xiubo Li , linuxppc-dev@lists.ozlabs.org, Takashi Iwai , Liam Girdwood , Mark Brown , Fabio Estevam , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 10, 2020 at 4:39 PM Nicolin Chen wrote: > > On Mon, Aug 10, 2020 at 04:11:43PM +0800, Shengjiu Wang wrote: > > On some platform(.e.g. i.MX8QM MEK), the "extal" clock is different > > with the mclk of codec, then the clock rate is also different. > > So it is better to get clock rate of "extal" rate by clk_get_rate, > > don't reuse the clock rate of mclk. > > > > Signed-off-by: Shengjiu Wang > > --- > > changes in v2 > > - add defer probe handler > > > > sound/soc/fsl/fsl-asoc-card.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c > > index 52adedc03245..32f8f756e6bb 100644 > > --- a/sound/soc/fsl/fsl-asoc-card.c > > +++ b/sound/soc/fsl/fsl-asoc-card.c > > @@ -696,6 +696,17 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) > > goto asrc_fail; > > } > > } else if (of_node_name_eq(cpu_np, "esai")) { > > + struct clk *esai_clk = clk_get(&cpu_pdev->dev, "extal"); > > + > > + if (!IS_ERR(esai_clk)) { > > + priv->cpu_priv.sysclk_freq[TX] = clk_get_rate(esai_clk); > > + priv->cpu_priv.sysclk_freq[RX] = clk_get_rate(esai_clk); > > Will it break existing imx-audio-cs42888 on older i.MX platforms? > 'cause it overwrites cpu_priv.sysclk_freq[] that are set in "card > configurations" section. Tested, no break for imx6. best regards wang shengjiu From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B428CC433DF for ; Mon, 10 Aug 2020 08:51:26 +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 3B4DB20734 for ; Mon, 10 Aug 2020 08:51: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="ShHgbHLl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="de+5jf2K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B4DB20734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 B7A1B15F2; Mon, 10 Aug 2020 10:50:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B7A1B15F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597049484; bh=Muwqp58nFxGSe/rxtwJHMXTSB8FGZF7wIdgKL/IiZhE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ShHgbHLlvdSbHKWqewlPPhv7Dy4Pa0CkvBpifRu6rtTusDp/SONSF4elw8HjJjMOt B9qEn2WU+6CoGr2M79ZPve3emR2+zkYFhD7sVVD1eDO2ZfDAs1A3aIWXLvjdA5uYQZ zrjTMLhbG4DAyN+5b2Jv52Zz9iWboTNQyBHLaZF8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 59DD8F801DB; Mon, 10 Aug 2020 10:50:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7E544F8022B; Mon, 10 Aug 2020 10:50:33 +0200 (CEST) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (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 310EDF800BC for ; Mon, 10 Aug 2020 10:50:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 310EDF800BC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="de+5jf2K" Received: by mail-qt1-x841.google.com with SMTP id w9so6152622qts.6 for ; Mon, 10 Aug 2020 01:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nd+KGdIV03ZDNVLVq/+Q/ATX3ww0wvxrVThg94dncCE=; b=de+5jf2K1ZqwDSsbSIkMiHfDdBuBPN1wwq2KpeqVKD3Dn8C++08xSBeuzhqHRqsh3k A//1yK1EsW31DJmZQg8bOZfon/fjhmRXanUEY81Nd+9akPoto21VQQFBH+5ySmgasI8v 6O1mIDiPj1QpwalGOW1HlLJCva8THeH7PcceRnSnH3OHEKgvJWV8AXR8D3nz6bhvo9V6 1S+n+IMWxrUWwbrDnPdsOlYiw7pX6UikVtIqgzqHJdyrGDuQmdIiXyr6KS3ICvA3SF2Q 0Um8jB4/ps3KjbdgcNMbxXrkeW64BxD+atuwdFxHO7d2KQ9R75OJ+HIfLu4QpXR61Vfs U+RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nd+KGdIV03ZDNVLVq/+Q/ATX3ww0wvxrVThg94dncCE=; b=qsB55KqooLpSZyehkD/T8YGScWNwO4lX7WIVLSV/AwmRgzpUVo1/6aTgybnnL8ACxX TOx8slj2xTwpFwua80ZSZiAdEmHoyD59P+yuTJUpO6NLVaNjqbnKrV9vMzSe8RYQi0g6 +qImuELQznEhwd5GG0T46OMyyAEaMG/I2uo5nvDZBRgxfSUFqaqW2ogMYUzN0N9hfawo TX91sWO6CMNOB3K85fS7qBjg4SXc9uWVhtCVwAo+6L1yf/Iuhbqn7u5b1hk4ffigRkUk JrEFTgaMK2r7zVDGVEsvfA3zS6zRhvV4FIy7e/QeUhFjwWsGmepho3jCI/n29V1FAykw swow== X-Gm-Message-State: AOAM531D3aBeF7JC0aO/mEEzkLMFC6FWxyOnfzmSprHaeERWuE1wXY+Q nMr2hCTqpI5Rq0MxJrPmEiB8EWWjOp5UlXxlU6g= X-Google-Smtp-Source: ABdhPJwQZN3wjUk9e2RerROvjSA6KbTeAzJFLgIrN6bfeIV50G58IGJM27E6joMW6fVh+7DW7jJ1yMB19OH8aYMwSRo= X-Received: by 2002:ac8:6d0f:: with SMTP id o15mr25763620qtt.121.1597049421042; Mon, 10 Aug 2020 01:50:21 -0700 (PDT) MIME-Version: 1.0 References: <1597047103-6863-1-git-send-email-shengjiu.wang@nxp.com> <20200810083728.GA7560@Asurada-Nvidia> In-Reply-To: <20200810083728.GA7560@Asurada-Nvidia> From: Shengjiu Wang Date: Mon, 10 Aug 2020 16:50:10 +0800 Message-ID: Subject: Re: [PATCH v2] ASoC: fsl-asoc-card: Get "extal" clock rate by clk_get_rate To: Nicolin Chen Content-Type: text/plain; charset="UTF-8" Cc: Linux-ALSA , Timur Tabi , Xiubo Li , Fabio Estevam , Shengjiu Wang , Takashi Iwai , Liam Girdwood , Mark Brown , linuxppc-dev@lists.ozlabs.org, linux-kernel 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" On Mon, Aug 10, 2020 at 4:39 PM Nicolin Chen wrote: > > On Mon, Aug 10, 2020 at 04:11:43PM +0800, Shengjiu Wang wrote: > > On some platform(.e.g. i.MX8QM MEK), the "extal" clock is different > > with the mclk of codec, then the clock rate is also different. > > So it is better to get clock rate of "extal" rate by clk_get_rate, > > don't reuse the clock rate of mclk. > > > > Signed-off-by: Shengjiu Wang > > --- > > changes in v2 > > - add defer probe handler > > > > sound/soc/fsl/fsl-asoc-card.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c > > index 52adedc03245..32f8f756e6bb 100644 > > --- a/sound/soc/fsl/fsl-asoc-card.c > > +++ b/sound/soc/fsl/fsl-asoc-card.c > > @@ -696,6 +696,17 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) > > goto asrc_fail; > > } > > } else if (of_node_name_eq(cpu_np, "esai")) { > > + struct clk *esai_clk = clk_get(&cpu_pdev->dev, "extal"); > > + > > + if (!IS_ERR(esai_clk)) { > > + priv->cpu_priv.sysclk_freq[TX] = clk_get_rate(esai_clk); > > + priv->cpu_priv.sysclk_freq[RX] = clk_get_rate(esai_clk); > > Will it break existing imx-audio-cs42888 on older i.MX platforms? > 'cause it overwrites cpu_priv.sysclk_freq[] that are set in "card > configurations" section. Tested, no break for imx6. best regards wang shengjiu