From patchwork Mon Dec 11 12:13:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 121386 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2712283qgn; Mon, 11 Dec 2017 04:13:58 -0800 (PST) X-Google-Smtp-Source: ACJfBotG+Le3dnyMUcEyNMrukWQ7UG4MKHyRm/Vamkqb0+Fe1FidapduncbNmGdrGO0il8tipEBO X-Received: by 10.28.145.18 with SMTP id t18mr608014wmd.32.1512994438846; Mon, 11 Dec 2017 04:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512994438; cv=none; d=google.com; s=arc-20160816; b=hgO7OUux9CpXxsHLxANSXXefyfFKlw8dVDxu1LoBqcqoIRnrMGy6dNvEP/3NObGul4 2g4CrSLGb8j5QuotFvhfoUD3l+l6HdsNXlXKp/V9coGAa8uOCFl+vSORcminZVoKCE9D c1xacpUNYjOYv582es3llLXYljGOoer8wK8ggPsABuAb1PUTr2WMaeBrJQ8GNxV5U1AR ZQH/AU4e/DdwUUECpGf/my0V9Pu/Qd+KnMb6xaOqcw2dhugUcUmg87vssISCUplugU+F 5h8gsDu6B9g/a9QRoKH/I56fLec7Pz8xoNcK0QKGVfvNRdwnUyAZRJQwU2yJl7Dzv2fl PvIQ== 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=tyOd1fXpaN8u9lm66xF6tqRMrxCSGe1Z8G5YIJ2KL60=; b=hJW0Us9oVFrlq5rDG9I1HLzhvh7l8pjeSR9GYqVJnIRw1nU9Kz68aWULPtpGopARMf JL+YmoA4WkO8cQvZtq1l3toIuBjYjRHHMoiPCStOURGErz7N6byG9Ruq/utnt6IeO/jF gqwPSqpoADn0zItrl7ylWhpw5BIv5g7LG1+Gnsd+BtBvcCBGd77qJtxJ82lMiqqnbW0c AUdCM8jpllrmU6npfpjJwmBIiTkXPZRBwnSHaRJ+snHmbebRdFPx+fBc21B72i1GZceJ /I860vAgtHZOn/YQos/he527Hip7q3wG/tYFY+7ojPPk3ucT2mno0en5Zd2u6IVvmGbw RH9Q== 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=SaDl02NM; 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 j134si5320608wmd.234.2017.12.11.04.13.58; Mon, 11 Dec 2017 04:13:58 -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=SaDl02NM; 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 788A8267585; Mon, 11 Dec 2017 13:13:54 +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 03704267587; Mon, 11 Dec 2017 13:13:53 +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 CDB33267583 for ; Mon, 11 Dec 2017 13:13:42 +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=Jy4z2wNWkXpFVK6kHfSUpl7jHznl2VA82MgSG4KbZPw=; b=SaDl02NMGagy pscbetsjfRnPCkEXaCE7mOecsAZ0gTyAs1j2MsQkVKohD8sbqddAt1BOlPMB53PA6jVUua4MKzZzz FkZRutpYWwf2h1J0zxoaeIKey4swB2lg0YHHURUAXUcX7BoR00QpD5Wns++bgBT+423/o7LxvMtpE DePS8=; 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 1eOMxl-0002Jj-Ur; Mon, 11 Dec 2017 12:13:37 +0000 Received: from broonie by debutante with local (Exim 4.90_RC3) (envelope-from ) id 1eOMxl-0004bT-GZ; Mon, 11 Dec 2017 12:13:37 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87mv2qui1k.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 11 Dec 2017 12:13:37 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Hiroyuki Yokoyama , Simon Subject: [alsa-devel] Applied "ASoC: rsnd: don't use runtime->sample_bits" 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: don't use runtime->sample_bits 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 41acc8ec04f32abb16e035ca1c9fe4d52819601e Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 11 Dec 2017 02:24:23 +0000 Subject: [PATCH] ASoC: rsnd: don't use runtime->sample_bits Current rsnd driver is judging 16bit/24bit data by using runtime->sample_bits, but it is indicating physical size, not format size. This is confusable code. This patch uses snd_pcm_format_width() to be more correct code. Tested-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 12 ++++-------- sound/soc/sh/rcar/ssi.c | 9 +++------ 2 files changed, 7 insertions(+), 14 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 8e50b284230d..a96ebebd96de 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -274,10 +274,10 @@ u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io) struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); struct device *dev = rsnd_priv_to_dev(priv); - switch (runtime->sample_bits) { + switch (snd_pcm_format_width(runtime->format)) { case 16: return 8 << 16; - case 32: + case 24: return 0 << 16; } @@ -327,7 +327,7 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io) } /* Non target mod or 24bit data needs normal DALIGN */ - if ((runtime->sample_bits != 16) || + if ((snd_pcm_format_width(runtime->format) != 16) || (mod != target)) return 0x76543210; /* Target mod needs inverted DALIGN when 16bit */ @@ -362,12 +362,8 @@ u32 rsnd_get_busif_shift(struct rsnd_dai_stream *io, struct rsnd_mod *mod) * HW 24bit data is located as 0x******00 * */ - switch (runtime->sample_bits) { - case 16: + if (snd_pcm_format_width(runtime->format) == 16) return 0; - case 32: - break; - } for (i = 0; i < ARRAY_SIZE(playback_mods); i++) { tmod = rsnd_io_to_mod(io, mods[i]); diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index f21202429000..5a70fdc3c680 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -370,11 +370,11 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, if (rsnd_io_is_play(io)) cr_own |= TRMD; - switch (runtime->sample_bits) { + switch (snd_pcm_format_width(runtime->format)) { case 16: cr_own |= DWL_16; break; - case 32: + case 24: cr_own |= DWL_24; break; } @@ -677,11 +677,8 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, rsnd_ssi_pointer_offset(mod, io, 0)); int shift = 0; - switch (runtime->sample_bits) { - case 32: + if (snd_pcm_format_width(runtime->format) == 24) shift = 8; - break; - } /* * 8/16/32 data can be assesse to TDR/RDR register