From patchwork Mon Jun 18 12:00:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 138907 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3867517lji; Mon, 18 Jun 2018 05:02:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLAYa03WC3XjqFFsc8rGmwamK+Zu4QBYMmxVnKcMn4eXGoP/x94C7JYFlHqKAtoXyoILlhO X-Received: by 2002:a1c:8bc3:: with SMTP id n186-v6mr8204369wmd.34.1529323361409; Mon, 18 Jun 2018 05:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323361; cv=none; d=google.com; s=arc-20160816; b=0wIdzpy73lFl6yRb0rv9p9KQ2G/fJ+dAUTU851Tqk5mdtxuLScLPEYD0O+XarybSoQ 0CBMUlNA78QXIBffjXS42TwQ4cqdEsfWOR+wFNsYsj19Cvg1Ro9OYrFiJ/USBiAujgQ5 SZGH7Nlhb1FJtfbeFSz5ZNSj2dzc10RkJGUOg5rIcdhy2Ck1ct2WRtwr1qr/C7Jnw0T7 CoDPWFdgpoXPe5DEpw4KXIG05mgNaIgTWu5mCgSjo6xAea+uK524nnxPmOjEVfwuV5M3 jOmpvjD82spfylvTHYCEa8CKv3cFt8sk7C3VQx1JZEOc2rpWHdwNYP/qZbpoMcXVCgG8 F9zw== 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=GNDGBWTSvz06aAbdzGLBll6HtbL5/1rWCEU/2syWekk=; b=s0aGZkNHxfhD9FPvFurjfDmoWw3HqvDnZzZHsZBxaLpnErpEfQadJCeMF5YGsClPDk UkH/YewmBoNJWNfw9UBpOvMCYx0y5JwFm93YhnkL2Wa1O0dAj0OXmOuE6gTkPoDa0Imb IaiAr7h0nn6NWZDun+F0DosYmYgB07hNhNIaQNiAA/POMA1dMoOb62WIivSKIEQHfLaH EdStm/TZZ0l+bxSgJshjO5K6bOHAi2EQcw6cz/qFUOQ3doCgkOzfG5B3X4bco0XLM5gY hmyStH51bJpjqwSYKTwDzCvR8KtiR7IXXqaObxN+F5lHfc66r5XaTfj/uK9JYZZ9VCqP C2PQ== 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=aB0cgMHf; 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 x193-v6si7265631wme.21.2018.06.18.05.02.41; Mon, 18 Jun 2018 05:02:41 -0700 (PDT) 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=aB0cgMHf; 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 EF13D267749; Mon, 18 Jun 2018 14:00:43 +0200 (CEST) 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 22204267763; Mon, 18 Jun 2018 14:00:38 +0200 (CEST) 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, RCVD_IN_DNSWL_NONE, SPF_PASS 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 0FC3226771F for ; Mon, 18 Jun 2018 14:00:31 +0200 (CEST) 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=mPeNT02ke4mHNoozbJPNM4uO8nvU1Nn0CbVesrILixA=; b=aB0cgMHf2BIJ s3oZL8CRJ4nLwdBYrQhBFrqhtXn8fgu74cCa1r5K96sk6BO8v91I8b8HHIUpqg8uDBR8LoKPChRHW s8pq53k3FVZsv4lPJrdd5DSM0jOs0sd8yJSXvbkTVYmvUN9/okdZktpDrpECG+vEYjTWptLDqpsDI P+WV0=; 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 1fUsph-0007zF-5C; Mon, 18 Jun 2018 12:00:29 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fUspg-0000IK-Nw; Mon, 18 Jun 2018 13:00:28 +0100 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <874li8sghe.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 18 Jun 2018 13:00:28 +0100 Cc: alsa-devel@alsa-project.org, Mark Brown , Hiroyuki Yokoyama Subject: [alsa-devel] Applied "ASoC: rsnd: SSI parent cares SWSP bit" 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: SSI parent cares SWSP bit 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 203cdf51f28820bee7893b4be392847418e6f4ec Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 12 Jun 2018 05:52:17 +0000 Subject: [PATCH] ASoC: rsnd: SSI parent cares SWSP bit SSICR has SWSP bit (= Serial WS Polarity) which decides WS pin 1st channel polarity (low or hi). This bit shouldn't exchange after running. Current SSI "parent" doesn't care SSICR, just controls clock only. Because of this behavior, if platform uses SSI0 as playback, SSI1 as capture, and if user starts capture -> playback order, SSI0 SSICR::SWSP bit exchanged 0 -> 1 during captureing, and it makes capture noise. This patch cares SSICR on SSI parent, too. Special thanks to Yokoyama-san Reported-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssi.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) -- 2.17.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/ssi.c b/sound/soc/sh/rcar/ssi.c index 4e605648918b..98dd120d830a 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -37,6 +37,7 @@ #define CHNL_4 (1 << 22) /* Channels */ #define CHNL_6 (2 << 22) /* Channels */ #define CHNL_8 (3 << 22) /* Channels */ +#define DWL_MASK (7 << 19) /* Data Word Length mask */ #define DWL_8 (0 << 19) /* Data Word Length */ #define DWL_16 (1 << 19) /* Data Word Length */ #define DWL_18 (2 << 19) /* Data Word Length */ @@ -353,21 +354,18 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, struct rsnd_dai *rdai = rsnd_io_to_rdai(io); struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - u32 cr_own; - u32 cr_mode; - u32 wsr; + u32 cr_own = ssi->cr_own; + u32 cr_mode = ssi->cr_mode; + u32 wsr = ssi->wsr; int is_tdm; - if (rsnd_ssi_is_parent(mod, io)) - return; - is_tdm = rsnd_runtime_is_ssi_tdm(io); /* * always use 32bit system word. * see also rsnd_ssi_master_clk_enable() */ - cr_own = FORCE | SWL_32; + cr_own |= FORCE | SWL_32; if (rdai->bit_clk_inv) cr_own |= SCKP; @@ -377,9 +375,18 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, cr_own |= SDTA; if (rdai->sys_delay) cr_own |= DEL; + + /* + * We shouldn't exchange SWSP after running. + * This means, parent needs to care it. + */ + if (rsnd_ssi_is_parent(mod, io)) + goto init_end; + if (rsnd_io_is_play(io)) cr_own |= TRMD; + cr_own &= ~DWL_MASK; switch (snd_pcm_format_width(runtime->format)) { case 16: cr_own |= DWL_16; @@ -406,7 +413,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, wsr |= WS_MODE; cr_own |= CHNL_8; } - +init_end: ssi->cr_own = cr_own; ssi->cr_mode = cr_mode; ssi->wsr = wsr; @@ -470,15 +477,18 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod, return -EIO; } - if (!rsnd_ssi_is_parent(mod, io)) - ssi->cr_own = 0; - rsnd_ssi_master_clk_stop(mod, io); rsnd_mod_power_off(mod); ssi->usrcnt--; + if (!ssi->usrcnt) { + ssi->cr_own = 0; + ssi->cr_mode = 0; + ssi->wsr = 0; + } + return 0; }