aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2010-02-23 10:50:38 -0500
committerTony Lindgren <tony@atomide.com>2010-03-12 12:16:09 -0500
commit0841cb826859a4f14c472cc75a782811310f010e (patch)
tree79a088cfdf9468b5bd3235062ff5b3d13991b462 /arch
parentaa4b1f6e83aaf20997edc4c10e03baf834343e5a (diff)
omap: McBSP: Drop unnecessary status/error bit clearing on reg_cacheretrieved register values
The MsBSP register cache will never have any error/status flags set, since these flags are never written to the reg_cache. So it is kind of not necessary to clear these flags, which are actually always 0. In other words, clearing the status/error flags are not necessary, since the reg_cache will never got these bits set. We can just write back the register content from the cache as it is when clearing an error condition. Tested on Amstrad Delta. Reported-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Acked-by: Jarkko Nikula <jhnikula@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/mcbsp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index e47686e0a633..52dfcc81511e 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -133,8 +133,7 @@ static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id)
133 dev_err(mcbsp_tx->dev, "TX Frame Sync Error! : 0x%x\n", 133 dev_err(mcbsp_tx->dev, "TX Frame Sync Error! : 0x%x\n",
134 irqst_spcr2); 134 irqst_spcr2);
135 /* Writing zero to XSYNC_ERR clears the IRQ */ 135 /* Writing zero to XSYNC_ERR clears the IRQ */
136 MCBSP_WRITE(mcbsp_tx, SPCR2, 136 MCBSP_WRITE(mcbsp_tx, SPCR2, MCBSP_READ_CACHE(mcbsp_tx, SPCR2));
137 MCBSP_READ_CACHE(mcbsp_tx, SPCR2) & ~(XSYNC_ERR));
138 } else { 137 } else {
139 complete(&mcbsp_tx->tx_irq_completion); 138 complete(&mcbsp_tx->tx_irq_completion);
140 } 139 }
@@ -154,8 +153,7 @@ static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id)
154 dev_err(mcbsp_rx->dev, "RX Frame Sync Error! : 0x%x\n", 153 dev_err(mcbsp_rx->dev, "RX Frame Sync Error! : 0x%x\n",
155 irqst_spcr1); 154 irqst_spcr1);
156 /* Writing zero to RSYNC_ERR clears the IRQ */ 155 /* Writing zero to RSYNC_ERR clears the IRQ */
157 MCBSP_WRITE(mcbsp_rx, SPCR1, 156 MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1));
158 MCBSP_READ_CACHE(mcbsp_rx, SPCR1) & ~(RSYNC_ERR));
159 } else { 157 } else {
160 complete(&mcbsp_rx->tx_irq_completion); 158 complete(&mcbsp_rx->tx_irq_completion);
161 } 159 }
@@ -934,8 +932,7 @@ int omap_mcbsp_pollwrite(unsigned int id, u16 buf)
934 /* if frame sync error - clear the error */ 932 /* if frame sync error - clear the error */
935 if (MCBSP_READ(mcbsp, SPCR2) & XSYNC_ERR) { 933 if (MCBSP_READ(mcbsp, SPCR2) & XSYNC_ERR) {
936 /* clear error */ 934 /* clear error */
937 MCBSP_WRITE(mcbsp, SPCR2, 935 MCBSP_WRITE(mcbsp, SPCR2, MCBSP_READ_CACHE(mcbsp, SPCR2));
938 MCBSP_READ_CACHE(mcbsp, SPCR2) & (~XSYNC_ERR));
939 /* resend */ 936 /* resend */
940 return -1; 937 return -1;
941 } else { 938 } else {
@@ -975,8 +972,7 @@ int omap_mcbsp_pollread(unsigned int id, u16 *buf)
975 /* if frame sync error - clear the error */ 972 /* if frame sync error - clear the error */
976 if (MCBSP_READ(mcbsp, SPCR1) & RSYNC_ERR) { 973 if (MCBSP_READ(mcbsp, SPCR1) & RSYNC_ERR) {
977 /* clear error */ 974 /* clear error */
978 MCBSP_WRITE(mcbsp, SPCR1, 975 MCBSP_WRITE(mcbsp, SPCR1, MCBSP_READ_CACHE(mcbsp, SPCR1));
979 MCBSP_READ_CACHE(mcbsp, SPCR1) & (~RSYNC_ERR));
980 /* resend */ 976 /* resend */
981 return -1; 977 return -1;
982 } else { 978 } else {