Skip to content

Commit

Permalink
ASoC: rsnd: src: make sure SRC soft reset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Jul 16, 2015
1 parent 636e4ba commit 379febf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sound/soc/sh/rcar/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ struct rsnd_src {
/*
* Gen1/Gen2 common functions
*/
static void rsnd_src_soft_reset(struct rsnd_mod *mod)
{
rsnd_mod_write(mod, SRC_SWRSR, 0);
rsnd_mod_write(mod, SRC_SWRSR, 1);
}

static struct dma_chan *rsnd_src_dma_req(struct rsnd_dai_stream *io,
struct rsnd_mod *mod)
{
Expand Down Expand Up @@ -294,10 +300,6 @@ static int rsnd_src_set_convert_rate(struct rsnd_mod *mod,
if (convert_rate)
fsrate = 0x0400000 / convert_rate * runtime->rate;

/* set/clear soft reset */
rsnd_mod_write(mod, SRC_SWRSR, 0);
rsnd_mod_write(mod, SRC_SWRSR, 1);

/* Set channel number and output bit length */
rsnd_mod_write(mod, SRC_ADINR, rsnd_get_adinr(mod, io));

Expand Down Expand Up @@ -358,6 +360,8 @@ static int rsnd_src_init(struct rsnd_mod *mod,

rsnd_mod_hw_start(mod);

rsnd_src_soft_reset(mod);

src->err = 0;

/* reset sync convert_rate */
Expand Down

0 comments on commit 379febf

Please sign in to comment.