diff options
author | Frank Mandarino <fmandarino@endrelia.com> | 2007-02-12 08:06:22 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-14 02:38:34 -0500 |
commit | fa8f878701888666c124e21d77bf7f3ba2dd2359 (patch) | |
tree | 8c7bdfc5d6132acfcc84bc451bea90d99edd7e9b | |
parent | 2a40534348987346dae1c68c225eff7bc19ff529 (diff) |
[ALSA] Change AT91 PDC register defines for 2.6.20 kernel
Use the new PDC register name defines that were updated
in Linux 2.6.20.
Signed-off-by: Frank Mandarino <fmandarino@endrelia.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/soc/at91/at91-i2s.c | 43 | ||||
-rw-r--r-- | sound/soc/at91/at91-pcm.c | 20 |
2 files changed, 32 insertions, 31 deletions
diff --git a/sound/soc/at91/at91-i2s.c b/sound/soc/at91/at91-i2s.c index fcc544a96ba3..9fc0c0388881 100644 --- a/sound/soc/at91/at91-i2s.c +++ b/sound/soc/at91/at91-i2s.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/atmel_pdc.h> | ||
24 | |||
23 | #include <sound/driver.h> | 25 | #include <sound/driver.h> |
24 | #include <sound/core.h> | 26 | #include <sound/core.h> |
25 | #include <sound/pcm.h> | 27 | #include <sound/pcm.h> |
@@ -29,7 +31,6 @@ | |||
29 | #include <asm/arch/hardware.h> | 31 | #include <asm/arch/hardware.h> |
30 | #include <asm/arch/at91_pmc.h> | 32 | #include <asm/arch/at91_pmc.h> |
31 | #include <asm/arch/at91_ssc.h> | 33 | #include <asm/arch/at91_ssc.h> |
32 | #include <asm/arch/at91_pdc.h> | ||
33 | 34 | ||
34 | #include "at91-pcm.h" | 35 | #include "at91-pcm.h" |
35 | #include "at91-i2s.h" | 36 | #include "at91-i2s.h" |
@@ -51,17 +52,17 @@ | |||
51 | * SSC PDC registers required by the PCM DMA engine. | 52 | * SSC PDC registers required by the PCM DMA engine. |
52 | */ | 53 | */ |
53 | static struct at91_pdc_regs pdc_tx_reg = { | 54 | static struct at91_pdc_regs pdc_tx_reg = { |
54 | .xpr = AT91_PDC_TPR, | 55 | .xpr = ATMEL_PDC_TPR, |
55 | .xcr = AT91_PDC_TCR, | 56 | .xcr = ATMEL_PDC_TCR, |
56 | .xnpr = AT91_PDC_TNPR, | 57 | .xnpr = ATMEL_PDC_TNPR, |
57 | .xncr = AT91_PDC_TNCR, | 58 | .xncr = ATMEL_PDC_TNCR, |
58 | }; | 59 | }; |
59 | 60 | ||
60 | static struct at91_pdc_regs pdc_rx_reg = { | 61 | static struct at91_pdc_regs pdc_rx_reg = { |
61 | .xpr = AT91_PDC_RPR, | 62 | .xpr = ATMEL_PDC_RPR, |
62 | .xcr = AT91_PDC_RCR, | 63 | .xcr = ATMEL_PDC_RCR, |
63 | .xnpr = AT91_PDC_RNPR, | 64 | .xnpr = ATMEL_PDC_RNPR, |
64 | .xncr = AT91_PDC_RNCR, | 65 | .xncr = ATMEL_PDC_RNCR, |
65 | }; | 66 | }; |
66 | 67 | ||
67 | /* | 68 | /* |
@@ -72,8 +73,8 @@ static struct at91_ssc_mask ssc_tx_mask = { | |||
72 | .ssc_disable = AT91_SSC_TXDIS, | 73 | .ssc_disable = AT91_SSC_TXDIS, |
73 | .ssc_endx = AT91_SSC_ENDTX, | 74 | .ssc_endx = AT91_SSC_ENDTX, |
74 | .ssc_endbuf = AT91_SSC_TXBUFE, | 75 | .ssc_endbuf = AT91_SSC_TXBUFE, |
75 | .pdc_enable = AT91_PDC_TXTEN, | 76 | .pdc_enable = ATMEL_PDC_TXTEN, |
76 | .pdc_disable = AT91_PDC_TXTDIS, | 77 | .pdc_disable = ATMEL_PDC_TXTDIS, |
77 | }; | 78 | }; |
78 | 79 | ||
79 | static struct at91_ssc_mask ssc_rx_mask = { | 80 | static struct at91_ssc_mask ssc_rx_mask = { |
@@ -81,8 +82,8 @@ static struct at91_ssc_mask ssc_rx_mask = { | |||
81 | .ssc_disable = AT91_SSC_RXDIS, | 82 | .ssc_disable = AT91_SSC_RXDIS, |
82 | .ssc_endx = AT91_SSC_ENDRX, | 83 | .ssc_endx = AT91_SSC_ENDRX, |
83 | .ssc_endbuf = AT91_SSC_RXBUFF, | 84 | .ssc_endbuf = AT91_SSC_RXBUFF, |
84 | .pdc_enable = AT91_PDC_RXTEN, | 85 | .pdc_enable = ATMEL_PDC_RXTEN, |
85 | .pdc_disable = AT91_PDC_RXTDIS, | 86 | .pdc_disable = ATMEL_PDC_RXTDIS, |
86 | }; | 87 | }; |
87 | 88 | ||
88 | 89 | ||
@@ -508,14 +509,14 @@ static int at91_i2s_hw_params(struct snd_pcm_substream *substream, | |||
508 | /* Reset the SSC and its PDC registers */ | 509 | /* Reset the SSC and its PDC registers */ |
509 | at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST); | 510 | at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST); |
510 | 511 | ||
511 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RPR, 0); | 512 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RPR, 0); |
512 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RCR, 0); | 513 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RCR, 0); |
513 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNPR, 0); | 514 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNPR, 0); |
514 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNCR, 0); | 515 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNCR, 0); |
515 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TPR, 0); | 516 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TPR, 0); |
516 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TCR, 0); | 517 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TCR, 0); |
517 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNPR, 0); | 518 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNPR, 0); |
518 | at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNCR, 0); | 519 | at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNCR, 0); |
519 | 520 | ||
520 | if ((ret = request_irq(ssc_p->ssc.pid, at91_i2s_interrupt, | 521 | if ((ret = request_irq(ssc_p->ssc.pid, at91_i2s_interrupt, |
521 | 0, ssc_p->name, ssc_p)) < 0) { | 522 | 0, ssc_p->name, ssc_p)) < 0) { |
diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c index e88b12e7cc40..b39b95a47040 100644 --- a/sound/soc/at91/at91-pcm.c +++ b/sound/soc/at91/at91-pcm.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
24 | #include <linux/atmel_pdc.h> | ||
24 | 25 | ||
25 | #include <sound/driver.h> | 26 | #include <sound/driver.h> |
26 | #include <sound/core.h> | 27 | #include <sound/core.h> |
@@ -30,7 +31,6 @@ | |||
30 | 31 | ||
31 | #include <asm/arch/hardware.h> | 32 | #include <asm/arch/hardware.h> |
32 | #include <asm/arch/at91_ssc.h> | 33 | #include <asm/arch/at91_ssc.h> |
33 | #include <asm/arch/at91_pdc.h> | ||
34 | 34 | ||
35 | #include "at91-pcm.h" | 35 | #include "at91-pcm.h" |
36 | 36 | ||
@@ -83,7 +83,7 @@ static void at91_pcm_dma_irq(u32 ssc_sr, | |||
83 | params->name, ssc_sr, count); | 83 | params->name, ssc_sr, count); |
84 | 84 | ||
85 | /* re-start the PDC */ | 85 | /* re-start the PDC */ |
86 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); | 86 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); |
87 | 87 | ||
88 | prtd->period_ptr += prtd->period_size; | 88 | prtd->period_ptr += prtd->period_size; |
89 | if (prtd->period_ptr >= prtd->dma_buffer_end) { | 89 | if (prtd->period_ptr >= prtd->dma_buffer_end) { |
@@ -94,7 +94,7 @@ static void at91_pcm_dma_irq(u32 ssc_sr, | |||
94 | at91_ssc_write(params->ssc_base + params->pdc->xcr, | 94 | at91_ssc_write(params->ssc_base + params->pdc->xcr, |
95 | prtd->period_size / params->pdc_xfer_size); | 95 | prtd->period_size / params->pdc_xfer_size); |
96 | 96 | ||
97 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); | 97 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); |
98 | } | 98 | } |
99 | 99 | ||
100 | if (ssc_sr & params->mask->ssc_endx) { | 100 | if (ssc_sr & params->mask->ssc_endx) { |
@@ -143,7 +143,7 @@ static int at91_pcm_hw_free(struct snd_pcm_substream *substream) | |||
143 | struct at91_pcm_dma_params *params = prtd->params; | 143 | struct at91_pcm_dma_params *params = prtd->params; |
144 | 144 | ||
145 | if (params != NULL) { | 145 | if (params != NULL) { |
146 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); | 146 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); |
147 | prtd->params->dma_intr_handler = NULL; | 147 | prtd->params->dma_intr_handler = NULL; |
148 | } | 148 | } |
149 | 149 | ||
@@ -158,7 +158,7 @@ static int at91_pcm_prepare(struct snd_pcm_substream *substream) | |||
158 | at91_ssc_write(params->ssc_base + AT91_SSC_IDR, | 158 | at91_ssc_write(params->ssc_base + AT91_SSC_IDR, |
159 | params->mask->ssc_endx | params->mask->ssc_endbuf); | 159 | params->mask->ssc_endx | params->mask->ssc_endbuf); |
160 | 160 | ||
161 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); | 161 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
164 | 164 | ||
@@ -192,7 +192,7 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream, | |||
192 | at91_ssc_write(params->ssc_base + AT91_SSC_IER, | 192 | at91_ssc_write(params->ssc_base + AT91_SSC_IER, |
193 | params->mask->ssc_endx | params->mask->ssc_endbuf); | 193 | params->mask->ssc_endx | params->mask->ssc_endbuf); |
194 | 194 | ||
195 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); | 195 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); |
196 | 196 | ||
197 | DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR), | 197 | DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR), |
198 | at91_ssc_read(params->ssc_base + AT91_SSC_IER)); | 198 | at91_ssc_read(params->ssc_base + AT91_SSC_IER)); |
@@ -201,12 +201,12 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream, | |||
201 | case SNDRV_PCM_TRIGGER_STOP: | 201 | case SNDRV_PCM_TRIGGER_STOP: |
202 | case SNDRV_PCM_TRIGGER_SUSPEND: | 202 | case SNDRV_PCM_TRIGGER_SUSPEND: |
203 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 203 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
204 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); | 204 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); |
205 | break; | 205 | break; |
206 | 206 | ||
207 | case SNDRV_PCM_TRIGGER_RESUME: | 207 | case SNDRV_PCM_TRIGGER_RESUME: |
208 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 208 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
209 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); | 209 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); |
210 | break; | 210 | break; |
211 | 211 | ||
212 | default: | 212 | default: |
@@ -379,7 +379,7 @@ static int at91_pcm_suspend(struct platform_device *pdev, | |||
379 | 379 | ||
380 | /* disable the PDC and save the PDC registers */ | 380 | /* disable the PDC and save the PDC registers */ |
381 | 381 | ||
382 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); | 382 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); |
383 | 383 | ||
384 | prtd->pdc_xpr_save = at91_ssc_read(params->ssc_base + params->pdc->xpr); | 384 | prtd->pdc_xpr_save = at91_ssc_read(params->ssc_base + params->pdc->xpr); |
385 | prtd->pdc_xcr_save = at91_ssc_read(params->ssc_base + params->pdc->xcr); | 385 | prtd->pdc_xcr_save = at91_ssc_read(params->ssc_base + params->pdc->xcr); |
@@ -408,7 +408,7 @@ static int at91_pcm_resume(struct platform_device *pdev, | |||
408 | at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->pdc_xnpr_save); | 408 | at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->pdc_xnpr_save); |
409 | at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->pdc_xncr_save); | 409 | at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->pdc_xncr_save); |
410 | 410 | ||
411 | at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); | 411 | at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); |
412 | return 0; | 412 | return 0; |
413 | } | 413 | } |
414 | #else | 414 | #else |