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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 21F66C433DB for ; Tue, 16 Mar 2021 15:06:31 +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 191BE6508A for ; Tue, 16 Mar 2021 15:06:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 191BE6508A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 7E1BE18F0; Tue, 16 Mar 2021 16:05:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7E1BE18F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1615907188; bh=2JQWrD1BEdDFhiO+/je+FGCZdigzlLU21cRM7PU/4u4=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WMYiHVXRIiRVH6fWL4ANY14Z0+4KWMH7IGE2LKSTzITlwqvU7CFVR0jRMK4arAxSq ATR+lvDxpq2x366Crq8EJEkVKcbQHO6LubcHw0EozFTgqsYrB2Tr636OqRpkzJI4Gi KHnfA2bFAOh3ef3rSIVkiNRY+Gc5LVyz0ko1VkKM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 99C4BF8032B; Tue, 16 Mar 2021 16:05:01 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B95F7F8032C; Tue, 16 Mar 2021 16:04:59 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9C33BF8026A for ; Tue, 16 Mar 2021 16:04:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9C33BF8026A IronPort-SDR: kV+v1mGnqA1dutpM7szaWc+3JELjFb26oAonlLL4Cq8V/XlRhCdIjLJDy1PzCSjuR/+bHvlJ7o ovHZVgKL5o4Q== X-IronPort-AV: E=McAfee;i="6000,8403,9924"; a="189367868" X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="189367868" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 08:04:45 -0700 IronPort-SDR: ZGgvL0zLqcwacdfAybfgzcPBHc5oXgdtfqdvBMp77181rJn6gKrGGmkEXJbFlex8iA2Ksjfev8 GCcpTqNW3oZg== X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="601857037" Received: from mdacha-mobl3.amr.corp.intel.com (HELO [10.212.75.21]) ([10.212.75.21]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 08:04:43 -0700 Subject: Re: [PATCH v3] ASoC: amd: add support for rt5682 codec in machine driver To: "Mukunda,Vijendar" , broonie@kernel.org, alsa-devel@alsa-project.org References: <1615824133-21553-1-git-send-email-Vijendar.Mukunda@amd.com> <87f41e68-3158-38f8-5e84-270ab184691b@amd.com> From: Pierre-Louis Bossart Message-ID: <6bdef069-374a-d215-30a4-715e05304fc7@linux.intel.com> Date: Tue, 16 Mar 2021 09:53:56 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <87f41e68-3158-38f8-5e84-270ab184691b@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Cc: Kuninori Morimoto , Arnd Bergmann , Liam Girdwood , Chuhong Yuan , open list , Takashi Iwai , Alexander.Deucher@amd.com, Ravulapati Vishnu vardhan rao , Virendra-Pratap.Arya@amd.com, Murali-krishna.Vemuri@amd.com 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 3/16/21 8:37 AM, Mukunda,Vijendar wrote: > > > On 15/03/21 9:30 pm, Pierre-Louis Bossart wrote: >> >>> +static int rt5682_clk_enable(struct snd_pcm_substream *substream) >>> +{ >>> +    int ret; >>> +    struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); >>> + >>> +    /* >>> +     * Set wclk to 48000 because the rate constraint of this driver is >>> +     * 48000. ADAU7002 spec: "The ADAU7002 requires a BCLK rate that is >>> +     * minimum of 64x the LRCLK sample rate." RT5682 is the only clk >>> +     * source so for all codecs we have to limit bclk to 64X lrclk. >>> +     */ >>> +    clk_set_rate(rt5682_dai_wclk, 48000); >>> +    clk_set_rate(rt5682_dai_bclk, 48000 * 64); >>> +    ret = clk_prepare_enable(rt5682_dai_bclk); >>> +    if (ret < 0) { >>> +        dev_err(rtd->dev, "can't enable master clock %d\n", ret); >>> +        return ret; >>> +    } >>> +    return ret; >>> +} >> >> Out of curiosity, is there a reason why you use clk_prepare_enable() >> for the bclk but not for the wclk?These changes were shared by codec >> vendor as an initial patch. > We should use clk_prepare_enable() for wclk not for bclk. > We will update and share the new patch. Well the question remains: if you have two clocks and only enable one, why do you need to get two clocks. Also this patch was modeled after the da7219 case, where the same open applies.