Skip to contentSkip to conversation

ALSA: hda - Set stream_pm ops automatically by generic parser

PATCH New Takashi Iwai 1 participant 1 message May 27, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - Set stream_pm ops automatically by generic parser

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.

---
 sound/pci/hda/hda_generic.c    | 5 ++++-
 sound/pci/hda/patch_realtek.c  | 1 -
 sound/pci/hda/patch_sigmatel.c | 1 -
 sound/pci/hda/patch_via.c      | 1 -
 4 files changed, 4 insertions(+), 4 deletions(-)
sound/pci/hda/hda_generic.c +4 -1
index 1c8678775f40..ac0db1679f09 100644
@@ -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);
sound/pci/hda/patch_realtek.c +0 -1
index fc0ccc78bdc7..e3bf72bb278c 100644
@@ -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;
sound/pci/hda/patch_sigmatel.c +0 -1
index 43c99ce4a520..0de0fd95144a 100644
@@ -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,
 };
 
sound/pci/hda/patch_via.c +0 -1
index 31a95cca015d..742087ef378f 100644
@@ -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,
Signature · 1 line
2.4.1