diff options
Diffstat (limited to 'sound/soc/pxa/pxa2xx-i2s.c')
-rw-r--r-- | sound/soc/pxa/pxa2xx-i2s.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index c796b1882776..ad4c31ddb3d4 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -30,6 +30,46 @@ | |||
30 | #include "pxa2xx-pcm.h" | 30 | #include "pxa2xx-pcm.h" |
31 | #include "pxa2xx-i2s.h" | 31 | #include "pxa2xx-i2s.h" |
32 | 32 | ||
33 | /* | ||
34 | * I2S Controller Register and Bit Definitions | ||
35 | */ | ||
36 | #define SACR0 __REG(0x40400000) /* Global Control Register */ | ||
37 | #define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */ | ||
38 | #define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ | ||
39 | #define SAIMR __REG(0x40400014) /* Serial Audio Interrupt Mask Register */ | ||
40 | #define SAICR __REG(0x40400018) /* Serial Audio Interrupt Clear Register */ | ||
41 | #define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */ | ||
42 | #define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */ | ||
43 | |||
44 | #define SACR0_RFTH(x) ((x) << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */ | ||
45 | #define SACR0_TFTH(x) ((x) << 8) /* Tx FIFO Interrupt or DMA Trigger Threshold */ | ||
46 | #define SACR0_STRF (1 << 5) /* FIFO Select for EFWR Special Function */ | ||
47 | #define SACR0_EFWR (1 << 4) /* Enable EFWR Function */ | ||
48 | #define SACR0_RST (1 << 3) /* FIFO, i2s Register Reset */ | ||
49 | #define SACR0_BCKD (1 << 2) /* Bit Clock Direction */ | ||
50 | #define SACR0_ENB (1 << 0) /* Enable I2S Link */ | ||
51 | #define SACR1_ENLBF (1 << 5) /* Enable Loopback */ | ||
52 | #define SACR1_DRPL (1 << 4) /* Disable Replaying Function */ | ||
53 | #define SACR1_DREC (1 << 3) /* Disable Recording Function */ | ||
54 | #define SACR1_AMSL (1 << 0) /* Specify Alternate Mode */ | ||
55 | |||
56 | #define SASR0_I2SOFF (1 << 7) /* Controller Status */ | ||
57 | #define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */ | ||
58 | #define SASR0_TUR (1 << 5) /* Tx FIFO Underrun */ | ||
59 | #define SASR0_RFS (1 << 4) /* Rx FIFO Service Request */ | ||
60 | #define SASR0_TFS (1 << 3) /* Tx FIFO Service Request */ | ||
61 | #define SASR0_BSY (1 << 2) /* I2S Busy */ | ||
62 | #define SASR0_RNE (1 << 1) /* Rx FIFO Not Empty */ | ||
63 | #define SASR0_TNF (1 << 0) /* Tx FIFO Not Empty */ | ||
64 | |||
65 | #define SAICR_ROR (1 << 6) /* Clear Rx FIFO Overrun Interrupt */ | ||
66 | #define SAICR_TUR (1 << 5) /* Clear Tx FIFO Underrun Interrupt */ | ||
67 | |||
68 | #define SAIMR_ROR (1 << 6) /* Enable Rx FIFO Overrun Condition Interrupt */ | ||
69 | #define SAIMR_TUR (1 << 5) /* Enable Tx FIFO Underrun Condition Interrupt */ | ||
70 | #define SAIMR_RFS (1 << 4) /* Enable Rx FIFO Service Interrupt */ | ||
71 | #define SAIMR_TFS (1 << 3) /* Enable Tx FIFO Service Interrupt */ | ||
72 | |||
33 | struct pxa_i2s_port { | 73 | struct pxa_i2s_port { |
34 | u32 sadiv; | 74 | u32 sadiv; |
35 | u32 sacr0; | 75 | u32 sacr0; |
@@ -44,7 +84,7 @@ static struct clk *clk_i2s; | |||
44 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { | 84 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { |
45 | .name = "I2S PCM Stereo out", | 85 | .name = "I2S PCM Stereo out", |
46 | .dev_addr = __PREG(SADR), | 86 | .dev_addr = __PREG(SADR), |
47 | .drcmr = &DRCMRTXSADR, | 87 | .drcmr = &DRCMR(3), |
48 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | | 88 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | |
49 | DCMD_BURST32 | DCMD_WIDTH4, | 89 | DCMD_BURST32 | DCMD_WIDTH4, |
50 | }; | 90 | }; |
@@ -52,7 +92,7 @@ static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { | |||
52 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_in = { | 92 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_in = { |
53 | .name = "I2S PCM Stereo in", | 93 | .name = "I2S PCM Stereo in", |
54 | .dev_addr = __PREG(SADR), | 94 | .dev_addr = __PREG(SADR), |
55 | .drcmr = &DRCMRRXSADR, | 95 | .drcmr = &DRCMR(2), |
56 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | | 96 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | |
57 | DCMD_BURST32 | DCMD_WIDTH4, | 97 | DCMD_BURST32 | DCMD_WIDTH4, |
58 | }; | 98 | }; |