]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: kirkwood-i2s: provide helper KIRKWOOD_RECCTL_ENABLE_MASK definition
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 26 Jun 2014 14:22:55 +0000 (15:22 +0100)
committerMark Brown <broonie@linaro.org>
Sat, 28 Jun 2014 12:18:17 +0000 (13:18 +0100)
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>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/kirkwood/kirkwood-i2s.c
sound/soc/kirkwood/kirkwood.h

index 9f842222e79802e2628a826ac536a506a069d8c0..55af6c8e4603deaff126ee0e1e08487a701dc8c4 100644 (file)
@@ -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;
index bf23afbba1d7ba3d6e5e8f3bb22f078e5b2908ae..ab21de090938d08ded067c07a02050593c7aad5e 100644 (file)
@@ -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