Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47236
b: refs/heads/master
c: 547ac2a
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras authored and Jaroslav Kysela committed Feb 9, 2007
1 parent 56277e7 commit 6fae2fa
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 147 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: 2cf9f0fc69358e15e78f936c220cfe8aa208111d
refs/heads/master: 547ac2ae3890b8e17bcfea4ba8840a10f3496da4
22 changes: 10 additions & 12 deletions trunk/sound/aoa/soundbus/i2sbus/i2sbus-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev,
struct dbdma_command_mem *r,
int numcmds)
{
/* one more for rounding */
r->size = (numcmds+1) * sizeof(struct dbdma_cmd);
/* one more for rounding, one for branch back, one for stop command */
r->size = (numcmds + 3) * sizeof(struct dbdma_cmd);
/* We use the PCI APIs for now until the generic one gets fixed
* enough or until we get some macio-specific versions
*/
Expand Down Expand Up @@ -377,11 +377,8 @@ static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state)
if (i2sdev->sound.pcm) {
/* Suspend PCM streams */
snd_pcm_suspend_all(i2sdev->sound.pcm);
/* Probably useless as we handle
* power transitions ourselves */
snd_power_change_state(i2sdev->sound.pcm->card,
SNDRV_CTL_POWER_D3hot);
}

/* Notify codecs */
list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
err = 0;
Expand All @@ -390,7 +387,11 @@ static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state)
if (err)
ret = err;
}

/* wait until streams are stopped */
i2sbus_wait_for_stop_both(i2sdev);
}

return ret;
}

Expand All @@ -402,6 +403,9 @@ static int i2sbus_resume(struct macio_dev* dev)
int err, ret = 0;

list_for_each_entry(i2sdev, &control->list, item) {
/* reset i2s bus format etc. */
i2sbus_pcm_prepare_both(i2sdev);

/* Notify codecs so they can re-initialize */
list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
err = 0;
Expand All @@ -410,12 +414,6 @@ static int i2sbus_resume(struct macio_dev* dev)
if (err)
ret = err;
}
/* Notify Alsa */
if (i2sdev->sound.pcm) {
/* Same comment as above, probably useless */
snd_power_change_state(i2sdev->sound.pcm->card,
SNDRV_CTL_POWER_D0);
}
}

return ret;
Expand Down
Loading

0 comments on commit 6fae2fa

Please sign in to comment.