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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 DCADFC4360D for ; Mon, 9 Sep 2019 00:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFFC12086D for ; Mon, 9 Sep 2019 00:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731922AbfIIAba (ORCPT ); Sun, 8 Sep 2019 20:31:30 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:25281 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731753AbfIIAba (ORCPT ); Sun, 8 Sep 2019 20:31:30 -0400 Date: 09 Sep 2019 09:31:28 +0900 X-IronPort-AV: E=Sophos;i="5.64,483,1559487600"; d="scan'208";a="25835082" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 09 Sep 2019 09:31:28 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2F791410CD53; Mon, 9 Sep 2019 09:31:28 +0900 (JST) Message-ID: <87woei5mzj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Katsuhiro Suzuki Cc: Mark Brown , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] SoC: simple-card-utils: set 0Hz to sysclk when shutdown In-Reply-To: <20190907174501.19833-1-katsuhiro@katsuster.net> References: <20190907174501.19833-1-katsuhiro@katsuster.net> User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Katsuhiro > This patch set 0Hz to sysclk when shutdown the card. > > Some codecs set rate constraints that derives from sysclk. This > mechanism works correctly if machine drivers give fixed frequency. > > But simple-audio and audio-graph card set variable clock rate if > 'mclk-fs' property exists. In this case, rate constraints will go > bad scenario. For example a codec accepts three limited rates > (mclk / 256, mclk / 384, mclk / 512). > > Bad scenario as follows (mclk-fs = 256): > - Initialize sysclk by correct value (Ex. 12.288MHz) > - Codec set constraints of PCM rate by sysclk > 48kHz (1/256), 32kHz (1/384), 24kHz (1/512) > - Play 48kHz sound, it's acceptable > - Sysclk is not changed > > - Play 32kHz sound, it's acceptable > - Set sysclk to 8.192MHz (= fs * mclk-fs = 32k * 256) > - Codec set constraints of PCM rate by sysclk > 32kHz (1/256), 21.33kHz (1/384), 16kHz (1/512) > > - Play 48kHz again, but it's NOT acceptable because constraints > do not allow 48kHz > > So codecs treat 0Hz sysclk as signal of applying no constraints to > avoid this problem. > > Signed-off-by: Katsuhiro Suzuki > --- I'm not 100% understand your issue. .hw_params (= set mclk/sysclk) is not called in bad case ?? Or it is called but Codec driver ignores it somehow ?? Thank you for your help !! Best regards --- Kuninori Morimoto