Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7197279ybi; Mon, 22 Jul 2019 08:42:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpoHICo/lBYApLACfsoUmT7s20nmKGAK0bDSBDFYYJei4fOd3yXWFPNsNstaLh/xeC3H/F X-Received: by 2002:a63:784c:: with SMTP id t73mr74160951pgc.268.1563810163662; Mon, 22 Jul 2019 08:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563810163; cv=none; d=google.com; s=arc-20160816; b=sd8TT+0ZhpT1CNxFyWD802sGN3nvVzKypIPDi2AAB1gZ7uRzE/sTWkes+CERln0p7T 8Q1qFg1uP04zMVvfUFpzCxLuwu1TX6kVT3bdObkVg6n8RAQXc2SQHZ/52exr5QNPBVOW I/t977BS95Tl2DcWB61j0VrJ3kC7XUGHdeKyRvm9GIkZ3z06Tv3HpGd3wyAyW4wM3IuQ fGnoALuNJaKKDWMKwzC6h7gt+fV/NfrZgIa2ENjSHMQ3j8Izc2b9zH6Q9ao6llHcqxsu iCtan6tdmPgZ8Qg/5uI6RPT4wo1yAkr/m5G8E6vfVoTk+HW80xfFucJJLUNKPUwVVh2/ MOlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Ng/0nKYTTjZ3/fDk5deieb0RZ+cT8lBcDfHuyjshsdQ=; b=TWQ0uV05jQmr31z2JPefy3fhv7Wae82N/YMJcktrxw3OEIcYo+4ObntlDRAIWTTvyZ RMqmzAZRd0sCnW8FmD+1PtoFQkhgk44l9fxcAsznAjB3r3FCYtTlokM1QLiFhvUIaOYd JQogPbjWMT8Rkje1Jux9+FOyEQTpItiUwiROQgMiahzKfPnWsaiivo80TQSC9CqvWecQ 8ZXZJb8AAX3gdJ578pJRQLrCN3pBCP7b5YVqbjMhnxq8BgdD9+glyClZYu+A6cjfVgv6 oSt6FmM54rXKZZj3YTSOSju/dBZOKNdo5WSKEUZ+cHUsooDAPu971IxsvEPRLkBFJVcC BD/A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p44si10726250pjp.0.2019.07.22.08.42.27; Mon, 22 Jul 2019 08:42:43 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729908AbfGVMsy (ORCPT + 99 others); Mon, 22 Jul 2019 08:48:54 -0400 Received: from inva020.nxp.com ([92.121.34.13]:51170 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbfGVMsv (ORCPT ); Mon, 22 Jul 2019 08:48:51 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D141C1A000B; Mon, 22 Jul 2019 14:48:49 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C46291A0108; Mon, 22 Jul 2019 14:48:49 +0200 (CEST) Received: from fsr-ub1864-103.ea.freescale.net (fsr-ub1864-103.ea.freescale.net [10.171.82.17]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 21127205DB; Mon, 22 Jul 2019 14:48:49 +0200 (CEST) From: Daniel Baluta To: broonie@kernel.org Cc: festevam@gmail.com, perex@perex.cz, tiwai@suse.com, Xiubo.Lee@gmail.com, nicoleotsuka@gmail.com, timur@kernel.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, shengjiu.wang@nxp.com, angus@akkea.ca, kernel@pengutronix.de, l.stach@pengutronix.de, viorel.suman@nxp.com Subject: [PATCH 02/10] ASoC: fsl_sai: derive TX FIFO watermark from FIFO depth Date: Mon, 22 Jul 2019 15:48:25 +0300 Message-Id: <20190722124833.28757-3-daniel.baluta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722124833.28757-1-daniel.baluta@nxp.com> References: <20190722124833.28757-1-daniel.baluta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach The DMA request schould be triggered as soon as the FIFO has space for another burst. As different versions of the SAI block have different FIFO sizes, the watrmark level needs to be derived from version specific data. Signed-off-by: Lucas Stach --- sound/soc/fsl/fsl_sai.c | 4 +++- sound/soc/fsl/fsl_sai.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index ed0432e7327a..1d1a447163e3 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -640,7 +640,7 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) regmap_write(sai->regmap, FSL_SAI_RCSR, 0); regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, - FSL_SAI_MAXBURST_TX * 2); + sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX); regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1); @@ -913,10 +913,12 @@ static int fsl_sai_remove(struct platform_device *pdev) static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, + .fifo_depth = 32, }; static const struct fsl_sai_soc_data fsl_sai_imx6sx_data = { .use_imx_pcm = true, + .fifo_depth = 32, }; static const struct of_device_id fsl_sai_ids[] = { diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index 83e2bfe05b1b..7c1ef671da28 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -128,6 +128,7 @@ struct fsl_sai_soc_data { bool use_imx_pcm; + unsigned int fifo_depth; }; struct fsl_sai { -- 2.17.1