Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110881
b: refs/heads/master
c: 4f3ea08
h: refs/heads/master
i:
  110879: 69942a1
v: v3
  • Loading branch information
Timur Tabi authored and Jaroslav Kysela committed Aug 13, 2008
1 parent fe06018 commit f3ce391
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e88ba01544f8b8cce64d08b2982715516793225c
refs/heads/master: 4f3ea08a129c15f64312cebfac1bfcc228f5caae
26 changes: 15 additions & 11 deletions trunk/sound/soc/fsl/mpc8610_hpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ static int mpc8610_hpcd_machine_probe(struct platform_device *sound_device)
guts_set_pmuxcr_dma(machine_data->guts, machine_data->dma_id,
machine_data->dma_channel_id[1], 0);

guts_set_pmuxcr_dma(machine_data->guts, 1, 0, 0);
guts_set_pmuxcr_dma(machine_data->guts, 1, 3, 0);
guts_set_pmuxcr_dma(machine_data->guts, 0, 3, 0);

switch (machine_data->ssi_id) {
case 0:
clrsetbits_be32(&machine_data->guts->pmuxcr,
Expand Down Expand Up @@ -230,6 +226,8 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
struct fsl_ssi_info ssi_info;
struct fsl_dma_info dma_info;
int ret = -ENODEV;
unsigned int playback_dma_channel;
unsigned int capture_dma_channel;

machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL);
if (!machine_data)
Expand Down Expand Up @@ -381,8 +379,9 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
goto error;
}

/* Find the DMA channels to use. For now, we always use the first DMA
controller. */
/* Find the DMA channels to use. Both SSIs need to use the same DMA
* controller, so let's use DMA#1.
*/
for_each_compatible_node(dma_np, NULL, "fsl,mpc8610-dma") {
iprop = of_get_property(dma_np, "cell-index", NULL);
if (iprop && (*iprop == 0)) {
Expand All @@ -397,22 +396,27 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
}
machine_data->dma_id = *iprop;

/* SSI1 needs to use DMA Channels 0 and 1, and SSI2 needs to use DMA
* channels 2 and 3. This is just how the MPC8610 is wired
* internally.
*/
playback_dma_channel = (machine_data->ssi_id == 0) ? 0 : 2;
capture_dma_channel = (machine_data->ssi_id == 0) ? 1 : 3;

/*
* Find the DMA channels to use. For now, we always use DMA channel 0
* for playback, and DMA channel 1 for capture.
* Find the DMA channels to use.
*/
while ((dma_channel_np = of_get_next_child(dma_np, dma_channel_np))) {
iprop = of_get_property(dma_channel_np, "cell-index", NULL);
/* Is it DMA channel 0? */
if (iprop && (*iprop == 0)) {
if (iprop && (*iprop == playback_dma_channel)) {
/* dma_channel[0] and dma_irq[0] are for playback */
dma_info.dma_channel[0] = of_iomap(dma_channel_np, 0);
dma_info.dma_irq[0] =
irq_of_parse_and_map(dma_channel_np, 0);
machine_data->dma_channel_id[0] = *iprop;
continue;
}
if (iprop && (*iprop == 1)) {
if (iprop && (*iprop == capture_dma_channel)) {
/* dma_channel[1] and dma_irq[1] are for capture */
dma_info.dma_channel[1] = of_iomap(dma_channel_np, 0);
dma_info.dma_irq[1] =
Expand Down

0 comments on commit f3ce391

Please sign in to comment.