Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp613437img; Tue, 26 Feb 2019 05:52:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1Ds3yZDqx3In3ZQJGe73DXG7fE2e/r5mUViDiyWuUH5p1ihSUDGNYVfCmRS0aqpFPekVY X-Received: by 2002:a62:cf81:: with SMTP id b123mr26602040pfg.29.1551189150690; Tue, 26 Feb 2019 05:52:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551189150; cv=none; d=google.com; s=arc-20160816; b=wZ85+EmszWb7wCZ91DVilj7ut/yRJXlJdrL7GNxIiRgNVq1oAugnQdtOpv11+n6SMT i9R8SLaFCP0Hb/BEnENGyOXWnZOAy95j7gTiahwWmqQXPgfzoqoSqLpAyEDIXzIJBbc3 GcPswtd+DLO7pzfWtU/SNGiUl/V62ibss9jhucg3s8Wnm/sxrasRLQ6eNGW6j9tCSoZJ YS1PhetaBfpbIyAMppEQzhm2/IHHm9yFtLc8xbE4TDHP8J2KGvltWLuoQs83g0sDwBgb 9GVJZdJoElEBUGGGeG7lVXtvlLmdTQNXl6eHr4Un576BK6MPQmyG1BKUgfVzRIE/eGx5 xLsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=2p3LBmVTCwcfc8UzvdnvGen1Rd4wDmiKsBJwv5Tilho=; b=nUs4rb6fYduMzZ/QxBCilAMs4/UP2Sw0fdC8iPLxsfbv4sFflPI3MaLhZpbb2dCo6e fCDz5nMlRLiF8OmYvq/Va/sS5rIgfDpD4YXGEVkHM6C1vubRreVauF86NuISwIWHWz4r CHWx7eD1Bxac3YRLXWzabti1JcmKf2GDNUEHD/UbgxT02wQURqLFQexgr18DLfoko8Qv 72gkzQTbeZId3KGfFpI0+cYzoScuBJuJA44A2uP5Ms8CqxOzZaWjmKlyUy05n/3uDxdq wAAWaKafKySmg95dOey8F/ZoN+ffgumR4Hxrrhrk7ebAozNnOHMSfGLCI8r1w1bifkLU 2sWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si12020157pga.212.2019.02.26.05.52.15; Tue, 26 Feb 2019 05:52:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727323AbfBZNvn (ORCPT + 99 others); Tue, 26 Feb 2019 08:51:43 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:39437 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfBZNvk (ORCPT ); Tue, 26 Feb 2019 08:51:40 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1QDlFQK028532; Tue, 26 Feb 2019 14:51:19 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2qtvh3g8pj-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Feb 2019 14:51:19 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4894D31; Tue, 26 Feb 2019 13:51:19 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 273EF5478; Tue, 26 Feb 2019 13:51:19 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Feb 2019 14:51:19 +0100 Received: from localhost (10.201.23.16) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Feb 2019 14:51:18 +0100 From: Olivier Moysan To: , , , , , , , , , , , , Subject: [PATCH 4/7] ASoC: stm32: i2s: fix dma configuration Date: Tue, 26 Feb 2019 14:51:07 +0100 Message-ID: <1551189070-15469-5-git-send-email-olivier.moysan@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551189070-15469-1-git-send-email-olivier.moysan@st.com> References: <1551189070-15469-1-git-send-email-olivier.moysan@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.16] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-26_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DMA configuration is not balanced on start/stop. Move DMA configuration to trigger callback. Signed-off-by: Olivier Moysan --- sound/soc/stm/stm32_i2s.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 7f56d7b51ba3..95fffb61faa5 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -488,7 +488,7 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); int format = params_width(params); - u32 cfgr, cfgr_mask, cfg1, cfg1_mask; + u32 cfgr, cfgr_mask, cfg1; unsigned int fthlv; int ret; @@ -529,15 +529,11 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, if (ret < 0) return ret; - cfg1 = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN; - cfg1_mask = cfg1; - fthlv = STM32_I2S_FIFO_SIZE * I2S_FIFO_TH_ONE_QUARTER / 4; - cfg1 |= I2S_CFG1_FTHVL_SET(fthlv - 1); - cfg1_mask |= I2S_CFG1_FTHVL_MASK; + cfg1 = I2S_CFG1_FTHVL_SET(fthlv - 1); return regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG, - cfg1_mask, cfg1); + I2S_CFG1_FTHVL_MASK, cfg1); } static int stm32_i2s_startup(struct snd_pcm_substream *substream, @@ -592,6 +588,10 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, /* Enable i2s */ dev_dbg(cpu_dai->dev, "start I2S\n"); + cfg1_mask = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN; + regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG, + cfg1_mask, cfg1_mask); + ret = regmap_update_bits(i2s->regmap, STM32_I2S_CR1_REG, I2S_CR1_SPE, I2S_CR1_SPE); if (ret < 0) { -- 2.7.4