summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/mix.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2017-10-11 04:42:34 +0000
committerMark Brown <broonie@kernel.org>2017-10-11 09:46:17 +0100
commit3a9fa27be507b19107a8b3fe03a67e8145aea88c (patch)
treeb962e32339d0a5c27e359301d583e5bb4da95a04 /sound/soc/sh/rcar/mix.c
parent3e3c9ee1e4b3d0ef1f68f2037752196e7260bad9 (diff)
downloadlinux-3a9fa27be507b19107a8b3fe03a67e8145aea88c.tar.bz2
ASoC: rsnd: add rsnd_kctrl_xxx() macro
Current CTU/MIX/DVC are directly using rsnd_kctrl_cfg_m/s to control val etc, but it is difficult to read/understand. And there was no uniformity in access method. This patch adds new rsnd_kctrl_xxx() and implements uniformed access method. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/mix.c')
-rw-r--r--sound/soc/sh/rcar/mix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c
index 912cfec49038..7998380766f6 100644
--- a/sound/soc/sh/rcar/mix.c
+++ b/sound/soc/sh/rcar/mix.c
@@ -84,7 +84,7 @@ static void rsnd_mix_halt(struct rsnd_mod *mod)
#define rsnd_mix_get_vol(mix, X) \
rsnd_flags_has(mix, HAS_VOL##X) ? \
- (VOL_MAX - mix->volume##X.cfg.val[0]) : 0
+ (VOL_MAX - rsnd_kctrl_vals(mix->volume##X)) : 0
static void rsnd_mix_volume_parameter(struct rsnd_dai_stream *io,
struct rsnd_mod *mod)
{
@@ -116,9 +116,9 @@ static void rsnd_mix_volume_init(struct rsnd_dai_stream *io,
rsnd_mod_write(mod, MIX_ADINR, rsnd_runtime_channel_after_ctu(io));
/* volume step */
- rsnd_mod_write(mod, MIX_MIXMR, mix->ren.cfg.val[0]);
- rsnd_mod_write(mod, MIX_MVPDR, mix->rup.cfg.val[0] << 8 |
- mix->rdw.cfg.val[0]);
+ rsnd_mod_write(mod, MIX_MIXMR, rsnd_kctrl_vals(mix->ren));
+ rsnd_mod_write(mod, MIX_MVPDR, rsnd_kctrl_vals(mix->rup) << 8 |
+ rsnd_kctrl_vals(mix->rdw));
/* common volume parameter */
rsnd_mix_volume_parameter(io, mod);
@@ -217,7 +217,7 @@ static int rsnd_mix_pcm_new(struct rsnd_mod *mod,
volume, VOL_MAX);
if (ret < 0)
return ret;
- volume->cfg.val[0] = VOL_MAX;
+ rsnd_kctrl_vals(*volume) = VOL_MAX;
if (rsnd_flags_has(mix, ONCE_KCTRL_INITIALIZED))
return ret;