aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ca0106/ca0106_main.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-12-19 06:04:06 -0500
committerTakashi Iwai <tiwai@suse.de>2008-12-19 06:04:06 -0500
commit86effd7e12ca63cecfd218717473d606e138e5e1 (patch)
treeed4802b235b0fe264e3538c49e4fda0873998d4e /sound/pci/ca0106/ca0106_main.c
parent44411e07c2ce1a755a756e10b592cd3ba02f99b3 (diff)
ALSA: ca0106 - Don't override the values at resume
Don't override some values in ca0106_init_chip() at resume. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ca0106/ca0106_main.c')
-rw-r--r--sound/pci/ca0106/ca0106_main.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index c13aa41a35b4..2c71f9b896cd 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1303,9 +1303,10 @@ static unsigned int i2c_adc_init[][2] = {
1303 { 0x15, ADC_MUX_LINEIN }, /* ADC Mixer control */ 1303 { 0x15, ADC_MUX_LINEIN }, /* ADC Mixer control */
1304}; 1304};
1305 1305
1306static void ca0106_init_chip(struct snd_ca0106 *chip) 1306static void ca0106_init_chip(struct snd_ca0106 *chip, int resume)
1307{ 1307{
1308 int ch; 1308 int ch;
1309 unsigned int def_bits;
1309 1310
1310 outl(0, chip->port + INTE); 1311 outl(0, chip->port + INTE);
1311 1312
@@ -1323,30 +1324,21 @@ static void ca0106_init_chip(struct snd_ca0106 *chip)
1323 * AN = 0 (Audio data) 1324 * AN = 0 (Audio data)
1324 * P = 0 (Consumer) 1325 * P = 0 (Consumer)
1325 */ 1326 */
1326 chip->spdif_bits[0] = 1327 def_bits =
1327 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | 1328 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
1328 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | 1329 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
1329 SPCS_GENERATIONSTATUS | 0x00001200 | 1330 SPCS_GENERATIONSTATUS | 0x00001200 |
1330 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; 1331 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
1331 snd_ca0106_ptr_write(chip, SPCS0, 0, chip->spdif_bits[0]); 1332 if (!resume) {
1333 chip->spdif_bits[0] = def_bits;
1334 chip->spdif_bits[1] = def_bits;
1335 chip->spdif_bits[2] = def_bits;
1336 chip->spdif_bits[3] = def_bits;
1337 }
1332 /* Only SPCS1 has been tested */ 1338 /* Only SPCS1 has been tested */
1333 chip->spdif_bits[1] =
1334 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
1335 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
1336 SPCS_GENERATIONSTATUS | 0x00001200 |
1337 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
1338 snd_ca0106_ptr_write(chip, SPCS1, 0, chip->spdif_bits[1]); 1339 snd_ca0106_ptr_write(chip, SPCS1, 0, chip->spdif_bits[1]);
1339 chip->spdif_bits[2] = 1340 snd_ca0106_ptr_write(chip, SPCS0, 0, chip->spdif_bits[0]);
1340 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
1341 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
1342 SPCS_GENERATIONSTATUS | 0x00001200 |
1343 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
1344 snd_ca0106_ptr_write(chip, SPCS2, 0, chip->spdif_bits[2]); 1341 snd_ca0106_ptr_write(chip, SPCS2, 0, chip->spdif_bits[2]);
1345 chip->spdif_bits[3] =
1346 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
1347 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
1348 SPCS_GENERATIONSTATUS | 0x00001200 |
1349 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
1350 snd_ca0106_ptr_write(chip, SPCS3, 0, chip->spdif_bits[3]); 1342 snd_ca0106_ptr_write(chip, SPCS3, 0, chip->spdif_bits[3]);
1351 1343
1352 snd_ca0106_ptr_write(chip, PLAYBACK_MUTE, 0, 0x00fc0000); 1344 snd_ca0106_ptr_write(chip, PLAYBACK_MUTE, 0, 0x00fc0000);
@@ -1407,17 +1399,20 @@ static void ca0106_init_chip(struct snd_ca0106 *chip)
1407 /* Select MIC, Line in, TAD in, AUX in */ 1399 /* Select MIC, Line in, TAD in, AUX in */
1408 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4); 1400 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4);
1409 /* Default to CAPTURE_SOURCE to i2s in */ 1401 /* Default to CAPTURE_SOURCE to i2s in */
1410 chip->capture_source = 3; 1402 if (!resume)
1403 chip->capture_source = 3;
1411 } else if (chip->details->ac97 == 1) { 1404 } else if (chip->details->ac97 == 1) {
1412 /* Default to AC97 in */ 1405 /* Default to AC97 in */
1413 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x444400e4); 1406 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x444400e4);
1414 /* Default to CAPTURE_SOURCE to AC97 in */ 1407 /* Default to CAPTURE_SOURCE to AC97 in */
1415 chip->capture_source = 4; 1408 if (!resume)
1409 chip->capture_source = 4;
1416 } else { 1410 } else {
1417 /* Select MIC, Line in, TAD in, AUX in */ 1411 /* Select MIC, Line in, TAD in, AUX in */
1418 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4); 1412 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4);
1419 /* Default to Set CAPTURE_SOURCE to i2s in */ 1413 /* Default to Set CAPTURE_SOURCE to i2s in */
1420 chip->capture_source = 3; 1414 if (!resume)
1415 chip->capture_source = 3;
1421 } 1416 }
1422 1417
1423 if (chip->details->gpio_type == 2) { 1418 if (chip->details->gpio_type == 2) {
@@ -1583,7 +1578,7 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
1583 sprintf(card->longname, "%s at 0x%lx irq %i", 1578 sprintf(card->longname, "%s at 0x%lx irq %i",
1584 c->name, chip->port, chip->irq); 1579 c->name, chip->port, chip->irq);
1585 1580
1586 ca0106_init_chip(chip); 1581 ca0106_init_chip(chip, 0);
1587 1582
1588 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 1583 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
1589 if (err < 0) { 1584 if (err < 0) {
@@ -1784,7 +1779,7 @@ static int snd_ca0106_resume(struct pci_dev *pci)
1784 1779
1785 pci_set_master(pci); 1780 pci_set_master(pci);
1786 1781
1787 ca0106_init_chip(chip); 1782 ca0106_init_chip(chip, 1);
1788 1783
1789 snd_ac97_resume(chip->ac97); 1784 snd_ac97_resume(chip->ac97);
1790 snd_ca0106_mixer_resume(chip); 1785 snd_ca0106_mixer_resume(chip);