diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-12-01 05:54:35 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-12-01 05:54:35 -0500 |
commit | 8c2f767bf3c4a7932898e657c6b12a2234cd2eca (patch) | |
tree | 1fcaa5474bb41fe68f98d2962745c1400f2a820f /sound/pci/hda | |
parent | c9b46f9144b8dce6c12aec08f34a908aedd28b37 (diff) |
ALSA: hda - Remove unnecessary caches for power states in patch_sigmatel.c
The power-state changes in patch_sigmatel.c are accessed via *_cached()
but they shouldn't be really cached. Fixed to the normal write.
Also, stac92hd71xx_suspend and resume are no longer necessary as the
power-state changes are handled properly in the common routine.
Removed these hacks now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 62 |
1 files changed, 6 insertions, 56 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 068a77ae459e..14db35a61cfe 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -2413,7 +2413,7 @@ static int stac92xx_capture_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
2413 | 2413 | ||
2414 | if (spec->powerdown_adcs) { | 2414 | if (spec->powerdown_adcs) { |
2415 | msleep(40); | 2415 | msleep(40); |
2416 | snd_hda_codec_write_cache(codec, nid, 0, | 2416 | snd_hda_codec_write(codec, nid, 0, |
2417 | AC_VERB_SET_POWER_STATE, AC_PWRST_D0); | 2417 | AC_VERB_SET_POWER_STATE, AC_PWRST_D0); |
2418 | } | 2418 | } |
2419 | snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); | 2419 | snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); |
@@ -2429,7 +2429,7 @@ static int stac92xx_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
2429 | 2429 | ||
2430 | snd_hda_codec_cleanup_stream(codec, nid); | 2430 | snd_hda_codec_cleanup_stream(codec, nid); |
2431 | if (spec->powerdown_adcs) | 2431 | if (spec->powerdown_adcs) |
2432 | snd_hda_codec_write_cache(codec, nid, 0, | 2432 | snd_hda_codec_write(codec, nid, 0, |
2433 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | 2433 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
2434 | return 0; | 2434 | return 0; |
2435 | } | 2435 | } |
@@ -3866,7 +3866,7 @@ static void stac92xx_power_down(struct hda_codec *codec) | |||
3866 | for (dac = spec->dac_list; *dac; dac++) | 3866 | for (dac = spec->dac_list; *dac; dac++) |
3867 | if (!is_in_dac_nids(spec, *dac) && | 3867 | if (!is_in_dac_nids(spec, *dac) && |
3868 | spec->multiout.hp_nid != *dac) | 3868 | spec->multiout.hp_nid != *dac) |
3869 | snd_hda_codec_write_cache(codec, *dac, 0, | 3869 | snd_hda_codec_write(codec, *dac, 0, |
3870 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | 3870 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
3871 | } | 3871 | } |
3872 | 3872 | ||
@@ -3885,7 +3885,7 @@ static int stac92xx_init(struct hda_codec *codec) | |||
3885 | /* power down adcs initially */ | 3885 | /* power down adcs initially */ |
3886 | if (spec->powerdown_adcs) | 3886 | if (spec->powerdown_adcs) |
3887 | for (i = 0; i < spec->num_adcs; i++) | 3887 | for (i = 0; i < spec->num_adcs; i++) |
3888 | snd_hda_codec_write_cache(codec, | 3888 | snd_hda_codec_write(codec, |
3889 | spec->adc_nids[i], 0, | 3889 | spec->adc_nids[i], 0, |
3890 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | 3890 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
3891 | 3891 | ||
@@ -4724,48 +4724,6 @@ again: | |||
4724 | return 0; | 4724 | return 0; |
4725 | } | 4725 | } |
4726 | 4726 | ||
4727 | #ifdef SND_HDA_NEEDS_RESUME | ||
4728 | static void stac92hd71xx_set_power_state(struct hda_codec *codec, int pwr) | ||
4729 | { | ||
4730 | struct sigmatel_spec *spec = codec->spec; | ||
4731 | int i; | ||
4732 | snd_hda_codec_write_cache(codec, codec->afg, 0, | ||
4733 | AC_VERB_SET_POWER_STATE, pwr); | ||
4734 | |||
4735 | msleep(1); | ||
4736 | for (i = 0; i < spec->num_adcs; i++) { | ||
4737 | snd_hda_codec_write_cache(codec, | ||
4738 | spec->adc_nids[i], 0, | ||
4739 | AC_VERB_SET_POWER_STATE, pwr); | ||
4740 | } | ||
4741 | }; | ||
4742 | |||
4743 | static int stac92hd71xx_resume(struct hda_codec *codec) | ||
4744 | { | ||
4745 | stac92hd71xx_set_power_state(codec, AC_PWRST_D0); | ||
4746 | return stac92xx_resume(codec); | ||
4747 | } | ||
4748 | |||
4749 | static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) | ||
4750 | { | ||
4751 | stac92hd71xx_set_power_state(codec, AC_PWRST_D3); | ||
4752 | return stac92xx_suspend(codec, state); | ||
4753 | }; | ||
4754 | |||
4755 | #endif | ||
4756 | |||
4757 | static struct hda_codec_ops stac92hd71bxx_patch_ops = { | ||
4758 | .build_controls = stac92xx_build_controls, | ||
4759 | .build_pcms = stac92xx_build_pcms, | ||
4760 | .init = stac92xx_init, | ||
4761 | .free = stac92xx_free, | ||
4762 | .unsol_event = stac92xx_unsol_event, | ||
4763 | #ifdef SND_HDA_NEEDS_RESUME | ||
4764 | .suspend = stac92hd71xx_suspend, | ||
4765 | .resume = stac92hd71xx_resume, | ||
4766 | #endif | ||
4767 | }; | ||
4768 | |||
4769 | static struct hda_input_mux stac92hd71bxx_dmux = { | 4727 | static struct hda_input_mux stac92hd71bxx_dmux = { |
4770 | .num_items = 4, | 4728 | .num_items = 4, |
4771 | .items = { | 4729 | .items = { |
@@ -4842,12 +4800,8 @@ again: | |||
4842 | break; | 4800 | break; |
4843 | } | 4801 | } |
4844 | if ((codec->revision_id & 0xf) == 0 || | 4802 | if ((codec->revision_id & 0xf) == 0 || |
4845 | (codec->revision_id & 0xf) == 1) { | 4803 | (codec->revision_id & 0xf) == 1) |
4846 | #ifdef SND_HDA_NEEDS_RESUME | ||
4847 | codec->patch_ops = stac92hd71bxx_patch_ops; | ||
4848 | #endif | ||
4849 | spec->stream_delay = 40; /* 40 milliseconds */ | 4804 | spec->stream_delay = 40; /* 40 milliseconds */ |
4850 | } | ||
4851 | 4805 | ||
4852 | /* no output amps */ | 4806 | /* no output amps */ |
4853 | spec->num_pwrs = 0; | 4807 | spec->num_pwrs = 0; |
@@ -4859,12 +4813,8 @@ again: | |||
4859 | stac_change_pin_config(codec, 0xf, 0x40f000f0); | 4813 | stac_change_pin_config(codec, 0xf, 0x40f000f0); |
4860 | break; | 4814 | break; |
4861 | case 0x111d7603: /* 6 Port with Analog Mixer */ | 4815 | case 0x111d7603: /* 6 Port with Analog Mixer */ |
4862 | if ((codec->revision_id & 0xf) == 1) { | 4816 | if ((codec->revision_id & 0xf) == 1) |
4863 | #ifdef SND_HDA_NEEDS_RESUME | ||
4864 | codec->patch_ops = stac92hd71bxx_patch_ops; | ||
4865 | #endif | ||
4866 | spec->stream_delay = 40; /* 40 milliseconds */ | 4817 | spec->stream_delay = 40; /* 40 milliseconds */ |
4867 | } | ||
4868 | 4818 | ||
4869 | /* no output amps */ | 4819 | /* no output amps */ |
4870 | spec->num_pwrs = 0; | 4820 | spec->num_pwrs = 0; |