diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-07-15 03:10:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-16 17:10:33 -0400 |
commit | 1a1bf58aafd09b3cb148eead3d709e2d7974a1f3 (patch) | |
tree | a934f40641a517f043fb063b3000c3aa9b17f99c | |
parent | a48e3f9747fd62b385221a892cd4726b82dacd11 (diff) |
ASoC: rsnd: add workaround for SRC sync convert + DVC
We couldn't use SRC sync convert mode together with DVC,
but we can use workaround for it.
This patch adds workaround and can use SRC sync convert + DVC
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>
-rw-r--r-- | sound/soc/sh/rcar/src.c | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 9e11f731a3a1..38d0aba7426e 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c | |||
@@ -616,6 +616,14 @@ static void rsnd_src_irq_ctrol_gen2(struct rsnd_mod *mod, int enable) | |||
616 | int_val = 0; | 616 | int_val = 0; |
617 | } | 617 | } |
618 | 618 | ||
619 | /* | ||
620 | * WORKAROUND | ||
621 | * | ||
622 | * ignore over flow error when rsnd_enable_sync_convert() | ||
623 | */ | ||
624 | if (rsnd_enable_sync_convert(src)) | ||
625 | sys_int_val = sys_int_val & 0xffff; | ||
626 | |||
619 | rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val); | 627 | rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val); |
620 | rsnd_mod_bset(mod, SCU_SYS_INT_EN0, sys_int_mask, sys_int_val); | 628 | rsnd_mod_bset(mod, SCU_SYS_INT_EN0, sys_int_mask, sys_int_val); |
621 | rsnd_mod_bset(mod, SCU_SYS_INT_EN1, sys_int_mask, sys_int_val); | 629 | rsnd_mod_bset(mod, SCU_SYS_INT_EN1, sys_int_mask, sys_int_val); |
@@ -631,11 +639,22 @@ static void rsnd_src_error_clear_gen2(struct rsnd_mod *mod) | |||
631 | 639 | ||
632 | static bool rsnd_src_error_record_gen2(struct rsnd_mod *mod) | 640 | static bool rsnd_src_error_record_gen2(struct rsnd_mod *mod) |
633 | { | 641 | { |
634 | u32 val = OUF_SRC(rsnd_mod_id(mod)); | 642 | struct rsnd_src *src = rsnd_mod_to_src(mod); |
643 | u32 val0, val1; | ||
635 | bool ret = false; | 644 | bool ret = false; |
636 | 645 | ||
637 | if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val) || | 646 | val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); |
638 | (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val)) { | 647 | |
648 | /* | ||
649 | * WORKAROUND | ||
650 | * | ||
651 | * ignore over flow error when rsnd_enable_sync_convert() | ||
652 | */ | ||
653 | if (rsnd_enable_sync_convert(src)) | ||
654 | val0 = val0 & 0xffff; | ||
655 | |||
656 | if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || | ||
657 | (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) { | ||
639 | struct rsnd_src *src = rsnd_mod_to_src(mod); | 658 | struct rsnd_src *src = rsnd_mod_to_src(mod); |
640 | 659 | ||
641 | src->err++; | 660 | src->err++; |
@@ -651,7 +670,16 @@ static bool rsnd_src_error_record_gen2(struct rsnd_mod *mod) | |||
651 | static int _rsnd_src_start_gen2(struct rsnd_mod *mod, | 670 | static int _rsnd_src_start_gen2(struct rsnd_mod *mod, |
652 | struct rsnd_dai_stream *io) | 671 | struct rsnd_dai_stream *io) |
653 | { | 672 | { |
654 | u32 val = rsnd_io_to_mod_dvc(io) ? 0x01 : 0x11; | 673 | struct rsnd_src *src = rsnd_mod_to_src(mod); |
674 | u32 val; | ||
675 | |||
676 | /* | ||
677 | * WORKAROUND | ||
678 | * | ||
679 | * Enable SRC output if you want to use sync convert together with DVC | ||
680 | */ | ||
681 | val = (rsnd_io_to_mod_dvc(io) && !rsnd_enable_sync_convert(src)) ? | ||
682 | 0x01 : 0x11; | ||
655 | 683 | ||
656 | rsnd_mod_write(mod, SRC_CTRL, val); | 684 | rsnd_mod_write(mod, SRC_CTRL, val); |
657 | 685 | ||
@@ -921,13 +949,6 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, | |||
921 | return 0; | 949 | return 0; |
922 | 950 | ||
923 | /* | 951 | /* |
924 | * We can't use SRC sync convert | ||
925 | * if it has DVC | ||
926 | */ | ||
927 | if (rsnd_io_to_mod_dvc(io)) | ||
928 | return 0; | ||
929 | |||
930 | /* | ||
931 | * enable sync convert | 952 | * enable sync convert |
932 | */ | 953 | */ |
933 | ret = rsnd_kctrl_new_s(mod, io, rtd, | 954 | ret = rsnd_kctrl_new_s(mod, io, rtd, |