From patchwork Fri Dec 8 18:54:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 121238 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1011774qgn; Fri, 8 Dec 2017 10:55:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMaunN/s1UCgDDbHNaBKQ0Hs6/9yOxRSKR2Nke82sIocJhaQpm03y/VVHD3PN3shLYB/L3JZ X-Received: by 10.28.153.150 with SMTP id b144mr5110374wme.93.1512759300220; Fri, 08 Dec 2017 10:55:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512759300; cv=none; d=google.com; s=arc-20160816; b=TCgZryLgLAA4eFyoEEd47qCzt513qgZs0xekM6wT9cCmZWxhDs3rVr42zde4gglhrt JCbSTU65LYwdbmlZ9/RZ6Fxqd4XpnrhdohO6rG8an9tjO0S37sZbpKn9pD9XCeYPg2Nk QHTtMFF4VPkmnoo5ZuF5VSdreliruFMkLqpCAZt/iyKeE26RA9Nh/j5t6c2HD2CEJnWT 9DeDV1GjCDICpvmUyRZuWbaKMVcbL5elCxZgOSojMQipDpAPk2zAFGT9cEpU7/uLsgAI Q4omXyyiqrzdWL/MIpUJq+0j0EP2Cc1Seb+5NKcaJ1GeYjG2t9VvxIhw6cZ0S9BM/VHm Q4bg== 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:arc-authentication-results; bh=ycqTFld0SVg/WKJhflNvm3/TEwdQpH8mB3ZnQHysWuw=; b=NyWSJoVD1am6h3DSmGOZybHLsqBNF3zR47HvdE+fdV0ThzjwO/iU9MXAcQ77bhP7k6 hbnOVOd/fVfScD/HL/4M5xptR1vNsnh0mXyXLjtyYbCaEVTTy/79PZDH0+UXNtohkYcE CZzUk0keQ34R5LLUYVGS3KckSR89aNNzgIIMdeHtDSoio2HyxVR453zaToda2B5XREb/ hsu3ASsJzyptr1GErfAqbNBau/LPSPM/K2di8sBb0I+N2iz2dvGQzQure4NRIInvoYuJ 1V0D4bet/NNQbDuZMUKXVizUl485MXiI3DUWjN+9PbjDDB2gZe3Wu2zXRbywiYkQ5xNx BE8Q== 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=bgOAo0bt; 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 Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id l15si6338759wrb.144.2017.12.08.10.54.59; Fri, 08 Dec 2017 10:55:00 -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=bgOAo0bt; 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 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 49719267283; Fri, 8 Dec 2017 19:54:58 +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 AA341267284; Fri, 8 Dec 2017 19:54:56 +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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD 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 25754267255 for ; Fri, 8 Dec 2017 19:54:55 +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=Vu4uytgpcjgIJEo3o/IheruqKk6uaLxCvyxiIDDPS2g=; b=bgOAo0bt9EWP t1x7fwVjNxYjQ7u3zQBytk/JaE7ylFmxleebyKF2WehiktLimwLCBs/Cq1ie+TVwgCD2iGrAagVCS MpOanqmgaFVDbR6hCHWMCe+inyX4z62FT1IV/C6KeadfZyOJtjQ4W5W09j0o7vB2eA+9yc2SmbvNK Xlgp8=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eNNnO-0004tD-CK; Fri, 08 Dec 2017 18:54:50 +0000 Received: from broonie by debutante with local (Exim 4.90_RC3) (envelope-from ) id 1eNNnN-00049U-Uh; Fri, 08 Dec 2017 18:54:49 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87k1xxiw68.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Fri, 08 Dec 2017 18:54:49 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Hiroyuki Yokoyama , Simon Subject: [alsa-devel] Applied "ASoC: rsnd: more clear rsnd_get_dalign() for DALIGN" 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: rsnd: more clear rsnd_get_dalign() for DALIGN 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 a914e44693d41ba43604afa8c435c98a6d2c7cb1 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 8 Dec 2017 06:23:11 +0000 Subject: [PATCH] ASoC: rsnd: more clear rsnd_get_dalign() for DALIGN On Renesas sound device, DALIGN which exchanges channel position is needed because SW and HW are using defferent data order if 16bit data. It is not needed when 24bit data. rsnd_get_dalign() returns necessary value, but it was confusable code. This patch makes it more simple. Tested-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) -- 2.15.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index d76ad46a6fd9..8e50b284230d 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -294,11 +294,12 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io) struct rsnd_mod *ssiu = rsnd_io_to_mod_ssiu(io); struct rsnd_mod *target; struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); - u32 val = 0x76543210; - u32 mask = ~0; /* - * *Hardware* L/R and *Software* L/R are inverted. + * *Hardware* L/R and *Software* L/R are inverted for 16bit data. + * 31..16 15...0 + * HW: [L ch] [R ch] + * SW: [R ch] [L ch] * We need to care about inversion timing to control * Playback/Capture correctly. * The point is [DVC] needs *Hardware* L/R, [MEM] needs *Software* L/R @@ -325,27 +326,13 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io) target = cmd ? cmd : ssiu; } - mask <<= runtime->channels * 4; - val = val & mask; - - switch (runtime->sample_bits) { - case 16: - val |= 0x67452301 & ~mask; - break; - case 32: - val |= 0x76543210 & ~mask; - break; - } - - /* - * exchange channeles on SRC if possible, - * otherwise, R/L volume settings on DVC - * changes inverted channels - */ - if (mod == target) - return val; - else + /* Non target mod or 24bit data needs normal DALIGN */ + if ((runtime->sample_bits != 16) || + (mod != target)) return 0x76543210; + /* Target mod needs inverted DALIGN when 16bit */ + else + return 0x67452301; } u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod)