ALSA: hda - Drop power_save value indirection in hda_bus

We used to pass the power_save option value to hda_bus via a given
pointer.  This was needed to refer to the value from the HD-audio core
side.  However, after the transition to the runtime PM, this is no
longer needed.

This patch drops the power_save value indirection in hda_bus above,
and let the controller driver reprograms the autosuspend value
explicitly by a new helper, snd_hda_set_power_save().  Without this
call, the HD-audio core doesn't set up the autosuspend and flip the
runtime PM.  (User may still be able to set up via sysfs, though.)

Along with this change, the pointer argument of azx_bus_create() is
dropped as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index d0dbc62c..36cebe0 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1175,10 +1175,8 @@
 	struct hda_codec *codec = device->device_data;
 
 	snd_hda_register_beep_device(codec);
-	if (device_is_registered(hda_codec_dev(codec))) {
-		snd_hda_power_sync(codec);
+	if (device_is_registered(hda_codec_dev(codec)))
 		pm_runtime_enable(hda_codec_dev(codec));
-	}
 	return 0;
 }
 
@@ -4778,21 +4776,10 @@
 }
 EXPORT_SYMBOL_GPL(snd_hda_power_down);
 
-/**
- * snd_hda_power_sync - Synchronize the power_save option
- * @codec: HD-audio codec
- *
- * Synchronize the runtime PM autosuspend state from the power_save option.
- */
-void snd_hda_power_sync(struct hda_codec *codec)
+static void codec_set_power_save(struct hda_codec *codec, int delay)
 {
 	struct device *dev = hda_codec_dev(codec);
-	int delay;
 
-	if (!codec->bus->power_save)
-		return;
-
-	delay = *codec->bus->power_save * 1000;
 	if (delay > 0) {
 		pm_runtime_set_autosuspend_delay(dev, delay);
 		pm_runtime_use_autosuspend(dev);
@@ -4804,7 +4791,22 @@
 		pm_runtime_forbid(dev);
 	}
 }
-EXPORT_SYMBOL_GPL(snd_hda_power_sync);
+
+/**
+ * snd_hda_set_power_save - reprogram autosuspend for the given delay
+ * @bus: HD-audio bus
+ * @delay: autosuspend delay in msec, 0 = off
+ *
+ * Synchronize the runtime PM autosuspend state from the power_save option.
+ */
+void snd_hda_set_power_save(struct hda_bus *bus, int delay)
+{
+	struct hda_codec *c;
+
+	list_for_each_entry(c, &bus->codec_list, list)
+		codec_set_power_save(c, delay);
+}
+EXPORT_SYMBOL_GPL(snd_hda_set_power_save);
 
 /**
  * snd_hda_check_amp_list_power - Check the amp list and update the power