mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Remove atomic register bit manipulation functions from i.MX and s3c target code and introduce generic functions for ARM (bitmod32, bitset32, and bitclr32). Multiprocessor support is possible but just not implemented at the moment, only interrupt lockout.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27188 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f4a00174b5
commit
e286b0bbc0
28 changed files with 271 additions and 190 deletions
|
|
@ -50,14 +50,14 @@ void fiq_handler(void) __attribute__((interrupt ("FIQ")));
|
|||
void pcm_play_lock(void)
|
||||
{
|
||||
if (++dma_play_lock.locked == 1)
|
||||
s3c_regset32(&INTMSK, DMA2_MASK);
|
||||
bitset32(&INTMSK, DMA2_MASK);
|
||||
}
|
||||
|
||||
/* Unmask the DMA interrupt if enabled */
|
||||
void pcm_play_unlock(void)
|
||||
{
|
||||
if (--dma_play_lock.locked == 0)
|
||||
s3c_regclr32(&INTMSK, dma_play_lock.state);
|
||||
bitclr32(&INTMSK, dma_play_lock.state);
|
||||
}
|
||||
|
||||
void pcm_play_dma_init(void)
|
||||
|
|
@ -65,7 +65,7 @@ void pcm_play_dma_init(void)
|
|||
/* There seem to be problems when changing the IIS interface configuration
|
||||
* when a clock is not present.
|
||||
*/
|
||||
s3c_regset32(&CLKCON, 1<<17);
|
||||
bitset32(&CLKCON, 1<<17);
|
||||
/* slave, transmit mode, 16 bit samples - MCLK 384fs - use 16.9344Mhz -
|
||||
BCLK 32fs */
|
||||
IISMOD = (1<<9) | (1<<8) | (2<<6) | (1<<3) | (1<<2) | (1<<0);
|
||||
|
|
@ -73,7 +73,7 @@ void pcm_play_dma_init(void)
|
|||
/* RX,TX off,on */
|
||||
IISCON |= (1<<3) | (1<<2);
|
||||
|
||||
s3c_regclr32(&CLKCON, 1<<17);
|
||||
bitclr32(&CLKCON, 1<<17);
|
||||
|
||||
audiohw_init();
|
||||
|
||||
|
|
@ -86,11 +86,11 @@ void pcm_play_dma_init(void)
|
|||
/* Do not service DMA requests, yet */
|
||||
|
||||
/* clear any pending int and mask it */
|
||||
s3c_regset32(&INTMSK, DMA2_MASK);
|
||||
bitset32(&INTMSK, DMA2_MASK);
|
||||
SRCPND = DMA2_MASK;
|
||||
|
||||
/* connect to FIQ */
|
||||
s3c_regset32(&INTMOD, DMA2_MASK);
|
||||
bitset32(&INTMOD, DMA2_MASK);
|
||||
}
|
||||
|
||||
void pcm_postinit(void)
|
||||
|
|
@ -132,7 +132,7 @@ static void play_start_pcm(void)
|
|||
static void play_stop_pcm(void)
|
||||
{
|
||||
/* Mask DMA interrupt */
|
||||
s3c_regset32(&INTMSK, DMA2_MASK);
|
||||
bitset32(&INTMSK, DMA2_MASK);
|
||||
|
||||
/* De-Activate the DMA channel */
|
||||
DMASKTRIG2 = 0x4;
|
||||
|
|
@ -160,7 +160,7 @@ static void play_stop_pcm(void)
|
|||
void pcm_play_dma_start(const void *addr, size_t size)
|
||||
{
|
||||
/* Enable the IIS clock */
|
||||
s3c_regset32(&CLKCON, 1<<17);
|
||||
bitset32(&CLKCON, 1<<17);
|
||||
|
||||
/* stop any DMA in progress - idle IIS */
|
||||
play_stop_pcm();
|
||||
|
|
@ -191,7 +191,7 @@ void pcm_play_dma_stop(void)
|
|||
play_stop_pcm();
|
||||
|
||||
/* Disconnect the IIS clock */
|
||||
s3c_regclr32(&CLKCON, 1<<17);
|
||||
bitclr32(&CLKCON, 1<<17);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue