]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: rsnd: tidyup rsnd_ssi_master_clk_start() parameter
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 20 Dec 2013 03:28:39 +0000 (19:28 -0800)
committerMark Brown <broonie@linaro.org>
Tue, 31 Dec 2013 13:35:31 +0000 (13:35 +0000)
Renesas sound has SRC (= Sampling Rate Converter),
but, the HW implementation depends on its generation.
It was part of SRU on Gen1, and SCU on Gen2.
This SCU needs DMA transfer to use it.
Current rsnd driver is using it as DMA transfer buffer
(= no rate convert), and Gen1 is only supported at this point.

This patch cleanup it with focusing about SRC and Gen2 part.

ssi clock which is calculated from rsnd_ssi_master_clk_start()
should have flexibility since Renesas sound has
SRC (= Sampling Rate Converter).
But current implementation is using runtime->rate directly.
This patch tidyup rsnd_ssi_master_clk_start() parameter
as preparation of future SRC support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/sh/rcar/ssi.c

index 01b5cf945d61c25ea708b552faf8207460cfcf8b..2db9711549f5a3a45be4c43ebc4059d11fd9e3b7 100644 (file)
@@ -187,9 +187,10 @@ static void rsnd_ssi_status_check(struct rsnd_mod *mod,
 }
 
 static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi,
-                                    unsigned int rate)
+                                    struct rsnd_dai_stream *io)
 {
        struct rsnd_priv *priv = rsnd_mod_to_priv(&ssi->mod);
+       struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
        struct device *dev = rsnd_priv_to_dev(priv);
        int i, j, ret;
        int adg_clk_div_table[] = {
@@ -199,6 +200,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi,
                1, 2, 4, 8, 16, 6, 12,
        };
        unsigned int main_rate;
+       unsigned int rate = runtime->rate;
 
        /*
         * Find best clock, and try to start ADG
@@ -251,14 +253,10 @@ static void rsnd_ssi_hw_start(struct rsnd_ssi *ssi,
                clk_enable(ssi->clk);
 
                if (rsnd_rdai_is_clk_master(rdai)) {
-                       struct snd_pcm_runtime *runtime;
-
-                       runtime = rsnd_io_to_runtime(io);
-
                        if (rsnd_ssi_clk_from_parent(ssi))
                                rsnd_ssi_hw_start(ssi->parent, rdai, io);
                        else
-                               rsnd_ssi_master_clk_start(ssi, runtime->rate);
+                               rsnd_ssi_master_clk_start(ssi, io);
                }
        }