diff options
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index edc2b7bc177c..470f6f286e81 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -227,7 +227,6 @@ struct sigmatel_spec { | |||
227 | 227 | ||
228 | /* power management */ | 228 | /* power management */ |
229 | unsigned int num_pwrs; | 229 | unsigned int num_pwrs; |
230 | const unsigned int *pwr_mapping; | ||
231 | const hda_nid_t *pwr_nids; | 230 | const hda_nid_t *pwr_nids; |
232 | const hda_nid_t *dac_list; | 231 | const hda_nid_t *dac_list; |
233 | 232 | ||
@@ -374,18 +373,15 @@ static const unsigned long stac92hd73xx_capvols[] = { | |||
374 | 373 | ||
375 | #define STAC92HD83_DAC_COUNT 3 | 374 | #define STAC92HD83_DAC_COUNT 3 |
376 | 375 | ||
377 | static const hda_nid_t stac92hd83xxx_pwr_nids[4] = { | 376 | static const hda_nid_t stac92hd83xxx_pwr_nids[7] = { |
378 | 0xa, 0xb, 0xd, 0xe, | 377 | 0x0a, 0x0b, 0x0c, 0xd, 0x0e, |
378 | 0x0f, 0x10 | ||
379 | }; | 379 | }; |
380 | 380 | ||
381 | static const hda_nid_t stac92hd83xxx_slave_dig_outs[2] = { | 381 | static const hda_nid_t stac92hd83xxx_slave_dig_outs[2] = { |
382 | 0x1e, 0, | 382 | 0x1e, 0, |
383 | }; | 383 | }; |
384 | 384 | ||
385 | static const unsigned int stac92hd83xxx_pwr_mapping[4] = { | ||
386 | 0x03, 0x0c, 0x20, 0x40, | ||
387 | }; | ||
388 | |||
389 | static const hda_nid_t stac92hd83xxx_dmic_nids[] = { | 385 | static const hda_nid_t stac92hd83xxx_dmic_nids[] = { |
390 | 0x11, 0x20, | 386 | 0x11, 0x20, |
391 | }; | 387 | }; |
@@ -4470,8 +4466,12 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4470 | stac_toggle_power_map(codec, nid, 1); | 4466 | stac_toggle_power_map(codec, nid, 1); |
4471 | continue; | 4467 | continue; |
4472 | } | 4468 | } |
4473 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) | 4469 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { |
4474 | stac_issue_unsol_event(codec, nid); | 4470 | stac_issue_unsol_event(codec, nid); |
4471 | continue; | ||
4472 | } | ||
4473 | /* none of the above, turn the port OFF */ | ||
4474 | stac_toggle_power_map(codec, nid, 0); | ||
4475 | } | 4475 | } |
4476 | 4476 | ||
4477 | /* sync mute LED */ | 4477 | /* sync mute LED */ |
@@ -4727,11 +4727,7 @@ static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, | |||
4727 | if (idx >= spec->num_pwrs) | 4727 | if (idx >= spec->num_pwrs) |
4728 | return; | 4728 | return; |
4729 | 4729 | ||
4730 | /* several codecs have two power down bits */ | 4730 | idx = 1 << idx; |
4731 | if (spec->pwr_mapping) | ||
4732 | idx = spec->pwr_mapping[idx]; | ||
4733 | else | ||
4734 | idx = 1 << idx; | ||
4735 | 4731 | ||
4736 | val = snd_hda_codec_read(codec, codec->afg, 0, 0x0fec, 0x0) & 0xff; | 4732 | val = snd_hda_codec_read(codec, codec->afg, 0, 0x0fec, 0x0) & 0xff; |
4737 | if (enable) | 4733 | if (enable) |
@@ -5629,9 +5625,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5629 | snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); | 5625 | snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); |
5630 | } | 5626 | } |
5631 | 5627 | ||
5632 | /* reset pin power-down; Windows may leave these bits after reboot */ | ||
5633 | snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0); | ||
5634 | snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); | ||
5635 | codec->no_trigger_sense = 1; | 5628 | codec->no_trigger_sense = 1; |
5636 | codec->spec = spec; | 5629 | codec->spec = spec; |
5637 | 5630 | ||
@@ -5641,7 +5634,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5641 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; | 5634 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; |
5642 | spec->digbeep_nid = 0x21; | 5635 | spec->digbeep_nid = 0x21; |
5643 | spec->pwr_nids = stac92hd83xxx_pwr_nids; | 5636 | spec->pwr_nids = stac92hd83xxx_pwr_nids; |
5644 | spec->pwr_mapping = stac92hd83xxx_pwr_mapping; | ||
5645 | spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); | 5637 | spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); |
5646 | spec->multiout.dac_nids = spec->dac_nids; | 5638 | spec->multiout.dac_nids = spec->dac_nids; |
5647 | spec->init = stac92hd83xxx_core_init; | 5639 | spec->init = stac92hd83xxx_core_init; |
@@ -5658,9 +5650,6 @@ again: | |||
5658 | stac92xx_set_config_regs(codec, | 5650 | stac92xx_set_config_regs(codec, |
5659 | stac92hd83xxx_brd_tbl[spec->board_config]); | 5651 | stac92hd83xxx_brd_tbl[spec->board_config]); |
5660 | 5652 | ||
5661 | if (spec->board_config != STAC_92HD83XXX_PWR_REF) | ||
5662 | spec->num_pwrs = 0; | ||
5663 | |||
5664 | codec->patch_ops = stac92xx_patch_ops; | 5653 | codec->patch_ops = stac92xx_patch_ops; |
5665 | 5654 | ||
5666 | if (find_mute_led_gpio(codec, 0)) | 5655 | if (find_mute_led_gpio(codec, 0)) |
@@ -5869,8 +5858,6 @@ again: | |||
5869 | (codec->revision_id & 0xf) == 1) | 5858 | (codec->revision_id & 0xf) == 1) |
5870 | spec->stream_delay = 40; /* 40 milliseconds */ | 5859 | spec->stream_delay = 40; /* 40 milliseconds */ |
5871 | 5860 | ||
5872 | /* no output amps */ | ||
5873 | spec->num_pwrs = 0; | ||
5874 | /* disable VSW */ | 5861 | /* disable VSW */ |
5875 | spec->init = stac92hd71bxx_core_init; | 5862 | spec->init = stac92hd71bxx_core_init; |
5876 | unmute_init++; | 5863 | unmute_init++; |
@@ -5885,8 +5872,6 @@ again: | |||
5885 | if ((codec->revision_id & 0xf) == 1) | 5872 | if ((codec->revision_id & 0xf) == 1) |
5886 | spec->stream_delay = 40; /* 40 milliseconds */ | 5873 | spec->stream_delay = 40; /* 40 milliseconds */ |
5887 | 5874 | ||
5888 | /* no output amps */ | ||
5889 | spec->num_pwrs = 0; | ||
5890 | /* fallthru */ | 5875 | /* fallthru */ |
5891 | default: | 5876 | default: |
5892 | spec->init = stac92hd71bxx_core_init; | 5877 | spec->init = stac92hd71bxx_core_init; |