Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db43b16f authored by Russell King's avatar Russell King Committed by Mark Brown
Browse files

ASoC: kirkwood: provide KIRKWOOD_PLAYCTL_ENABLE_MASK



Provide a helper macro which includes the sum of all enable bits in
the playback control register.  This simplifies the code a little.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent af64d734
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -198,8 +198,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream,
			ctl_play |= KIRKWOOD_PLAYCTL_MONO_OFF;

		priv->ctl_play &= ~(KIRKWOOD_PLAYCTL_MONO_MASK |
				    KIRKWOOD_PLAYCTL_I2S_EN |
				    KIRKWOOD_PLAYCTL_SPDIF_EN |
				    KIRKWOOD_PLAYCTL_ENABLE_MASK |
				    KIRKWOOD_PLAYCTL_SIZE_MASK);
		priv->ctl_play |= ctl_play;
	} else {
@@ -243,8 +242,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
	case SNDRV_PCM_TRIGGER_START:
		/* configure */
		ctl = priv->ctl_play;
		value = ctl & ~(KIRKWOOD_PLAYCTL_I2S_EN |
				KIRKWOOD_PLAYCTL_SPDIF_EN);
		value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
		writel(value, priv->io + KIRKWOOD_PLAYCTL);

		/* enable interrupts */
@@ -266,7 +264,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
		writel(value, priv->io + KIRKWOOD_INT_MASK);

		/* disable all playbacks */
		ctl &= ~(KIRKWOOD_PLAYCTL_I2S_EN | KIRKWOOD_PLAYCTL_SPDIF_EN);
		ctl &= ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
		writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
		break;

@@ -386,7 +384,7 @@ static int kirkwood_i2s_probe(struct snd_soc_dai *dai)

	/* disable playback/record */
	value = readl(priv->io + KIRKWOOD_PLAYCTL);
	value &= ~(KIRKWOOD_PLAYCTL_I2S_EN|KIRKWOOD_PLAYCTL_SPDIF_EN);
	value &= ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
	writel(value, priv->io + KIRKWOOD_PLAYCTL);

	value = readl(priv->io + KIRKWOOD_RECCTL);
+4 −1
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@
#define KIRKWOOD_PLAYCTL_SIZE_24		(1<<0)
#define KIRKWOOD_PLAYCTL_SIZE_32		(0<<0)

#define KIRKWOOD_PLAYCTL_ENABLE_MASK		(KIRKWOOD_PLAYCTL_SPDIF_EN | \
						 KIRKWOOD_PLAYCTL_I2S_EN)

#define KIRKWOOD_PLAY_BUF_ADDR			0x1104
#define KIRKWOOD_PLAY_BUF_SIZE			0x1108
#define KIRKWOOD_PLAY_BYTE_COUNT		0x110C