ASoC: rsnd: replace rsnd_dai_is_play() to rsnd_io_is_play()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 15 Jan 2015 08:06:49 +0000 (08:06 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 15 Jan 2015 11:37:48 +0000 (11:37 +0000)
Current rsnd driver can use rsnd_io_to_rdai()
we can get play/capture direction via io now.
Let's replace rsnd_dai_is_play() to rsnd_io_is_play()

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

index 14d1a71934692fb18b2155311b59a30b7cda62b1..9d22c75b9b323200c484964898fa9e4e781b4a5a 100644 (file)
@@ -80,7 +80,7 @@ static int rsnd_adg_set_src_timsel_gen2(struct rsnd_dai *rdai,
                                        struct rsnd_dai_stream *io,
                                        u32 timsel)
 {
-       int is_play = rsnd_dai_is_play(rdai, io);
+       int is_play = rsnd_io_is_play(io);
        int id = rsnd_mod_id(mod);
        int shift = (id % 2) ? 16 : 0;
        u32 mask, ws;
index c8111857c9d9f7ef74ac919ca97a6ceea72b5a54..c1f577da41fe4b843ddbaef7c8c5133d64cd64ee 100644 (file)
@@ -494,11 +494,6 @@ static struct rsnd_dai *rsnd_dai_to_rdai(struct snd_soc_dai *dai)
        return rsnd_rdai_get(priv, dai->id);
 }
 
-int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io)
-{
-       return &rdai->playback == io;
-}
-
 /*
  *     rsnd_soc_dai functions
  */
index 77cb0089047188ec2269db121bb8d4a434c157e8..225baa32bf0b01f016efeb35d59b11f8c52e0202 100644 (file)
@@ -206,11 +206,12 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
 {
        struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
        struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod);
+       int is_play = rsnd_io_is_play(io);
        int ret;
 
        /* Volume */
        ret = rsnd_kctrl_new_m(mod, rdai, rtd,
-                       rsnd_dai_is_play(rdai, io) ?
+                       is_play ?
                        "DVC Out Playback Volume" : "DVC In Capture Volume",
                        rsnd_dvc_volume_update,
                        &dvc->volume, 0x00800000 - 1);
@@ -219,7 +220,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
 
        /* Mute */
        ret = rsnd_kctrl_new_m(mod, rdai, rtd,
-                       rsnd_dai_is_play(rdai, io) ?
+                       is_play ?
                        "DVC Out Mute Switch" : "DVC In Mute Switch",
                        rsnd_dvc_volume_update,
                        &dvc->mute, 1);
@@ -228,7 +229,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
 
        /* Ramp */
        ret = rsnd_kctrl_new_s(mod, rdai, rtd,
-                       rsnd_dai_is_play(rdai, io) ?
+                       is_play ?
                        "DVC Out Ramp Switch" : "DVC In Ramp Switch",
                        rsnd_dvc_volume_update,
                        &dvc->ren, 1);
@@ -236,7 +237,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
                return ret;
 
        ret = rsnd_kctrl_new_e(mod, rdai, rtd,
-                       rsnd_dai_is_play(rdai, io) ?
+                       is_play ?
                        "DVC Out Ramp Up Rate" : "DVC In Ramp Up Rate",
                        &dvc->rup,
                        rsnd_dvc_volume_update,
@@ -245,7 +246,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
                return ret;
 
        ret = rsnd_kctrl_new_e(mod, rdai, rtd,
-                       rsnd_dai_is_play(rdai, io) ?
+                       is_play ?
                        "DVC Out Ramp Down Rate" : "DVC In Ramp Down Rate",
                        &dvc->rdown,
                        rsnd_dvc_volume_update,
index 0b5518259c2883d8a425c5071e7cff7f19d3e60a..83eb46c35e94d28ae5f74ee296fc980d445f7401 100644 (file)
@@ -292,9 +292,11 @@ struct rsnd_dai_stream {
 #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_is_play(io)    (&rsnd_io_to_rdai(io)->playback == io)
 #define rsnd_io_to_runtime(io) ((io)->substream ? \
                                (io)->substream->runtime : NULL)
 
+
 struct rsnd_dai {
        char name[RSND_DAI_NAME_SIZE];
        struct rsnd_dai_stream playback;
@@ -317,8 +319,6 @@ struct rsnd_dai {
 
 struct rsnd_dai *rsnd_rdai_get(struct rsnd_priv *priv, int id);
 
-int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io);
-
 void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt);
 int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
 
index cb2dbf3b8569fa8c27f7cb8e4d38e3822e296a12..d4f9cccfff55f0461885aa1f5df160961edee5e9 100644 (file)
@@ -362,7 +362,7 @@ static int rsnd_src_set_route_gen1(struct rsnd_mod *mod,
        /*
         * SRC_ROUTE_SELECT
         */
-       val = rsnd_dai_is_play(rdai, io) ? 0x1 : 0x2;
+       val = rsnd_io_is_play(io) ? 0x1 : 0x2;
        val = val               << routes[id].shift;
        mask = routes[id].mask  << routes[id].shift;
 
index 816178c71a6b3f193001cb04e1da2cb159752ede..b9d33b985845056ca0b696784e545eed92d10c62 100644 (file)
@@ -307,7 +307,7 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
                cr |= SDTA;
        if (rdai->sys_delay)
                cr |= DEL;
-       if (rsnd_dai_is_play(rdai, io))
+       if (rsnd_io_is_play(io))
                cr |= TRMD;
 
        /*
@@ -401,7 +401,7 @@ static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
                 * directly as 32bit data
                 * see rsnd_ssi_init()
                 */
-               if (rsnd_dai_is_play(rdai, io))
+               if (rsnd_io_is_play(io))
                        rsnd_mod_write(mod, SSITDR, *buf);
                else
                        *buf = rsnd_mod_read(mod, SSIRDR);