diff options
author | Logesh <logesh.kolandavel@timesys.com> | 2019-05-01 05:04:24 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-05-01 21:57:47 -0400 |
commit | 414a7321d60bc0abced4a760e22b8187e2b4aecf (patch) | |
tree | c49dfd43e5df962e160ba593fe0f35326dcd73ff | |
parent | 882c8b4af315bf921431142c1e9f5f69df99da34 (diff) |
ASoC: da7213: fix DAI_CLK_EN register bit overwrite
If the da7213 codec is configured as Master with the DAPM power down
delay time set, 'snd_soc_component_write' function overwrites the
DAI_CLK_EN bit of DAI_CLK_MODE register which leads to audio play
only once until it re-initialize after codec power up.
Signed-off-by: Logesh <logesh.kolandavel@timesys.com>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/da7213.c | 5 | ||||
-rw-r--r-- | sound/soc/codecs/da7213.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index 92d006a5283e..425c11d63e49 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c | |||
@@ -1305,7 +1305,10 @@ static int da7213_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
1305 | /* By default only 64 BCLK per WCLK is supported */ | 1305 | /* By default only 64 BCLK per WCLK is supported */ |
1306 | dai_clk_mode |= DA7213_DAI_BCLKS_PER_WCLK_64; | 1306 | dai_clk_mode |= DA7213_DAI_BCLKS_PER_WCLK_64; |
1307 | 1307 | ||
1308 | snd_soc_component_write(component, DA7213_DAI_CLK_MODE, dai_clk_mode); | 1308 | snd_soc_component_update_bits(component, DA7213_DAI_CLK_MODE, |
1309 | DA7213_DAI_BCLKS_PER_WCLK_MASK | | ||
1310 | DA7213_DAI_CLK_POL_MASK | DA7213_DAI_WCLK_POL_MASK, | ||
1311 | dai_clk_mode); | ||
1309 | snd_soc_component_update_bits(component, DA7213_DAI_CTRL, DA7213_DAI_FORMAT_MASK, | 1312 | snd_soc_component_update_bits(component, DA7213_DAI_CTRL, DA7213_DAI_FORMAT_MASK, |
1310 | dai_ctrl); | 1313 | dai_ctrl); |
1311 | snd_soc_component_write(component, DA7213_DAI_OFFSET, dai_offset); | 1314 | snd_soc_component_write(component, DA7213_DAI_OFFSET, dai_offset); |
diff --git a/sound/soc/codecs/da7213.h b/sound/soc/codecs/da7213.h index 5a78dba1dcb5..9d31efc3cfe5 100644 --- a/sound/soc/codecs/da7213.h +++ b/sound/soc/codecs/da7213.h | |||
@@ -181,7 +181,9 @@ | |||
181 | #define DA7213_DAI_BCLKS_PER_WCLK_256 (0x3 << 0) | 181 | #define DA7213_DAI_BCLKS_PER_WCLK_256 (0x3 << 0) |
182 | #define DA7213_DAI_BCLKS_PER_WCLK_MASK (0x3 << 0) | 182 | #define DA7213_DAI_BCLKS_PER_WCLK_MASK (0x3 << 0) |
183 | #define DA7213_DAI_CLK_POL_INV (0x1 << 2) | 183 | #define DA7213_DAI_CLK_POL_INV (0x1 << 2) |
184 | #define DA7213_DAI_CLK_POL_MASK (0x1 << 2) | ||
184 | #define DA7213_DAI_WCLK_POL_INV (0x1 << 3) | 185 | #define DA7213_DAI_WCLK_POL_INV (0x1 << 3) |
186 | #define DA7213_DAI_WCLK_POL_MASK (0x1 << 3) | ||
185 | #define DA7213_DAI_CLK_EN_MASK (0x1 << 7) | 187 | #define DA7213_DAI_CLK_EN_MASK (0x1 << 7) |
186 | 188 | ||
187 | /* DA7213_DAI_CTRL = 0x29 */ | 189 | /* DA7213_DAI_CTRL = 0x29 */ |