{ 0x15, ADC_MUX_LINEIN }, /* ADC Mixer control */
};
-static void ca0106_init_chip(struct snd_ca0106 *chip)
+static void ca0106_init_chip(struct snd_ca0106 *chip, int resume)
{
int ch;
+ unsigned int def_bits;
outl(0, chip->port + INTE);
* AN = 0 (Audio data)
* P = 0 (Consumer)
*/
- chip->spdif_bits[0] =
+ def_bits =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
- snd_ca0106_ptr_write(chip, SPCS0, 0, chip->spdif_bits[0]);
+ if (!resume) {
+ chip->spdif_bits[0] = def_bits;
+ chip->spdif_bits[1] = def_bits;
+ chip->spdif_bits[2] = def_bits;
+ chip->spdif_bits[3] = def_bits;
+ }
/* Only SPCS1 has been tested */
- chip->spdif_bits[1] =
- SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
- SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
- SPCS_GENERATIONSTATUS | 0x00001200 |
- 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
snd_ca0106_ptr_write(chip, SPCS1, 0, chip->spdif_bits[1]);
- chip->spdif_bits[2] =
- SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
- SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
- SPCS_GENERATIONSTATUS | 0x00001200 |
- 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
+ snd_ca0106_ptr_write(chip, SPCS0, 0, chip->spdif_bits[0]);
snd_ca0106_ptr_write(chip, SPCS2, 0, chip->spdif_bits[2]);
- chip->spdif_bits[3] =
- SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
- SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
- SPCS_GENERATIONSTATUS | 0x00001200 |
- 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
snd_ca0106_ptr_write(chip, SPCS3, 0, chip->spdif_bits[3]);
snd_ca0106_ptr_write(chip, PLAYBACK_MUTE, 0, 0x00fc0000);
/* Select MIC, Line in, TAD in, AUX in */
snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4);
/* Default to CAPTURE_SOURCE to i2s in */
- chip->capture_source = 3;
+ if (!resume)
+ chip->capture_source = 3;
} else if (chip->details->ac97 == 1) {
/* Default to AC97 in */
snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x444400e4);
/* Default to CAPTURE_SOURCE to AC97 in */
- chip->capture_source = 4;
+ if (!resume)
+ chip->capture_source = 4;
} else {
/* Select MIC, Line in, TAD in, AUX in */
snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4);
/* Default to Set CAPTURE_SOURCE to i2s in */
- chip->capture_source = 3;
+ if (!resume)
+ chip->capture_source = 3;
}
if (chip->details->gpio_type == 2) {
sprintf(card->longname, "%s at 0x%lx irq %i",
c->name, chip->port, chip->irq);
- ca0106_init_chip(chip);
+ ca0106_init_chip(chip, 0);
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) {
pci_set_master(pci);
- ca0106_init_chip(chip);
+ ca0106_init_chip(chip, 1);
snd_ac97_resume(chip->ac97);
snd_ca0106_mixer_resume(chip);