Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4276247pxf; Tue, 16 Mar 2021 09:31:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8Lq5XI8huTTL4n7digGDU/C7eFrLLOCYU7IsCaIGvVPbX6Dux+Yu38APUVh1kezgS1stg X-Received: by 2002:a50:bb47:: with SMTP id y65mr37860078ede.305.1615912264798; Tue, 16 Mar 2021 09:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615912264; cv=none; d=google.com; s=arc-20160816; b=bhjqphfBN2E9MrIRC0ISBg1MQT+btOyXMw8dJsOplwdwOyUhW12Q5vb4zDlEyRZqgG H+FElq1CXuC4fWRl2HXFBOzO/Th420SkfgrVYNgFnUMDaJXfjsw1VevT1jh6SIyVFBuo K4zt6OPnfMwaOosh5UNcU+xSkOHNFLraBiZQHHv07sQW7yx44dNGcOtEoE5lyxAGBiTb bA+QXw+dWYTM0enRC9jhn5FOaFzM2hxIcySc1ltAB8CqGdU22jz9QIrAXWAaDKIe1l47 oOKIvV0GgHmk+O0YyrII9gdQA6eqFt9EY9ChnMnPixGW1i17LadfPUoEHIgZZtAn+0Gf XiNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=7uE31daEzL1Tg7axXDNQ+VHptkJlHIm900Kmcs3oTw0=; b=pV8TBj4kOCyQ0wv/dwKZonRwLne2dFzzN6hZ2Hc7z3HOpoSrWAUERhKatJIu87a9t4 RQIa9DdecN+T0vgHc7ZHuJZcNTIKVhPvSc+aNBMXoHBEXVeSGQeX6tM8+USQTZ14x9Ho xeR2SWoS/7t3+B+xJqwUPkP8q+XBsNJEaHszanFfZKTbYcl8bmVb8qcib/ER1KtMNKuc gwzyAoY6zLt4MaQewDOfVrk9YorXIjYFw8VC2ohueA0B1lOkhld9f6MsAvh4caeGG7KV BsvgXEbq45ajKHQwsTTqixFAAk0UmYZ2BMnY6PIBI4QXg8FSLsJABajQ1sxx6uYifE3H ttrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si14107985ejf.656.2021.03.16.09.30.42; Tue, 16 Mar 2021 09:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237702AbhCPPFo (ORCPT + 99 others); Tue, 16 Mar 2021 11:05:44 -0400 Received: from mga18.intel.com ([134.134.136.126]:62006 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237762AbhCPPFL (ORCPT ); Tue, 16 Mar 2021 11:05:11 -0400 IronPort-SDR: AE5U5EUA6TQGRkTP0FPYi8Zv/H+M+j4p/boF+m7cb+7eSzA1Imbo0K3lJhg3+6js95HA35OXBu eLL8DSQCt/1g== X-IronPort-AV: E=McAfee;i="6000,8403,9924"; a="176869906" X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="176869906" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.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 Cc: Kuninori Morimoto , Arnd Bergmann , Liam Girdwood , open list , Chuhong Yuan , Takashi Iwai , Ravulapati Vishnu vardhan rao , Alexander.Deucher@amd.com, Virendra-Pratap.Arya@amd.com, Murali-krishna.Vemuri@amd.com 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.