230 |
u32 all_coeff_buf; /* coefficient buffer */ |
u32 all_coeff_buf; /* coefficient buffer */ |
231 |
u32 coeff_buf[2]; /* coefficient buffer for each stream */ |
u32 coeff_buf[2]; /* coefficient buffer for each stream */ |
232 |
|
|
233 |
int coeffs_current; /* coeff. table is loaded? */ |
unsigned int coeffs_current: 1; /* coeff. table is loaded? */ |
234 |
int use_cache; /* use one big coef. table */ |
unsigned int use_cache: 1; /* use one big coef. table */ |
235 |
|
unsigned int latitude_workaround: 1; /* Dell Latitude LS workaround needed */ |
236 |
|
|
237 |
int mixer_base; /* register offset of ac97 mixer */ |
int mixer_base; /* register offset of ac97 mixer */ |
238 |
int mixer_status_offset; /* offset of mixer status reg. */ |
int mixer_status_offset; /* offset of mixer status reg. */ |
1182 |
spin_lock_irqsave(&chip->reg_lock, flags); |
spin_lock_irqsave(&chip->reg_lock, flags); |
1183 |
/* Reset the mixer. 'Tis magic! */ |
/* Reset the mixer. 'Tis magic! */ |
1184 |
snd_nm256_writeb(chip, 0x6c0, 1); |
snd_nm256_writeb(chip, 0x6c0, 1); |
1185 |
#if 0 /* Dell latitude LS will lock up by this */ |
if (chip->latitude_workaround) { |
1186 |
snd_nm256_writeb(chip, 0x6cc, 0x87); |
/* Dell latitude LS will lock up by this */ |
1187 |
#endif |
snd_nm256_writeb(chip, 0x6cc, 0x87); |
1188 |
|
} |
1189 |
snd_nm256_writeb(chip, 0x6cc, 0x80); |
snd_nm256_writeb(chip, 0x6cc, 0x80); |
1190 |
snd_nm256_writeb(chip, 0x6cc, 0x0); |
snd_nm256_writeb(chip, 0x6cc, 0x0); |
1191 |
spin_unlock_irqrestore(&chip->reg_lock, flags); |
spin_unlock_irqrestore(&chip->reg_lock, flags); |
1196 |
snd_nm256_mixer(nm256_t *chip) |
snd_nm256_mixer(nm256_t *chip) |
1197 |
{ |
{ |
1198 |
ac97_t ac97; |
ac97_t ac97; |
1199 |
int i; |
int i, err; |
1200 |
/* looks like nm256 hangs up when unexpected registers are touched... */ |
/* looks like nm256 hangs up when unexpected registers are touched... */ |
1201 |
static int mixer_regs[] = { |
static int mixer_regs[] = { |
1202 |
AC97_MASTER, AC97_HEADPHONE, AC97_MASTER_MONO, |
AC97_MASTER, AC97_HEADPHONE, AC97_MASTER_MONO, |
1212 |
ac97.reset = snd_nm256_ac97_reset; |
ac97.reset = snd_nm256_ac97_reset; |
1213 |
ac97.write = snd_nm256_ac97_write; |
ac97.write = snd_nm256_ac97_write; |
1214 |
ac97.read = snd_nm256_ac97_read; |
ac97.read = snd_nm256_ac97_read; |
1215 |
|
ac97.scaps = AC97_SCAP_AUDIO; /* we support audio! */ |
1216 |
ac97.limited_regs = 1; |
ac97.limited_regs = 1; |
1217 |
for (i = 0; mixer_regs[i] >= 0; i++) |
for (i = 0; mixer_regs[i] >= 0; i++) |
1218 |
set_bit(mixer_regs[i], ac97.reg_accessed); |
set_bit(mixer_regs[i], ac97.reg_accessed); |
1219 |
ac97.private_data = chip; |
ac97.private_data = chip; |
1220 |
return snd_ac97_mixer(chip->card, &ac97, &chip->ac97); |
err = snd_ac97_mixer(chip->card, &ac97, &chip->ac97); |
1221 |
|
if (err < 0) |
1222 |
|
return err; |
1223 |
|
if (! (chip->ac97->id & (0xf0000000))) { |
1224 |
|
/* looks like an invalid id */ |
1225 |
|
sprintf(chip->card->mixername, "%s AC97", chip->card->driver); |
1226 |
|
} |
1227 |
|
return 0; |
1228 |
} |
} |
1229 |
|
|
1230 |
/* |
/* |
1404 |
.dev_free = snd_nm256_dev_free, |
.dev_free = snd_nm256_dev_free, |
1405 |
}; |
}; |
1406 |
u32 addr; |
u32 addr; |
1407 |
|
u16 subsystem_vendor, subsystem_device; |
1408 |
|
|
1409 |
*chip_ret = NULL; |
*chip_ret = NULL; |
1410 |
|
|
1541 |
|
|
1542 |
chip->coeffs_current = 0; |
chip->coeffs_current = 0; |
1543 |
|
|
1544 |
|
/* check workarounds */ |
1545 |
|
chip->latitude_workaround = 1; |
1546 |
|
pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor); |
1547 |
|
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsystem_device); |
1548 |
|
if (subsystem_vendor == 0x104d && subsystem_device == 0x8041) { |
1549 |
|
/* this workaround will cause lock-up after suspend/resume on Sony PCG-F305 */ |
1550 |
|
chip->latitude_workaround = 0; |
1551 |
|
} |
1552 |
|
|
1553 |
snd_nm256_init_chip(chip); |
snd_nm256_init_chip(chip); |
1554 |
|
|
1555 |
if ((err = snd_nm256_pcm(chip, 0)) < 0) |
if ((err = snd_nm256_pcm(chip, 0)) < 0) |