diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-06-15 02:27:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-16 07:34:04 -0400 |
commit | b65a7cccb58ce5acfed579e1ca10f8a4d3d0dd04 (patch) | |
tree | 907a223c2d99a8f4bd88d8df8b8b6ccfb9712ea4 /sound/soc/sh/rcar/dvc.c | |
parent | 88c61cff4dab7c23a101b12041c99da61df305dd (diff) |
ASoC: rsnd: don't use rsnd_mod_to_io() on snd_kcontrol
Each Renesas sound mod (= SSI/SRC/DVC) might be called from many paths
if it supports MIXer. In such case, mod <-> io is no longer 1:1
relationship. This patch removes rsnd_mod_to_io() from snd_kcontrol
and related function.
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>
Diffstat (limited to 'sound/soc/sh/rcar/dvc.c')
-rw-r--r-- | sound/soc/sh/rcar/dvc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 3aac790534f0..36fc020cbc18 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c | |||
@@ -63,7 +63,8 @@ static const char * const dvc_ramp_rate[] = { | |||
63 | "0.125 dB/8192 steps", /* 10111 */ | 63 | "0.125 dB/8192 steps", /* 10111 */ |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static void rsnd_dvc_volume_update(struct rsnd_mod *mod) | 66 | static void rsnd_dvc_volume_update(struct rsnd_dai_stream *io, |
67 | struct rsnd_mod *mod) | ||
67 | { | 68 | { |
68 | struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); | 69 | struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); |
69 | u32 val[RSND_DVC_CHANNELS]; | 70 | u32 val[RSND_DVC_CHANNELS]; |
@@ -172,7 +173,7 @@ static int rsnd_dvc_init(struct rsnd_mod *dvc_mod, | |||
172 | rsnd_mod_write(dvc_mod, DVC_ADINR, rsnd_get_adinr(dvc_mod, io)); | 173 | rsnd_mod_write(dvc_mod, DVC_ADINR, rsnd_get_adinr(dvc_mod, io)); |
173 | 174 | ||
174 | /* ch0/ch1 Volume */ | 175 | /* ch0/ch1 Volume */ |
175 | rsnd_dvc_volume_update(dvc_mod); | 176 | rsnd_dvc_volume_update(io, dvc_mod); |
176 | 177 | ||
177 | rsnd_mod_write(dvc_mod, DVC_DVUIR, 0); | 178 | rsnd_mod_write(dvc_mod, DVC_DVUIR, 0); |
178 | 179 | ||
@@ -217,7 +218,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
217 | int ret; | 218 | int ret; |
218 | 219 | ||
219 | /* Volume */ | 220 | /* Volume */ |
220 | ret = rsnd_kctrl_new_m(mod, rtd, | 221 | ret = rsnd_kctrl_new_m(mod, io, rtd, |
221 | is_play ? | 222 | is_play ? |
222 | "DVC Out Playback Volume" : "DVC In Capture Volume", | 223 | "DVC Out Playback Volume" : "DVC In Capture Volume", |
223 | rsnd_dvc_volume_update, | 224 | rsnd_dvc_volume_update, |
@@ -226,7 +227,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
226 | return ret; | 227 | return ret; |
227 | 228 | ||
228 | /* Mute */ | 229 | /* Mute */ |
229 | ret = rsnd_kctrl_new_m(mod, rtd, | 230 | ret = rsnd_kctrl_new_m(mod, io, rtd, |
230 | is_play ? | 231 | is_play ? |
231 | "DVC Out Mute Switch" : "DVC In Mute Switch", | 232 | "DVC Out Mute Switch" : "DVC In Mute Switch", |
232 | rsnd_dvc_volume_update, | 233 | rsnd_dvc_volume_update, |
@@ -235,7 +236,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
235 | return ret; | 236 | return ret; |
236 | 237 | ||
237 | /* Ramp */ | 238 | /* Ramp */ |
238 | ret = rsnd_kctrl_new_s(mod, rtd, | 239 | ret = rsnd_kctrl_new_s(mod, io, rtd, |
239 | is_play ? | 240 | is_play ? |
240 | "DVC Out Ramp Switch" : "DVC In Ramp Switch", | 241 | "DVC Out Ramp Switch" : "DVC In Ramp Switch", |
241 | rsnd_dvc_volume_update, | 242 | rsnd_dvc_volume_update, |
@@ -243,7 +244,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
243 | if (ret < 0) | 244 | if (ret < 0) |
244 | return ret; | 245 | return ret; |
245 | 246 | ||
246 | ret = rsnd_kctrl_new_e(mod, rtd, | 247 | ret = rsnd_kctrl_new_e(mod, io, rtd, |
247 | is_play ? | 248 | is_play ? |
248 | "DVC Out Ramp Up Rate" : "DVC In Ramp Up Rate", | 249 | "DVC Out Ramp Up Rate" : "DVC In Ramp Up Rate", |
249 | &dvc->rup, | 250 | &dvc->rup, |
@@ -252,7 +253,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
252 | if (ret < 0) | 253 | if (ret < 0) |
253 | return ret; | 254 | return ret; |
254 | 255 | ||
255 | ret = rsnd_kctrl_new_e(mod, rtd, | 256 | ret = rsnd_kctrl_new_e(mod, io, rtd, |
256 | is_play ? | 257 | is_play ? |
257 | "DVC Out Ramp Down Rate" : "DVC In Ramp Down Rate", | 258 | "DVC Out Ramp Down Rate" : "DVC In Ramp Down Rate", |
258 | &dvc->rdown, | 259 | &dvc->rdown, |