22 #include <linux/slab.h>
31 static unsigned char pdacf_ak4117_read(
void *
private_data,
unsigned char reg)
63 static void pdacf_ak4117_write(
void *private_data,
unsigned char reg,
unsigned char val)
66 unsigned long timeout;
104 static int pdacf_reset(
struct snd_pdacf *chip,
int powerdown)
129 pdacf_reset(chip, 0);
143 snd_iprintf(buffer,
"PDAudioCF\n\n");
149 static void pdacf_proc_init(
struct snd_pdacf *chip)
153 if (! snd_card_proc_new(chip->
card,
"pdaudiocf", &entry))
154 snd_info_set_text_ops(entry, chip, pdacf_proc_read);
170 pdacf_proc_init(chip);
174 static void snd_pdacf_ak4117_change(
struct ak4117 *
ak4117,
unsigned char c0,
unsigned char c1)
184 if (ak4117->
rcs0 & AK4117_UNLCK)
189 spin_unlock_irqrestore(&chip->
reg_lock, flags);
200 static unsigned char pgm[5] = {
208 err = pdacf_reset(chip, 0);
240 chip->
ak4117->change_callback = snd_pdacf_ak4117_change;
243 snd_pdacf_ak4117_change(chip->
ak4117, AK4117_UNLCK, 0);
260 pdacf_reset(chip, 1);
265 int snd_pdacf_suspend(
struct snd_pdacf *chip)
270 snd_pcm_suspend_all(chip->
pcm);
280 static inline int check_signal(
struct snd_pdacf *chip)
282 return (chip->
ak4117->rcs0 & AK4117_UNLCK) == 0;
285 int snd_pdacf_resume(
struct snd_pdacf *chip)
291 while (timeout-- > 0 &&