ASoC: rsnd: add rsnd_io_to_rdai()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 15 Jan 2015 08:06:24 +0000 (08:06 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 15 Jan 2015 11:37:48 +0000 (11:37 +0000)
Current rsnd driver request rdai in everywhere, but each mod should
reach to rdai by itself. this patch adds missing rsnd_io_to_rdai().

io   = rsnd_mod_to_io(mod);
rdai = rsnd_io_to_rdai(io);

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

index 852fa0410afda9c6af15f896e92afcb1def22b6c..c8111857c9d9f7ef74ac919ca97a6ceea72b5a54 100644 (file)
@@ -886,6 +886,7 @@ static int rsnd_dai_probe(struct platform_device *pdev,
                        drv[i].playback.channels_max    = 2;
 
                        rdai[i].playback.info = &info->dai_info[i].playback;
+                       rdai[i].playback.rdai = rdai + i;
                        rsnd_path_init(priv, &rdai[i], &rdai[i].playback);
                }
                if (cmod) {
@@ -895,6 +896,7 @@ static int rsnd_dai_probe(struct platform_device *pdev,
                        drv[i].capture.channels_max     = 2;
 
                        rdai[i].capture.info = &info->dai_info[i].capture;
+                       rdai[i].capture.rdai = rdai + i;
                        rsnd_path_init(priv, &rdai[i], &rdai[i].capture);
                }
 
index ad76870dba13710edc969f99223752701d6cd9c1..0b5518259c2883d8a425c5071e7cff7f19d3e60a 100644 (file)
@@ -282,6 +282,7 @@ struct rsnd_dai_stream {
        struct snd_pcm_substream *substream;
        struct rsnd_mod *mod[RSND_MOD_MAX];
        struct rsnd_dai_path_info *info; /* rcar_snd.h */
+       struct rsnd_dai *rdai;
        int byte_pos;
        int period_pos;
        int byte_per_period;
@@ -290,6 +291,7 @@ struct rsnd_dai_stream {
 #define rsnd_io_to_mod_ssi(io) ((io)->mod[RSND_MOD_SSI])
 #define rsnd_io_to_mod_src(io) ((io)->mod[RSND_MOD_SRC])
 #define rsnd_io_to_mod_dvc(io) ((io)->mod[RSND_MOD_DVC])
+#define rsnd_io_to_rdai(io)    ((io)->rdai)
 #define rsnd_io_to_runtime(io) ((io)->substream ? \
                                (io)->substream->runtime : NULL)