diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sh/rcar/core.c | 25 | ||||
-rw-r--r-- | sound/soc/sh/rcar/dvc.c | 15 | ||||
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 15 | ||||
-rw-r--r-- | sound/soc/sh/rcar/src.c | 8 |
4 files changed, 40 insertions, 23 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index daa01e2aebb6..266b24ae621d 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -880,16 +880,18 @@ static int rsnd_kctrl_put(struct snd_kcontrol *kctrl, | |||
880 | } | 880 | } |
881 | 881 | ||
882 | if (change) | 882 | if (change) |
883 | cfg->update(mod); | 883 | cfg->update(cfg->io, mod); |
884 | 884 | ||
885 | return change; | 885 | return change; |
886 | } | 886 | } |
887 | 887 | ||
888 | static int __rsnd_kctrl_new(struct rsnd_mod *mod, | 888 | static int __rsnd_kctrl_new(struct rsnd_mod *mod, |
889 | struct rsnd_dai_stream *io, | ||
889 | struct snd_soc_pcm_runtime *rtd, | 890 | struct snd_soc_pcm_runtime *rtd, |
890 | const unsigned char *name, | 891 | const unsigned char *name, |
891 | struct rsnd_kctrl_cfg *cfg, | 892 | struct rsnd_kctrl_cfg *cfg, |
892 | void (*update)(struct rsnd_mod *mod)) | 893 | void (*update)(struct rsnd_dai_stream *io, |
894 | struct rsnd_mod *mod)) | ||
893 | { | 895 | { |
894 | struct snd_soc_card *soc_card = rtd->card; | 896 | struct snd_soc_card *soc_card = rtd->card; |
895 | struct snd_card *card = rtd->card->snd_card; | 897 | struct snd_card *card = rtd->card->snd_card; |
@@ -918,6 +920,7 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod, | |||
918 | cfg->update = update; | 920 | cfg->update = update; |
919 | cfg->card = card; | 921 | cfg->card = card; |
920 | cfg->kctrl = kctrl; | 922 | cfg->kctrl = kctrl; |
923 | cfg->io = io; | ||
921 | 924 | ||
922 | return 0; | 925 | return 0; |
923 | } | 926 | } |
@@ -928,36 +931,42 @@ void _rsnd_kctrl_remove(struct rsnd_kctrl_cfg *cfg) | |||
928 | } | 931 | } |
929 | 932 | ||
930 | int rsnd_kctrl_new_m(struct rsnd_mod *mod, | 933 | int rsnd_kctrl_new_m(struct rsnd_mod *mod, |
934 | struct rsnd_dai_stream *io, | ||
931 | struct snd_soc_pcm_runtime *rtd, | 935 | struct snd_soc_pcm_runtime *rtd, |
932 | const unsigned char *name, | 936 | const unsigned char *name, |
933 | void (*update)(struct rsnd_mod *mod), | 937 | void (*update)(struct rsnd_dai_stream *io, |
938 | struct rsnd_mod *mod), | ||
934 | struct rsnd_kctrl_cfg_m *_cfg, | 939 | struct rsnd_kctrl_cfg_m *_cfg, |
935 | u32 max) | 940 | u32 max) |
936 | { | 941 | { |
937 | _cfg->cfg.max = max; | 942 | _cfg->cfg.max = max; |
938 | _cfg->cfg.size = RSND_DVC_CHANNELS; | 943 | _cfg->cfg.size = RSND_DVC_CHANNELS; |
939 | _cfg->cfg.val = _cfg->val; | 944 | _cfg->cfg.val = _cfg->val; |
940 | return __rsnd_kctrl_new(mod, rtd, name, &_cfg->cfg, update); | 945 | return __rsnd_kctrl_new(mod, io, rtd, name, &_cfg->cfg, update); |
941 | } | 946 | } |
942 | 947 | ||
943 | int rsnd_kctrl_new_s(struct rsnd_mod *mod, | 948 | int rsnd_kctrl_new_s(struct rsnd_mod *mod, |
949 | struct rsnd_dai_stream *io, | ||
944 | struct snd_soc_pcm_runtime *rtd, | 950 | struct snd_soc_pcm_runtime *rtd, |
945 | const unsigned char *name, | 951 | const unsigned char *name, |
946 | void (*update)(struct rsnd_mod *mod), | 952 | void (*update)(struct rsnd_dai_stream *io, |
953 | struct rsnd_mod *mod), | ||
947 | struct rsnd_kctrl_cfg_s *_cfg, | 954 | struct rsnd_kctrl_cfg_s *_cfg, |
948 | u32 max) | 955 | u32 max) |
949 | { | 956 | { |
950 | _cfg->cfg.max = max; | 957 | _cfg->cfg.max = max; |
951 | _cfg->cfg.size = 1; | 958 | _cfg->cfg.size = 1; |
952 | _cfg->cfg.val = &_cfg->val; | 959 | _cfg->cfg.val = &_cfg->val; |
953 | return __rsnd_kctrl_new(mod, rtd, name, &_cfg->cfg, update); | 960 | return __rsnd_kctrl_new(mod, io, rtd, name, &_cfg->cfg, update); |
954 | } | 961 | } |
955 | 962 | ||
956 | int rsnd_kctrl_new_e(struct rsnd_mod *mod, | 963 | int rsnd_kctrl_new_e(struct rsnd_mod *mod, |
964 | struct rsnd_dai_stream *io, | ||
957 | struct snd_soc_pcm_runtime *rtd, | 965 | struct snd_soc_pcm_runtime *rtd, |
958 | const unsigned char *name, | 966 | const unsigned char *name, |
959 | struct rsnd_kctrl_cfg_s *_cfg, | 967 | struct rsnd_kctrl_cfg_s *_cfg, |
960 | void (*update)(struct rsnd_mod *mod), | 968 | void (*update)(struct rsnd_dai_stream *io, |
969 | struct rsnd_mod *mod), | ||
961 | const char * const *texts, | 970 | const char * const *texts, |
962 | u32 max) | 971 | u32 max) |
963 | { | 972 | { |
@@ -965,7 +974,7 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod, | |||
965 | _cfg->cfg.size = 1; | 974 | _cfg->cfg.size = 1; |
966 | _cfg->cfg.val = &_cfg->val; | 975 | _cfg->cfg.val = &_cfg->val; |
967 | _cfg->cfg.texts = texts; | 976 | _cfg->cfg.texts = texts; |
968 | return __rsnd_kctrl_new(mod, rtd, name, &_cfg->cfg, update); | 977 | return __rsnd_kctrl_new(mod, io, rtd, name, &_cfg->cfg, update); |
969 | } | 978 | } |
970 | 979 | ||
971 | /* | 980 | /* |
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, |
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index ac03d2008ee8..fdb443b4f183 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
@@ -487,7 +487,8 @@ struct rsnd_kctrl_cfg { | |||
487 | unsigned int size; | 487 | unsigned int size; |
488 | u32 *val; | 488 | u32 *val; |
489 | const char * const *texts; | 489 | const char * const *texts; |
490 | void (*update)(struct rsnd_mod *mod); | 490 | void (*update)(struct rsnd_dai_stream *io, struct rsnd_mod *mod); |
491 | struct rsnd_dai_stream *io; | ||
491 | struct snd_card *card; | 492 | struct snd_card *card; |
492 | struct snd_kcontrol *kctrl; | 493 | struct snd_kcontrol *kctrl; |
493 | }; | 494 | }; |
@@ -507,22 +508,28 @@ void _rsnd_kctrl_remove(struct rsnd_kctrl_cfg *cfg); | |||
507 | #define rsnd_kctrl_remove(_cfg) _rsnd_kctrl_remove(&((_cfg).cfg)) | 508 | #define rsnd_kctrl_remove(_cfg) _rsnd_kctrl_remove(&((_cfg).cfg)) |
508 | 509 | ||
509 | int rsnd_kctrl_new_m(struct rsnd_mod *mod, | 510 | int rsnd_kctrl_new_m(struct rsnd_mod *mod, |
511 | struct rsnd_dai_stream *io, | ||
510 | struct snd_soc_pcm_runtime *rtd, | 512 | struct snd_soc_pcm_runtime *rtd, |
511 | const unsigned char *name, | 513 | const unsigned char *name, |
512 | void (*update)(struct rsnd_mod *mod), | 514 | void (*update)(struct rsnd_dai_stream *io, |
515 | struct rsnd_mod *mod), | ||
513 | struct rsnd_kctrl_cfg_m *_cfg, | 516 | struct rsnd_kctrl_cfg_m *_cfg, |
514 | u32 max); | 517 | u32 max); |
515 | int rsnd_kctrl_new_s(struct rsnd_mod *mod, | 518 | int rsnd_kctrl_new_s(struct rsnd_mod *mod, |
519 | struct rsnd_dai_stream *io, | ||
516 | struct snd_soc_pcm_runtime *rtd, | 520 | struct snd_soc_pcm_runtime *rtd, |
517 | const unsigned char *name, | 521 | const unsigned char *name, |
518 | void (*update)(struct rsnd_mod *mod), | 522 | void (*update)(struct rsnd_dai_stream *io, |
523 | struct rsnd_mod *mod), | ||
519 | struct rsnd_kctrl_cfg_s *_cfg, | 524 | struct rsnd_kctrl_cfg_s *_cfg, |
520 | u32 max); | 525 | u32 max); |
521 | int rsnd_kctrl_new_e(struct rsnd_mod *mod, | 526 | int rsnd_kctrl_new_e(struct rsnd_mod *mod, |
527 | struct rsnd_dai_stream *io, | ||
522 | struct snd_soc_pcm_runtime *rtd, | 528 | struct snd_soc_pcm_runtime *rtd, |
523 | const unsigned char *name, | 529 | const unsigned char *name, |
524 | struct rsnd_kctrl_cfg_s *_cfg, | 530 | struct rsnd_kctrl_cfg_s *_cfg, |
525 | void (*update)(struct rsnd_mod *mod), | 531 | void (*update)(struct rsnd_dai_stream *io, |
532 | struct rsnd_mod *mod), | ||
526 | const char * const *texts, | 533 | const char * const *texts, |
527 | u32 max); | 534 | u32 max); |
528 | 535 | ||
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index bc122ede3254..67db69686515 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c | |||
@@ -876,9 +876,9 @@ static int rsnd_src_stop_gen2(struct rsnd_mod *mod, | |||
876 | return ret; | 876 | return ret; |
877 | } | 877 | } |
878 | 878 | ||
879 | static void rsnd_src_reconvert_update(struct rsnd_mod *mod) | 879 | static void rsnd_src_reconvert_update(struct rsnd_dai_stream *io, |
880 | struct rsnd_mod *mod) | ||
880 | { | 881 | { |
881 | struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); | ||
882 | struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); | 882 | struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); |
883 | struct rsnd_src *src = rsnd_mod_to_src(mod); | 883 | struct rsnd_src *src = rsnd_mod_to_src(mod); |
884 | u32 convert_rate = rsnd_src_convert_rate(io, src); | 884 | u32 convert_rate = rsnd_src_convert_rate(io, src); |
@@ -931,7 +931,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, | |||
931 | /* | 931 | /* |
932 | * enable sync convert | 932 | * enable sync convert |
933 | */ | 933 | */ |
934 | ret = rsnd_kctrl_new_s(mod, rtd, | 934 | ret = rsnd_kctrl_new_s(mod, io, rtd, |
935 | rsnd_io_is_play(io) ? | 935 | rsnd_io_is_play(io) ? |
936 | "SRC Out Rate Switch" : | 936 | "SRC Out Rate Switch" : |
937 | "SRC In Rate Switch", | 937 | "SRC In Rate Switch", |
@@ -940,7 +940,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, | |||
940 | if (ret < 0) | 940 | if (ret < 0) |
941 | return ret; | 941 | return ret; |
942 | 942 | ||
943 | ret = rsnd_kctrl_new_s(mod, rtd, | 943 | ret = rsnd_kctrl_new_s(mod, io, rtd, |
944 | rsnd_io_is_play(io) ? | 944 | rsnd_io_is_play(io) ? |
945 | "SRC Out Rate" : | 945 | "SRC Out Rate" : |
946 | "SRC In Rate", | 946 | "SRC In Rate", |