diff options
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index c28508da34cf..63e24449eb89 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -42,14 +42,18 @@ | |||
42 | 42 | ||
43 | #define MCASP_MAX_AFIFO_DEPTH 64 | 43 | #define MCASP_MAX_AFIFO_DEPTH 64 |
44 | 44 | ||
45 | static u32 context_regs[] = { | ||
46 | DAVINCI_MCASP_TXFMCTL_REG, | ||
47 | DAVINCI_MCASP_RXFMCTL_REG, | ||
48 | DAVINCI_MCASP_TXFMT_REG, | ||
49 | DAVINCI_MCASP_RXFMT_REG, | ||
50 | DAVINCI_MCASP_ACLKXCTL_REG, | ||
51 | DAVINCI_MCASP_ACLKRCTL_REG, | ||
52 | DAVINCI_MCASP_PDIR_REG, | ||
53 | }; | ||
54 | |||
45 | struct davinci_mcasp_context { | 55 | struct davinci_mcasp_context { |
46 | u32 txfmtctl; | 56 | u32 config_regs[ARRAY_SIZE(context_regs)]; |
47 | u32 rxfmtctl; | ||
48 | u32 txfmt; | ||
49 | u32 rxfmt; | ||
50 | u32 aclkxctl; | ||
51 | u32 aclkrctl; | ||
52 | u32 pdir; | ||
53 | }; | 57 | }; |
54 | 58 | ||
55 | struct davinci_mcasp { | 59 | struct davinci_mcasp { |
@@ -857,14 +861,10 @@ static int davinci_mcasp_suspend(struct snd_soc_dai *dai) | |||
857 | { | 861 | { |
858 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); | 862 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); |
859 | struct davinci_mcasp_context *context = &mcasp->context; | 863 | struct davinci_mcasp_context *context = &mcasp->context; |
864 | int i; | ||
860 | 865 | ||
861 | context->txfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG); | 866 | for (i = 0; i < ARRAY_SIZE(context_regs); i++) |
862 | context->rxfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG); | 867 | context->config_regs[i] = mcasp_get_reg(mcasp, context_regs[i]); |
863 | context->txfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMT_REG); | ||
864 | context->rxfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMT_REG); | ||
865 | context->aclkxctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG); | ||
866 | context->aclkrctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG); | ||
867 | context->pdir = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDIR_REG); | ||
868 | 868 | ||
869 | return 0; | 869 | return 0; |
870 | } | 870 | } |
@@ -873,14 +873,10 @@ static int davinci_mcasp_resume(struct snd_soc_dai *dai) | |||
873 | { | 873 | { |
874 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); | 874 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); |
875 | struct davinci_mcasp_context *context = &mcasp->context; | 875 | struct davinci_mcasp_context *context = &mcasp->context; |
876 | int i; | ||
876 | 877 | ||
877 | mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG, context->txfmtctl); | 878 | for (i = 0; i < ARRAY_SIZE(context_regs); i++) |
878 | mcasp_set_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG, context->rxfmtctl); | 879 | mcasp_set_reg(mcasp, context_regs[i], context->config_regs[i]); |
879 | mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMT_REG, context->txfmt); | ||
880 | mcasp_set_reg(mcasp, DAVINCI_MCASP_RXFMT_REG, context->rxfmt); | ||
881 | mcasp_set_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, context->aclkxctl); | ||
882 | mcasp_set_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, context->aclkrctl); | ||
883 | mcasp_set_reg(mcasp, DAVINCI_MCASP_PDIR_REG, context->pdir); | ||
884 | 880 | ||
885 | return 0; | 881 | return 0; |
886 | } | 882 | } |