Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715662

[PATCH v5 7/8] ASoC: sun4i-i2s: Update global enable with bitmask

From codekipper@gmail.com
Newsgroups linux.kernel
Subject [PATCH v5 7/8] ASoC: sun4i-i2s: Update global enable with bitmask
Date 2017-08-19 14:50 +0200
Message-ID <ugbmp-1m2-19@gated-at.bofh.it> (permalink)
References <ugbmp-1m2-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Marcus Cooper <codekipper@gmail.com>

The default value of the config register is different on newer
SoCs and therefore enabling/disabling with a register write
will clear bits used to set the direction of the clock and frame
pins.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
---
 sound/soc/sunxi/sun4i-i2s.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 573acca24a2c..19d50ca10d1f 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -529,8 +529,8 @@ static int sun4i_i2s_startup(struct snd_pcm_substream *substream,
 	struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
 
 	/* Enable the whole hardware block */
-	regmap_write(i2s->regmap, SUN4I_I2S_CTRL_REG,
-		     SUN4I_I2S_CTRL_GL_EN);
+	regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG,
+			   SUN4I_I2S_CTRL_GL_EN, SUN4I_I2S_CTRL_GL_EN);
 
 	/* Enable the first output line */
 	regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG,
@@ -553,7 +553,8 @@ static void sun4i_i2s_shutdown(struct snd_pcm_substream *substream,
 			   SUN4I_I2S_CTRL_SDO_EN_MASK, 0);
 
 	/* Disable the whole hardware block */
-	regmap_write(i2s->regmap, SUN4I_I2S_CTRL_REG, 0);
+	regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG,
+			   SUN4I_I2S_CTRL_GL_EN, 0);
 }
 
 static int sun4i_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id,
-- 
2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/8] ASoC: Add I2S support for Allwinner H3 SoCs codekipper@gmail.com - 2017-08-19 14:50 +0200
  [PATCH v5 3/8] ASoC: sun4i-i2s: bclk and lrclk polarity tidyup codekipper@gmail.com - 2017-08-19 14:50 +0200
    Re: [linux-sunxi] [PATCH v5 3/8] ASoC: sun4i-i2s: bclk and lrclk  polarity tidyup Chen-Yu Tsai <wens@csie.org> - 2017-08-19 17:00 +0200
  [PATCH v5 8/8] ASoC: sun4i-i2s: Add support for H3 codekipper@gmail.com - 2017-08-19 14:50 +0200
  [PATCH v5 7/8] ASoC: sun4i-i2s: Update global enable with bitmask codekipper@gmail.com - 2017-08-19 14:50 +0200
  [PATCH v5 4/8] ASoC: sun4i-i2s: Add mclk enable regmap field codekipper@gmail.com - 2017-08-19 15:00 +0200
    Re: [linux-sunxi] [PATCH v5 4/8] ASoC: sun4i-i2s: Add mclk enable  regmap field Chen-Yu Tsai <wens@csie.org> - 2017-08-19 17:20 +0200
  [PATCH v5 2/8] ASoC: sun4i-i2s: Add regfields for word size select and sample resolution codekipper@gmail.com - 2017-08-19 15:00 +0200
  [PATCH v5 1/8] ASoC: sun4i-i2s: Add regmap fields for channels codekipper@gmail.com - 2017-08-19 15:00 +0200
    Re: [linux-sunxi] [PATCH v5 1/8] ASoC: sun4i-i2s: Add regmap fields  for channels Chen-Yu Tsai <wens@csie.org> - 2017-08-19 17:20 +0200

csiph-web