23 |
#include <asm/io.h> |
#include <asm/io.h> |
24 |
#include <linux/init.h> |
#include <linux/init.h> |
25 |
#include <linux/slab.h> |
#include <linux/slab.h> |
26 |
|
#include <linux/delay.h> |
27 |
#include <sound/core.h> |
#include <sound/core.h> |
28 |
#include "pmac.h" |
#include "pmac.h" |
29 |
#include "burgundy.h" |
#include "burgundy.h" |
35 |
inline static void |
inline static void |
36 |
snd_pmac_burgundy_busy_wait(pmac_t *chip) |
snd_pmac_burgundy_busy_wait(pmac_t *chip) |
37 |
{ |
{ |
38 |
while (in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) |
int timeout = 50; |
39 |
; |
while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--) |
40 |
|
udelay(1); |
41 |
|
if (! timeout) |
42 |
|
printk(KERN_DEBUG "burgundy_busy_wait: timeout\n"); |
43 |
} |
} |
44 |
|
|
45 |
inline static void |
inline static void |
46 |
snd_pmac_burgundy_extend_wait(pmac_t *chip) |
snd_pmac_burgundy_extend_wait(pmac_t *chip) |
47 |
{ |
{ |
48 |
while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND)) |
int timeout; |
49 |
; |
timeout = 50; |
50 |
while (in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) |
while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--) |
51 |
; |
udelay(1); |
52 |
|
if (! timeout) |
53 |
|
printk(KERN_DEBUG "burgundy_extend_wait: timeout #1\n"); |
54 |
|
timeout = 50; |
55 |
|
while ((in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--) |
56 |
|
udelay(1); |
57 |
|
if (! timeout) |
58 |
|
printk(KERN_DEBUG "burgundy_extend_wait: timeout #2\n"); |
59 |
} |
} |
60 |
|
|
61 |
static void |
static void |
77 |
unsigned val = 0; |
unsigned val = 0; |
78 |
unsigned long flags; |
unsigned long flags; |
79 |
|
|
|
/* should have timeouts here */ |
|
80 |
spin_lock_irqsave(&chip->reg_lock, flags); |
spin_lock_irqsave(&chip->reg_lock, flags); |
81 |
|
|
82 |
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000); |
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000); |
117 |
unsigned val = 0; |
unsigned val = 0; |
118 |
unsigned long flags; |
unsigned long flags; |
119 |
|
|
|
/* should have timeouts here */ |
|
120 |
spin_lock_irqsave(&chip->reg_lock, flags); |
spin_lock_irqsave(&chip->reg_lock, flags); |
121 |
|
|
122 |
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000); |
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000); |