aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-11-27 03:07:07 -0500
committerMark Brown <broonie@kernel.org>2014-12-03 13:51:40 -0500
commit933cc8cb08d867459689662cf67017ea6f0c6b53 (patch)
tree5eaef4b85026247e2be157b8d0349db20c747658
parent603cefa59b1aed460f5fdcb1b6af32efc7e6d82f (diff)
ASoC: rsnd: set SRC_ROUTE_MODE0 on each rsnd_src_set_convert_rate()
Current src.c sets SRC_ROUTE_MODE0 on rsnd_src_start(), but, set it in rsnd_src_set_convert_rate() is natural. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sh/rcar/src.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 6a63f8fcf991..0b6b230e339a 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -302,17 +302,12 @@ static int rsnd_src_quit(struct rsnd_mod *mod,
302static int rsnd_src_start(struct rsnd_mod *mod, 302static int rsnd_src_start(struct rsnd_mod *mod,
303 struct rsnd_dai *rdai) 303 struct rsnd_dai *rdai)
304{ 304{
305 struct rsnd_src *src = rsnd_mod_to_src(mod);
306
307 /* 305 /*
308 * Cancel the initialization and operate the SRC function 306 * Cancel the initialization and operate the SRC function
309 * see rsnd_src_init() 307 * see rsnd_src_init()
310 */ 308 */
311 rsnd_mod_write(mod, SRC_SRCIR, 0); 309 rsnd_mod_write(mod, SRC_SRCIR, 0);
312 310
313 if (rsnd_src_convert_rate(src))
314 rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
315
316 return 0; 311 return 0;
317} 312}
318 313
@@ -320,11 +315,7 @@ static int rsnd_src_start(struct rsnd_mod *mod,
320static int rsnd_src_stop(struct rsnd_mod *mod, 315static int rsnd_src_stop(struct rsnd_mod *mod,
321 struct rsnd_dai *rdai) 316 struct rsnd_dai *rdai)
322{ 317{
323 struct rsnd_src *src = rsnd_mod_to_src(mod); 318 /* nothing to do */
324
325 if (rsnd_src_convert_rate(src))
326 rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0);
327
328 return 0; 319 return 0;
329} 320}
330 321
@@ -431,6 +422,7 @@ static int rsnd_src_set_convert_timing_gen1(struct rsnd_mod *mod,
431static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod, 422static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod,
432 struct rsnd_dai *rdai) 423 struct rsnd_dai *rdai)
433{ 424{
425 struct rsnd_src *src = rsnd_mod_to_src(mod);
434 int ret; 426 int ret;
435 427
436 ret = rsnd_src_set_convert_rate(mod, rdai); 428 ret = rsnd_src_set_convert_rate(mod, rdai);
@@ -444,6 +436,10 @@ static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod,
444 rsnd_mod_write(mod, SRC_MNFSR, 436 rsnd_mod_write(mod, SRC_MNFSR,
445 rsnd_mod_read(mod, SRC_IFSVR) / 100 * 98); 437 rsnd_mod_read(mod, SRC_IFSVR) / 100 * 98);
446 438
439 /* Gen1/Gen2 are not compatible */
440 if (rsnd_src_convert_rate(src))
441 rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
442
447 /* no SRC_BFSSR settings, since SRC_SRCCR::BUFMD is 0 */ 443 /* no SRC_BFSSR settings, since SRC_SRCCR::BUFMD is 0 */
448 444
449 return 0; 445 return 0;
@@ -548,6 +544,11 @@ static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod,
548 544
549 rsnd_mod_write(mod, SRC_SRCCR, 0x00011110); 545 rsnd_mod_write(mod, SRC_SRCCR, 0x00011110);
550 546
547 if (convert_rate) {
548 /* Gen1/Gen2 are not compatible */
549 rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
550 }
551
551 switch (rsnd_mod_id(mod)) { 552 switch (rsnd_mod_id(mod)) {
552 case 5: 553 case 5:
553 case 6: 554 case 6: