diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2010-08-31 04:11:44 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-27 13:15:25 -0400 |
commit | ce3f054bdd4e022fa0ee9d11a215ec32f1caa12d (patch) | |
tree | b7a916e40d672e49361a4b258aee1d0550388a7b /arch/arm/plat-omap/mcbsp.c | |
parent | 813f6c5850521fec8917f61813be59691b60fcdf (diff) |
omap: McBSP: Do not enable SRG in slave mode
McBSP SRG (Sample Rate Generator) and FSG (Frame Sync
Generator) is only needed to be enabled, when McBSP
is master.
In McBSP slave mode, the SRG, and FSG can be kept disabled,
which might save some power at the end in this configuration.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/mcbsp.c')
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index e31496e35b0f..ecbfe398a309 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -878,7 +878,7 @@ EXPORT_SYMBOL(omap_mcbsp_free); | |||
878 | void omap_mcbsp_start(unsigned int id, int tx, int rx) | 878 | void omap_mcbsp_start(unsigned int id, int tx, int rx) |
879 | { | 879 | { |
880 | struct omap_mcbsp *mcbsp; | 880 | struct omap_mcbsp *mcbsp; |
881 | int idle; | 881 | int enable_srg = 0; |
882 | u16 w; | 882 | u16 w; |
883 | 883 | ||
884 | if (!omap_mcbsp_check_valid_id(id)) { | 884 | if (!omap_mcbsp_check_valid_id(id)) { |
@@ -893,10 +893,13 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx) | |||
893 | mcbsp->rx_word_length = (MCBSP_READ_CACHE(mcbsp, RCR1) >> 5) & 0x7; | 893 | mcbsp->rx_word_length = (MCBSP_READ_CACHE(mcbsp, RCR1) >> 5) & 0x7; |
894 | mcbsp->tx_word_length = (MCBSP_READ_CACHE(mcbsp, XCR1) >> 5) & 0x7; | 894 | mcbsp->tx_word_length = (MCBSP_READ_CACHE(mcbsp, XCR1) >> 5) & 0x7; |
895 | 895 | ||
896 | idle = !((MCBSP_READ_CACHE(mcbsp, SPCR2) | | 896 | /* Only enable SRG, if McBSP is master */ |
897 | MCBSP_READ_CACHE(mcbsp, SPCR1)) & 1); | 897 | w = MCBSP_READ_CACHE(mcbsp, PCR0); |
898 | if (w & (FSXM | FSRM | CLKXM | CLKRM)) | ||
899 | enable_srg = !((MCBSP_READ_CACHE(mcbsp, SPCR2) | | ||
900 | MCBSP_READ_CACHE(mcbsp, SPCR1)) & 1); | ||
898 | 901 | ||
899 | if (idle) { | 902 | if (enable_srg) { |
900 | /* Start the sample generator */ | 903 | /* Start the sample generator */ |
901 | w = MCBSP_READ_CACHE(mcbsp, SPCR2); | 904 | w = MCBSP_READ_CACHE(mcbsp, SPCR2); |
902 | MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 6)); | 905 | MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 6)); |
@@ -919,7 +922,7 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx) | |||
919 | */ | 922 | */ |
920 | udelay(500); | 923 | udelay(500); |
921 | 924 | ||
922 | if (idle) { | 925 | if (enable_srg) { |
923 | /* Start frame sync */ | 926 | /* Start frame sync */ |
924 | w = MCBSP_READ_CACHE(mcbsp, SPCR2); | 927 | w = MCBSP_READ_CACHE(mcbsp, SPCR2); |
925 | MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7)); | 928 | MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7)); |