diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-02-03 07:51:52 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-03 13:26:59 -0500 |
commit | 790bb94b56249b2f40907a0cbf959ca50b4430d2 (patch) | |
tree | 6ae4c5447b557ba212546c3571dfe81e20816608 | |
parent | d1debafc381cb1fa340b5d0dc79637ad1d523770 (diff) |
ASoC: davinci-mcasp: Remove long lines from suspend/resume callbacks
Move the context register storage behind of a struct and use a pointer to
it in the suspend/resume callbacks to remove the long lines.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index e5fce2ed4dc6..35b9b5505f07 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -37,6 +37,16 @@ | |||
37 | #include "davinci-pcm.h" | 37 | #include "davinci-pcm.h" |
38 | #include "davinci-mcasp.h" | 38 | #include "davinci-mcasp.h" |
39 | 39 | ||
40 | struct davinci_mcasp_context { | ||
41 | u32 txfmtctl; | ||
42 | u32 rxfmtctl; | ||
43 | u32 txfmt; | ||
44 | u32 rxfmt; | ||
45 | u32 aclkxctl; | ||
46 | u32 aclkrctl; | ||
47 | u32 pdir; | ||
48 | }; | ||
49 | |||
40 | struct davinci_mcasp { | 50 | struct davinci_mcasp { |
41 | struct davinci_pcm_dma_params dma_params[2]; | 51 | struct davinci_pcm_dma_params dma_params[2]; |
42 | struct snd_dmaengine_dai_dma_data dma_data[2]; | 52 | struct snd_dmaengine_dai_dma_data dma_data[2]; |
@@ -63,15 +73,7 @@ struct davinci_mcasp { | |||
63 | bool dat_port; | 73 | bool dat_port; |
64 | 74 | ||
65 | #ifdef CONFIG_PM_SLEEP | 75 | #ifdef CONFIG_PM_SLEEP |
66 | struct { | 76 | struct davinci_mcasp_context context; |
67 | u32 txfmtctl; | ||
68 | u32 rxfmtctl; | ||
69 | u32 txfmt; | ||
70 | u32 rxfmt; | ||
71 | u32 aclkxctl; | ||
72 | u32 aclkrctl; | ||
73 | u32 pdir; | ||
74 | } context; | ||
75 | #endif | 77 | #endif |
76 | }; | 78 | }; |
77 | 79 | ||
@@ -741,14 +743,15 @@ static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = { | |||
741 | static int davinci_mcasp_suspend(struct snd_soc_dai *dai) | 743 | static int davinci_mcasp_suspend(struct snd_soc_dai *dai) |
742 | { | 744 | { |
743 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); | 745 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); |
746 | struct davinci_mcasp_context *context = &mcasp->context; | ||
744 | 747 | ||
745 | mcasp->context.txfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG); | 748 | context->txfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG); |
746 | mcasp->context.rxfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG); | 749 | context->rxfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG); |
747 | mcasp->context.txfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMT_REG); | 750 | context->txfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMT_REG); |
748 | mcasp->context.rxfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMT_REG); | 751 | context->rxfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMT_REG); |
749 | mcasp->context.aclkxctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG); | 752 | context->aclkxctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG); |
750 | mcasp->context.aclkrctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG); | 753 | context->aclkrctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG); |
751 | mcasp->context.pdir = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDIR_REG); | 754 | context->pdir = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDIR_REG); |
752 | 755 | ||
753 | return 0; | 756 | return 0; |
754 | } | 757 | } |
@@ -756,14 +759,15 @@ static int davinci_mcasp_suspend(struct snd_soc_dai *dai) | |||
756 | static int davinci_mcasp_resume(struct snd_soc_dai *dai) | 759 | static int davinci_mcasp_resume(struct snd_soc_dai *dai) |
757 | { | 760 | { |
758 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); | 761 | struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); |
759 | 762 | struct davinci_mcasp_context *context = &mcasp->context; | |
760 | mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG, mcasp->context.txfmtctl); | 763 | |
761 | mcasp_set_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG, mcasp->context.rxfmtctl); | 764 | mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG, context->txfmtctl); |
762 | mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMT_REG, mcasp->context.txfmt); | 765 | mcasp_set_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG, context->rxfmtctl); |
763 | mcasp_set_reg(mcasp, DAVINCI_MCASP_RXFMT_REG, mcasp->context.rxfmt); | 766 | mcasp_set_reg(mcasp, DAVINCI_MCASP_TXFMT_REG, context->txfmt); |
764 | mcasp_set_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, mcasp->context.aclkxctl); | 767 | mcasp_set_reg(mcasp, DAVINCI_MCASP_RXFMT_REG, context->rxfmt); |
765 | mcasp_set_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, mcasp->context.aclkrctl); | 768 | mcasp_set_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, context->aclkxctl); |
766 | mcasp_set_reg(mcasp, DAVINCI_MCASP_PDIR_REG, mcasp->context.pdir); | 769 | mcasp_set_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, context->aclkrctl); |
770 | mcasp_set_reg(mcasp, DAVINCI_MCASP_PDIR_REG, context->pdir); | ||
767 | 771 | ||
768 | return 0; | 772 | return 0; |
769 | } | 773 | } |