From patchwork Sun Sep 3 11:05:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 9937871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F096600CB for ; Tue, 5 Sep 2017 06:38:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E5F1288A2 for ; Tue, 5 Sep 2017 06:38:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32890288A6; Tue, 5 Sep 2017 06:38:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E36E2889F for ; Tue, 5 Sep 2017 06:38:41 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 77C2C266884; Tue, 5 Sep 2017 08:38:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 10041266DCE; Sun, 3 Sep 2017 13:05:44 +0200 (CEST) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by alsa0.perex.cz (Postfix) with ESMTP id 3FAEF266884 for ; Sun, 3 Sep 2017 13:05:41 +0200 (CEST) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3xlVWl5c0gz1qs06; Sun, 3 Sep 2017 13:05:39 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3xlVWl2fyWz3hjkk; Sun, 3 Sep 2017 13:05:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id DR_OvSD6OB9l; Sun, 3 Sep 2017 13:05:36 +0200 (CEST) X-Auth-Info: jnTsKiw13z5oQd224MRUGiKgYXuSekuJ3NSn/kI4obw= Received: from localhost.localdomain (89-77-92-62.dynamic.chello.pl [89.77.92.62]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 3 Sep 2017 13:05:36 +0200 (CEST) From: Lukasz Majewski To: Timur Tabi , Nicolin Chen , Xiubo Li , Fabio Estevam , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Sun, 3 Sep 2017 13:05:01 +0200 Message-Id: <1504436701-20700-1-git-send-email-lukma@denx.de> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Tue, 05 Sep 2017 08:38:03 +0200 Cc: alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Lukasz Majewski Subject: [alsa-devel] [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The problem is visible in the following setup (on the imx6q): "simple-audio-card" -> ssi2 -> I2S + I2C -> codec The function call log (simple-card probe -> CONFIG_SND_SIMPLE_CARD): asoc_simple_card_init_dai() @ sound/soc/generic/simple-card-utils.c snd_soc_dai_set_sysclk() fsl_ssi_set_dai_sysclk() @ sound/soc/fsl/fsl_ssi.c The last call is changing the bit clock (BCLK) frequency to SSI's IP block clock (ipg = 66 MHz) [1]. This is wrong, since IMX SSI block requires the I2S BCLK to be less than 1/5 of [1]. As a result the driver initialization passes without any errors, but the speaker-test test case breaks. This commit checks if the fsl_ssi_set_dai_sysclk() frequency passed is not equal to [1]. Signed-off-by: Lukasz Majewski --- sound/soc/fsl/fsl_ssi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 173cb84..1186fa9 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -809,6 +809,8 @@ static int fsl_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai, int clk_id, unsigned int freq, int dir) { struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai); + if (clk_get_rate(ssi_private->clk) == freq) + return 0; ssi_private->bitclk_freq = freq;