diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-07-15 03:12:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-16 17:29:20 -0400 |
commit | 379febfd2e30ec8db5baccd9f9403bf650c6afa1 (patch) | |
tree | 334abaff24634b45debdfb970337ef63d1884963 | |
parent | 636e4bad5cca947839c09d3e13ad6feeb7fa45da (diff) |
ASoC: rsnd: src: make sure SRC soft reset
Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC,
and these have similar register. xxxRSR (Software reset Register) is one
of them. These xxxRSR need be set to 1 to 0 when software reset.
Current rsnd driver has src.c / dvc.c, and we will have mix.c.
It is readable if these have same named function.
This patch adds rsnd_src_soft_reset() and make sure it
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sh/rcar/src.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 0b06ac8dbeec..74ab644c688e 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c | |||
@@ -118,6 +118,12 @@ struct rsnd_src { | |||
118 | /* | 118 | /* |
119 | * Gen1/Gen2 common functions | 119 | * Gen1/Gen2 common functions |
120 | */ | 120 | */ |
121 | static void rsnd_src_soft_reset(struct rsnd_mod *mod) | ||
122 | { | ||
123 | rsnd_mod_write(mod, SRC_SWRSR, 0); | ||
124 | rsnd_mod_write(mod, SRC_SWRSR, 1); | ||
125 | } | ||
126 | |||
121 | static struct dma_chan *rsnd_src_dma_req(struct rsnd_dai_stream *io, | 127 | static struct dma_chan *rsnd_src_dma_req(struct rsnd_dai_stream *io, |
122 | struct rsnd_mod *mod) | 128 | struct rsnd_mod *mod) |
123 | { | 129 | { |
@@ -294,10 +300,6 @@ static int rsnd_src_set_convert_rate(struct rsnd_mod *mod, | |||
294 | if (convert_rate) | 300 | if (convert_rate) |
295 | fsrate = 0x0400000 / convert_rate * runtime->rate; | 301 | fsrate = 0x0400000 / convert_rate * runtime->rate; |
296 | 302 | ||
297 | /* set/clear soft reset */ | ||
298 | rsnd_mod_write(mod, SRC_SWRSR, 0); | ||
299 | rsnd_mod_write(mod, SRC_SWRSR, 1); | ||
300 | |||
301 | /* Set channel number and output bit length */ | 303 | /* Set channel number and output bit length */ |
302 | rsnd_mod_write(mod, SRC_ADINR, rsnd_get_adinr(mod, io)); | 304 | rsnd_mod_write(mod, SRC_ADINR, rsnd_get_adinr(mod, io)); |
303 | 305 | ||
@@ -358,6 +360,8 @@ static int rsnd_src_init(struct rsnd_mod *mod, | |||
358 | 360 | ||
359 | rsnd_mod_hw_start(mod); | 361 | rsnd_mod_hw_start(mod); |
360 | 362 | ||
363 | rsnd_src_soft_reset(mod); | ||
364 | |||
361 | src->err = 0; | 365 | src->err = 0; |
362 | 366 | ||
363 | /* reset sync convert_rate */ | 367 | /* reset sync convert_rate */ |