]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ALSA: hda - Set stream_pm ops automatically by generic parser
authorTakashi Iwai <tiwai@suse.de>
Wed, 27 May 2015 06:37:19 +0000 (08:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 27 May 2015 06:39:27 +0000 (08:39 +0200)
This allows user to test power_save_node feature via sysfs or patch
firmware even on the codecs that don't specify it.  It'll also save a
few lines.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_generic.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c

index 1c8678775f4078df5b747a0a259b8c6ef33fb38b..ac0db1679f098ee4ec08c6770fe1f1374c8bf431 100644 (file)
@@ -4926,9 +4926,12 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
  dig_only:
        parse_digital(codec);
 
-       if (spec->power_down_unused || codec->power_save_node)
+       if (spec->power_down_unused || codec->power_save_node) {
                if (!codec->power_filter)
                        codec->power_filter = snd_hda_gen_path_power_filter;
+               if (!codec->patch_ops.stream_pm)
+                       codec->patch_ops.stream_pm = snd_hda_gen_stream_pm;
+       }
 
        if (!spec->no_analog && spec->beep_nid) {
                err = snd_hda_attach_beep_device(codec, spec->beep_nid);
index fc0ccc78bdc72c184172349023e1a082a778d068..e3bf72bb278c27c72c7a9cb4a259567557d3e23a 100644 (file)
@@ -5724,7 +5724,6 @@ static int patch_alc269(struct hda_codec *codec)
                set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
 
        codec->patch_ops = alc_patch_ops;
-       codec->patch_ops.stream_pm = snd_hda_gen_stream_pm;
 #ifdef CONFIG_PM
        codec->patch_ops.suspend = alc269_suspend;
        codec->patch_ops.resume = alc269_resume;
index 43c99ce4a520c3fc24a720f6c76ba4222403ad3b..0de0fd95144a8b4521d18ec9dbc385e095725338 100644 (file)
@@ -4403,7 +4403,6 @@ static const struct hda_codec_ops stac_patch_ops = {
 #ifdef CONFIG_PM
        .suspend = stac_suspend,
 #endif
-       .stream_pm = snd_hda_gen_stream_pm,
        .reboot_notify = stac_shutup,
 };
 
index 31a95cca015d4d1c34a1facff2e226b6821a5203..742087ef378fd52d41ade661de996a14222b9dba 100644 (file)
@@ -472,7 +472,6 @@ static const struct hda_codec_ops via_patch_ops = {
        .init = via_init,
        .free = via_free,
        .unsol_event = snd_hda_jack_unsol_event,
-       .stream_pm = snd_hda_gen_stream_pm,
 #ifdef CONFIG_PM
        .suspend = via_suspend,
        .check_power_status = via_check_power_status,