aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2008-08-06 16:01:01 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:22 -0400
commit4f3ea08a129c15f64312cebfac1bfcc228f5caae (patch)
tree2aa08b3ec6e3c8073d5420637922eef5636120e4 /sound/soc/fsl
parente88ba01544f8b8cce64d08b2982715516793225c (diff)
ALSA: ASoC - fix DMA channel selection in Freescale MPC8610 sound drivers
On the Freescale MPC8610, SSI1 is hard-coded to use DMA channels 0 and 1 for playback and capture, and SSI2 is hard-coded to use DMA channels 2 and 3. This patch fixes the fabric driver so that it uses the right channels. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/mpc8610_hpcd.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index 4bdc9d8fc90e..94f89debde1f 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -68,10 +68,6 @@ static int mpc8610_hpcd_machine_probe(struct platform_device *sound_device)
68 guts_set_pmuxcr_dma(machine_data->guts, machine_data->dma_id, 68 guts_set_pmuxcr_dma(machine_data->guts, machine_data->dma_id,
69 machine_data->dma_channel_id[1], 0); 69 machine_data->dma_channel_id[1], 0);
70 70
71 guts_set_pmuxcr_dma(machine_data->guts, 1, 0, 0);
72 guts_set_pmuxcr_dma(machine_data->guts, 1, 3, 0);
73 guts_set_pmuxcr_dma(machine_data->guts, 0, 3, 0);
74
75 switch (machine_data->ssi_id) { 71 switch (machine_data->ssi_id) {
76 case 0: 72 case 0:
77 clrsetbits_be32(&machine_data->guts->pmuxcr, 73 clrsetbits_be32(&machine_data->guts->pmuxcr,
@@ -230,6 +226,8 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
230 struct fsl_ssi_info ssi_info; 226 struct fsl_ssi_info ssi_info;
231 struct fsl_dma_info dma_info; 227 struct fsl_dma_info dma_info;
232 int ret = -ENODEV; 228 int ret = -ENODEV;
229 unsigned int playback_dma_channel;
230 unsigned int capture_dma_channel;
233 231
234 machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL); 232 machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL);
235 if (!machine_data) 233 if (!machine_data)
@@ -381,8 +379,9 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
381 goto error; 379 goto error;
382 } 380 }
383 381
384 /* Find the DMA channels to use. For now, we always use the first DMA 382 /* Find the DMA channels to use. Both SSIs need to use the same DMA
385 controller. */ 383 * controller, so let's use DMA#1.
384 */
386 for_each_compatible_node(dma_np, NULL, "fsl,mpc8610-dma") { 385 for_each_compatible_node(dma_np, NULL, "fsl,mpc8610-dma") {
387 iprop = of_get_property(dma_np, "cell-index", NULL); 386 iprop = of_get_property(dma_np, "cell-index", NULL);
388 if (iprop && (*iprop == 0)) { 387 if (iprop && (*iprop == 0)) {
@@ -397,14 +396,19 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
397 } 396 }
398 machine_data->dma_id = *iprop; 397 machine_data->dma_id = *iprop;
399 398
399 /* SSI1 needs to use DMA Channels 0 and 1, and SSI2 needs to use DMA
400 * channels 2 and 3. This is just how the MPC8610 is wired
401 * internally.
402 */
403 playback_dma_channel = (machine_data->ssi_id == 0) ? 0 : 2;
404 capture_dma_channel = (machine_data->ssi_id == 0) ? 1 : 3;
405
400 /* 406 /*
401 * Find the DMA channels to use. For now, we always use DMA channel 0 407 * Find the DMA channels to use.
402 * for playback, and DMA channel 1 for capture.
403 */ 408 */
404 while ((dma_channel_np = of_get_next_child(dma_np, dma_channel_np))) { 409 while ((dma_channel_np = of_get_next_child(dma_np, dma_channel_np))) {
405 iprop = of_get_property(dma_channel_np, "cell-index", NULL); 410 iprop = of_get_property(dma_channel_np, "cell-index", NULL);
406 /* Is it DMA channel 0? */ 411 if (iprop && (*iprop == playback_dma_channel)) {
407 if (iprop && (*iprop == 0)) {
408 /* dma_channel[0] and dma_irq[0] are for playback */ 412 /* dma_channel[0] and dma_irq[0] are for playback */
409 dma_info.dma_channel[0] = of_iomap(dma_channel_np, 0); 413 dma_info.dma_channel[0] = of_iomap(dma_channel_np, 0);
410 dma_info.dma_irq[0] = 414 dma_info.dma_irq[0] =
@@ -412,7 +416,7 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
412 machine_data->dma_channel_id[0] = *iprop; 416 machine_data->dma_channel_id[0] = *iprop;
413 continue; 417 continue;
414 } 418 }
415 if (iprop && (*iprop == 1)) { 419 if (iprop && (*iprop == capture_dma_channel)) {
416 /* dma_channel[1] and dma_irq[1] are for capture */ 420 /* dma_channel[1] and dma_irq[1] are for capture */
417 dma_info.dma_channel[1] = of_iomap(dma_channel_np, 0); 421 dma_info.dma_channel[1] = of_iomap(dma_channel_np, 0);
418 dma_info.dma_irq[1] = 422 dma_info.dma_irq[1] =