snd_pmac_burgundy_busy_wait(struct snd_pmac *chip)
while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--)
printk(KERN_DEBUG "burgundy_busy_wait: timeout\n");
snd_pmac_burgundy_extend_wait(struct snd_pmac *chip)
while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
printk(KERN_DEBUG "burgundy_extend_wait: timeout #1\n");
while ((in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
printk(KERN_DEBUG "burgundy_extend_wait: timeout #2\n");
snd_pmac_burgundy_wcw(struct snd_pmac *chip, unsigned addr, unsigned val)
out_le32(&chip->awacs->codec_ctrl, addr + 0x200c00 + (val & 0xff));
snd_pmac_burgundy_busy_wait(chip);
out_le32(&chip->awacs->codec_ctrl, addr + 0x200d00 +((val>>8) & 0xff));
snd_pmac_burgundy_busy_wait(chip);
out_le32(&chip->awacs->codec_ctrl, addr + 0x200e00 +((val>>16) & 0xff));
snd_pmac_burgundy_busy_wait(chip);
out_le32(&chip->awacs->codec_ctrl, addr + 0x200f00 +((val>>24) & 0xff));
snd_pmac_burgundy_busy_wait(chip);
snd_pmac_burgundy_rcw(struct snd_pmac *chip, unsigned addr)
spin_lock_irqsave(&chip->reg_lock, flags);
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);
snd_pmac_burgundy_busy_wait(chip);
snd_pmac_burgundy_extend_wait(chip);
val += (in_le32(&chip->awacs->codec_stat) >> 4) & 0xff;
out_le32(&chip->awacs->codec_ctrl, addr + 0x100100);
snd_pmac_burgundy_busy_wait(chip);
snd_pmac_burgundy_extend_wait(chip);
val += ((in_le32(&chip->awacs->codec_stat)>>4) & 0xff) <<8;
out_le32(&chip->awacs->codec_ctrl, addr + 0x100200);
snd_pmac_burgundy_busy_wait(chip);
snd_pmac_burgundy_extend_wait(chip);
val += ((in_le32(&chip->awacs->codec_stat)>>4) & 0xff) <<16;