]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/hda/hda_intel.c
Merge branch 'fix/hda' into topic/hda
[linux-2.6-omap-h63xx.git] / sound / pci / hda / hda_intel.c
index f13ec4c71f8a3eca980d5aa553ded92922050bb1..a26ae8c4cf70d5fa40c32c12b6501de44761800d 100644 (file)
@@ -83,7 +83,10 @@ module_param(enable_msi, int, 0444);
 MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)");
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
-/* power_save option is defined in hda_codec.c */
+static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
+module_param(power_save, int, 0644);
+MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
+                "(in second, 0 = disable).");
 
 /* reset the HD-audio controller in power save mode.
  * this may give more power-saving, but will take longer time to
@@ -1235,6 +1238,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model,
        bus_temp.ops.get_response = azx_get_response;
        bus_temp.ops.attach_pcm = azx_attach_pcm_stream;
 #ifdef CONFIG_SND_HDA_POWER_SAVE
+       bus_temp.power_save = &power_save;
        bus_temp.ops.pm_notify = azx_power_notify;
 #endif
 
@@ -1896,6 +1900,12 @@ static void azx_power_notify(struct hda_bus *bus)
        else if (chip->running && power_save_controller)
                azx_stop_chip(chip);
 }
+#endif /* CONFIG_SND_HDA_POWER_SAVE */
+
+#ifdef CONFIG_PM
+/*
+ * power management
+ */
 
 static int snd_hda_codecs_inuse(struct hda_bus *bus)
 {
@@ -1907,14 +1917,7 @@ static int snd_hda_codecs_inuse(struct hda_bus *bus)
        }
        return 0;
 }
-#else /* !CONFIG_SND_HDA_POWER_SAVE */
-#define snd_hda_codecs_inuse(bus) 1
-#endif /* CONFIG_SND_HDA_POWER_SAVE */
 
-#ifdef CONFIG_PM
-/*
- * power management
- */
 static int azx_suspend(struct pci_dev *pci, pm_message_t state)
 {
        struct snd_card *card = pci_get_drvdata(pci);
@@ -2179,7 +2182,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
        }
 
        chip->addr = pci_resource_start(pci, 0);
-       chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci,0));
+       chip->remap_addr = pci_ioremap_bar(pci, 0);
        if (chip->remap_addr == NULL) {
                snd_printk(KERN_ERR SFX "ioremap error\n");
                err = -ENXIO;