Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Jaroslav Kysela <perex@perex.cz>
Subject: [PATCH 2/7] ASoC: kirkwood-i2s: provide helper KIRKWOOD_RECCTL_ENABLE_MASK definition
Date: Thu, 26 Jun 2014 15:22:55 +0100	[thread overview]
Message-ID: <E1X0AZj-0003iB-4N@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140626142231.GR32514@n2100.arm.linux.org.uk>

Add a KIRKWOOD_RECCTL_ENABLE_MASK definition to complement the existing
PLAYCTL definition, and make use of it where we wish to clear both
enable bits.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 sound/soc/kirkwood/kirkwood-i2s.c | 7 +++----
 sound/soc/kirkwood/kirkwood.h     | 3 +++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 9f842222e798..55af6c8e4603 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -322,8 +322,7 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream,
 		else
 			ctl &= ~KIRKWOOD_RECCTL_I2S_EN;		/* spdif */
 
-		value = ctl & ~(KIRKWOOD_RECCTL_I2S_EN |
-				KIRKWOOD_RECCTL_SPDIF_EN);
+		value = ctl & ~KIRKWOOD_RECCTL_ENABLE_MASK;
 		writel(value, priv->io + KIRKWOOD_RECCTL);
 
 		/* enable interrupts */
@@ -347,7 +346,7 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream,
 
 		/* disable all records */
 		value = readl(priv->io + KIRKWOOD_RECCTL);
-		value &= ~(KIRKWOOD_RECCTL_I2S_EN | KIRKWOOD_RECCTL_SPDIF_EN);
+		value &= ~KIRKWOOD_RECCTL_ENABLE_MASK;
 		writel(value, priv->io + KIRKWOOD_RECCTL);
 		break;
 
@@ -411,7 +410,7 @@ static int kirkwood_i2s_init(struct kirkwood_dma_data *priv)
 	writel(value, priv->io + KIRKWOOD_PLAYCTL);
 
 	value = readl(priv->io + KIRKWOOD_RECCTL);
-	value &= ~(KIRKWOOD_RECCTL_I2S_EN | KIRKWOOD_RECCTL_SPDIF_EN);
+	value &= ~KIRKWOOD_RECCTL_ENABLE_MASK;
 	writel(value, priv->io + KIRKWOOD_RECCTL);
 
 	return 0;
diff --git a/sound/soc/kirkwood/kirkwood.h b/sound/soc/kirkwood/kirkwood.h
index bf23afbba1d7..ab21de090938 100644
--- a/sound/soc/kirkwood/kirkwood.h
+++ b/sound/soc/kirkwood/kirkwood.h
@@ -38,6 +38,9 @@
 #define KIRKWOOD_RECCTL_SIZE_24		(1<<0)
 #define KIRKWOOD_RECCTL_SIZE_32		(0<<0)
 
+#define KIRKWOOD_RECCTL_ENABLE_MASK		(KIRKWOOD_RECCTL_SPDIF_EN | \
+						 KIRKWOOD_RECCTL_I2S_EN)
+
 #define KIRKWOOD_REC_BUF_ADDR			0x1004
 #define KIRKWOOD_REC_BUF_SIZE			0x1008
 #define KIRKWOOD_REC_BYTE_COUNT			0x100C
-- 
1.8.3.1

  parent reply	other threads:[~2014-06-26 14:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 14:22 [PATCH 0/7] Kirkwood ASoC updates Russell King - ARM Linux
2014-06-26 14:22 ` [PATCH 1/7] ASoC: fix debugfs directory creation bug Russell King
2014-06-27  2:45   ` Lars-Peter Clausen
2014-06-28 12:46     ` Mark Brown
2014-06-26 14:22 ` Russell King [this message]
2014-06-26 14:23 ` [PATCH 3/7] ASoC: kirkwood-i2s: fix RECCTL masking Russell King
2014-06-26 14:23 ` [PATCH 4/7] ASoC: kirkwood-i2s: fix mute handling Russell King
2014-06-26 14:23 ` [PATCH 5/7] ASoC: kirkwood-i2s: fix pause handling some more Russell King
2014-06-26 14:23 ` [PATCH 6/7] ASoC: kirkwood: allow smaller audio periods and smaller number of periods Russell King
2014-06-26 14:23 ` [PATCH 7/7] ASoC: kirkwood: implement NO_PERIOD_WAKEUP support Russell King
2014-06-26 18:10 ` [PATCH 0/7] Kirkwood ASoC updates Andrew Lunn
2014-06-26 18:22   ` Russell King - ARM Linux
2014-06-28 12:47 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1X0AZj-0003iB-4N@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox