From patchwork Tue Nov 13 18:33:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 151000 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4744197ljp; Tue, 13 Nov 2018 10:33:39 -0800 (PST) X-Google-Smtp-Source: AJdET5f2qcD8KdU9duao92CJ4mISj7Yfm0OaJqSns9vulXn3F6asiiaix+O0mGJm/hjFNMUrCuDs X-Received: by 2002:a05:6000:1202:: with SMTP id e2mr5714771wrx.315.1542134019668; Tue, 13 Nov 2018 10:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542134019; cv=none; d=google.com; s=arc-20160816; b=GynaMUlTCxwf+ijKO2MAwCOqRQloAOMolpNOsUSlX6vyqk6ym8rJUL8bqThOtBKeyy Ob8jdT8NiR49Rgd1+18j8xccz/UQTnKLdiJ75eevRUd6GvQ0JNZb36z6SbUm+8UCZ95Y Q5GFZwrxIghK/RUWnugj5CoSEb820470lndGaciC5kJspvg0xPmGPEq+cwftm8j+cPZU IBGZ8hDZIhpk/ty/MepsB/wzTUP7Pq+N4azhRyPGHXh7T5jhJz2FBRx6sU6DI8Gffviq O/CwVTyUBld/7JjGnqYKwbplr/Mt2mg+s+e7+PQMHPXDNL49+kmLoBmOytovRLJ6a5eZ sYqQ== 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=A/LuCwNLeDAldPp4GrG+v9L+JzEXsFXJwOvFI2h/sp8=; b=DSNqPejyzLByBC4rqlraAQUh1OSMoA+tamm3QWPwGxZ/cvPDcHVDWWwPCHuTJeoX7X BQzurVssLXriWhtPiYnQOpiGaDQoZwfhl4ctGh2Hbk2oflNwE/m9onlpmPtizCHgpszN oQvjsFlaLKp6uMyCvkhbC9pPjs042Rb+WOrSCyBdfV8dEMiAmUTokJ11oLo2BCzGcj5h 9nygpzb++owuGxGPN1V5Gf4cWp3ITYS0yHe4iMZvgKXd6OEbUTVyx+fdP2xnfgTGJIWs J8vuF7nBKkKISKtiHeeondX5BHDL+imbOlFrND69/nrq5phRPrprPBbXYKwlQbjBhmqB tENQ== 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=BkH34PiU; 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 h1-v6si17219671wrt.183.2018.11.13.10.33.39; Tue, 13 Nov 2018 10:33:39 -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=BkH34PiU; 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 4860626786A; Tue, 13 Nov 2018 19:33:38 +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 8DD89267ACB; Tue, 13 Nov 2018 19:33:36 +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 053102677E4 for ; Tue, 13 Nov 2018 19:33:33 +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=87trT4uoVYEcyi+D0xCtLrtTMZJFZsyj9OrIyswnAkQ=; b=BkH34PiUuM7w p4BemnaPlHAI9CjBhiR5d38mCVA4J0T7t8anKrKC7a1jKOy6/ZwbnZqgfabksAbAjSX30ZHZdmXJs uvuQRkf/bL1HzSbolLOQHmMf3tTlGmJ2Hw/5X4qB5gTK920ktjMCOBgEmGSxjq70PQG2g8nE6vdVZ wkf84=; 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 1gMdVF-0002Oq-8j; Tue, 13 Nov 2018 18:33:33 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 14874440078; Tue, 13 Nov 2018 18:33:27 +0000 (GMT) From: Mark Brown To: Peter Ujfalusi In-Reply-To: Message-Id: <20181113183327.14874440078@finisterre.ee.mobilebroadband> Date: Tue, 13 Nov 2018 18:33:27 +0000 (GMT) Cc: alsa-devel@alsa-project.org, Mark Brown , Jarkko Nikula Subject: [alsa-devel] Applied "ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters" 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: Simplify the mcbsp_start/_stop function parameters 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 59d177f65f50df07f5f0b461c968d2fab7597af1 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 8 Nov 2018 09:29:56 +0200 Subject: [PATCH] ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters We either start/stop TX or RX, never both. Move the tx/rx direction selection within the functions. Signed-off-by: Peter Ujfalusi Acked-by: Jarkko Nikula Tested-by: Jarkko Nikula Signed-off-by: Mark Brown --- sound/soc/omap/mcbsp.c | 8 ++++++-- sound/soc/omap/mcbsp.h | 4 ++-- sound/soc/omap/omap-mcbsp.c | 9 ++++----- 3 files changed, 12 insertions(+), 9 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 fca0b0e9186b..7ff22561f00f 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c @@ -637,8 +637,10 @@ void omap_mcbsp_free(struct omap_mcbsp *mcbsp) * If no transmitter or receiver is active prior calling, then sample-rate * generator and frame sync are started. */ -void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int tx, int rx) +void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream) { + int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + int rx = !tx; int enable_srg = 0; u16 w; @@ -694,8 +696,10 @@ void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int tx, int rx) omap_mcbsp_dump_reg(mcbsp); } -void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int tx, int rx) +void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream) { + int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + int rx = !tx; int idle; u16 w; diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h index 46ae1269a698..92472c6ef358 100644 --- a/sound/soc/omap/mcbsp.h +++ b/sound/soc/omap/mcbsp.h @@ -339,8 +339,8 @@ u16 omap_mcbsp_get_rx_delay(struct omap_mcbsp *mcbsp); int omap_mcbsp_get_dma_op_mode(struct omap_mcbsp *mcbsp); int omap_mcbsp_request(struct omap_mcbsp *mcbsp); void omap_mcbsp_free(struct omap_mcbsp *mcbsp); -void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int tx, int rx); -void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int tx, int rx); +void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream); +void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream); /* McBSP functional clock source changing function */ int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id); diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index caa24c463b3e..a18b7ecc3a2e 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -201,27 +201,26 @@ static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *cpu_dai) { struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); - int err = 0, play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: mcbsp->active++; - omap_mcbsp_start(mcbsp, play, !play); + omap_mcbsp_start(mcbsp, substream->stream); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - omap_mcbsp_stop(mcbsp, play, !play); + omap_mcbsp_stop(mcbsp, substream->stream); mcbsp->active--; break; default: - err = -EINVAL; + return -EINVAL; } - return err; + return 0; } static snd_pcm_sframes_t omap_mcbsp_dai_delay(