From patchwork Tue Nov 13 18:32:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 150999 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4743030ljp; Tue, 13 Nov 2018 10:32:37 -0800 (PST) X-Google-Smtp-Source: AJdET5eYDB9NVDm8ulScdwO9CQYAo8aIvcNiCFpCAqDxTdKgtlsQO54iSEptptU17FcPZzMMwpaZ X-Received: by 2002:adf:9bd6:: with SMTP id e22-v6mr5656512wrc.295.1542133956990; Tue, 13 Nov 2018 10:32:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542133956; cv=none; d=google.com; s=arc-20160816; b=ivdw3YjnOo1afgvmvcbMQnkRCeiU5wBIEWfVqJtk+p5sChFXLsuGmw1azSUQWQdsFN niUMMEDplDU7g8wmfGlrBGMqodxeZboGHYW+eSbWBx+R7U8X7sWG40M4UhW6ZFyZOmf4 B1NKug9d8j0jAg/JtXzoQsSyz1w5/U1GnQmhdqYW2PaB60U08CSM4gaCYQ5dG0A+ks5Z q+cOS0jYD7A5UFQe9wER07W79yLN+jUiq7+9GrbDQOUgKPpEwrPMJFglF/GAM+WE5HhZ rEboGchlNPCRINe3tIYFVQJn4XUVOy/MtY+RYUZWgFaQ9EsnISMkzQqTEYv/Brv7fUQx 0VFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to; bh=7TlP2Qe8+ZXaBE4xB+BOXx3lmxdgyTQC4xy2n/R8UGk=; b=vGkvzpaDHmwTHqqVORgXUoOt6hsbMHFSbQsvLdhe+80IbDGmd2Niy3tR6TFuKjs75a L65loS4gIuslVypZf+3gR42COauUGmh6g6ebS8CrdbCRSVliPD9VOiICjHSw087oqe9R hut2xg8E9r+3TBYvlH6bQYJHFv8opDyRKjmbXo+4xrFtLoFw3BwLsxwnY8HkDK6Z0IrA G/SoWSsTIfBK7olLPUjnXBs1P4oKdDudvgyQE2mwjRiOL3/Fi6vFhlwEJnW57mD3M7/x yAVoz8qHT4eYxZQhFceowVZl2UEMAUeDKWWY84S0UvGfyefTpt6aHikf4Uci2fFxMSnx KhqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=IjQXLomt; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id v206-v6si3434595wmb.201.2018.11.13.10.32.36; Tue, 13 Nov 2018 10:32:36 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=IjQXLomt; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BA30A267AAD; Tue, 13 Nov 2018 19:32:35 +0100 (CET) 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 3F2D3267AB1; Tue, 13 Nov 2018 19:32:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id A37972677E4 for ; Tue, 13 Nov 2018 19:32:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=shHHuwcsuQQGPmCjcTJv7rfHxsAACG/LJ+3l7Bh99o0=; b=IjQXLomt/E5Q Mac5FRl7JtHCP1KnC7s5hrsQL+I2hvjAdvBuLCG8OhTolqAfla5MJzJ5T2BHRkY+UCCSgcLXz7IQa XdvAt/cEy7fwbVgj+vu3imXtmZscOpUfYNZDuATNBg4SyrA4twKS3Kg3mrWU7higrtcyLSpY0QvpM xCni0=; Received: from [64.114.255.97] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gMdUF-0002Oh-9D; Tue, 13 Nov 2018 18:32:31 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 2A2F2440078; Tue, 13 Nov 2018 18:32:25 +0000 (GMT) From: Mark Brown To: Peter Ujfalusi In-Reply-To: Message-Id: <20181113183225.2A2F2440078@finisterre.ee.mobilebroadband> Date: Tue, 13 Nov 2018 18:32:25 +0000 (GMT) Cc: alsa-devel@alsa-project.org, Mark Brown , Jarkko Nikula Subject: [alsa-devel] Applied "ASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay" to the asoc tree 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 The patch ASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From be51c576e8495fd2cffbababad6de7e0a0a562ba Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 8 Nov 2018 09:29:57 +0200 Subject: [PATCH] ASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay Check if the McBSP have FIFO in the omap_mcbsp_set_threshold() and omap_mcbsp_dai_delay() delay function to skip calling the lower layer if it is not needed. Signed-off-by: Peter Ujfalusi Acked-by: Jarkko Nikula Tested-by: Jarkko Nikula Signed-off-by: Mark Brown --- sound/soc/omap/mcbsp.c | 12 ------------ sound/soc/omap/omap-mcbsp.c | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) -- 2.19.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index 7ff22561f00f..b19168f5c110 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c @@ -450,9 +450,6 @@ int omap_st_is_enabled(struct omap_mcbsp *mcbsp) */ void omap_mcbsp_set_tx_threshold(struct omap_mcbsp *mcbsp, u16 threshold) { - if (mcbsp->pdata->buffer_size == 0) - return; - if (threshold && threshold <= mcbsp->max_tx_thres) MCBSP_WRITE(mcbsp, THRSH2, threshold - 1); } @@ -464,9 +461,6 @@ void omap_mcbsp_set_tx_threshold(struct omap_mcbsp *mcbsp, u16 threshold) */ void omap_mcbsp_set_rx_threshold(struct omap_mcbsp *mcbsp, u16 threshold) { - if (mcbsp->pdata->buffer_size == 0) - return; - if (threshold && threshold <= mcbsp->max_rx_thres) MCBSP_WRITE(mcbsp, THRSH1, threshold - 1); } @@ -478,9 +472,6 @@ u16 omap_mcbsp_get_tx_delay(struct omap_mcbsp *mcbsp) { u16 buffstat; - if (mcbsp->pdata->buffer_size == 0) - return 0; - /* Returns the number of free locations in the buffer */ buffstat = MCBSP_READ(mcbsp, XBUFFSTAT); @@ -496,9 +487,6 @@ u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp) { u16 buffstat, threshold; - if (mcbsp->pdata->buffer_size == 0) - return 0; - /* Returns the number of used locations in the buffer */ buffstat = MCBSP_READ(mcbsp, RBUFFSTAT); /* RX threshold */ diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index a18b7ecc3a2e..69a6b8ad6d42 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -71,6 +71,10 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream, struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); int words; + /* No need to proceed further if McBSP does not have FIFO */ + if (mcbsp->pdata->buffer_size == 0) + return; + /* * Configure McBSP threshold based on either: * packet_size, when the sDMA is in packet mode, or based on the @@ -233,6 +237,10 @@ static snd_pcm_sframes_t omap_mcbsp_dai_delay( u16 fifo_use; snd_pcm_sframes_t delay; + /* No need to proceed further if McBSP does not have FIFO */ + if (mcbsp->pdata->buffer_size == 0) + return 0; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) fifo_use = omap_mcbsp_get_tx_delay(mcbsp); else