|
@@ -55,6 +55,7 @@
|
|
|
#include <sound/initval.h>
|
|
#include <sound/initval.h>
|
|
|
#include <linux/vgaarb.h>
|
|
#include <linux/vgaarb.h>
|
|
|
#include <linux/vga_switcheroo.h>
|
|
#include <linux/vga_switcheroo.h>
|
|
|
|
|
+#include <linux/firmware.h>
|
|
|
#include "hda_codec.h"
|
|
#include "hda_codec.h"
|
|
|
|
|
|
|
|
|
|
|
|
@@ -470,6 +471,10 @@ struct azx {
|
|
|
struct snd_dma_buffer rb;
|
|
struct snd_dma_buffer rb;
|
|
|
struct snd_dma_buffer posbuf;
|
|
struct snd_dma_buffer posbuf;
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SND_HDA_PATCH_LOADER
|
|
|
|
|
+ const struct firmware *fw;
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
/* flags */
|
|
/* flags */
|
|
|
int position_fix[2]; /* for both playback/capture streams */
|
|
int position_fix[2]; /* for both playback/capture streams */
|
|
|
int poll_count;
|
|
int poll_count;
|
|
@@ -2639,6 +2644,10 @@ static int azx_free(struct azx *chip)
|
|
|
pci_release_regions(chip->pci);
|
|
pci_release_regions(chip->pci);
|
|
|
pci_disable_device(chip->pci);
|
|
pci_disable_device(chip->pci);
|
|
|
kfree(chip->azx_dev);
|
|
kfree(chip->azx_dev);
|
|
|
|
|
+#ifdef CONFIG_SND_HDA_PATCH_LOADER
|
|
|
|
|
+ if (chip->fw)
|
|
|
|
|
+ release_firmware(chip->fw);
|
|
|
|
|
+#endif
|
|
|
kfree(chip);
|
|
kfree(chip);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -3167,7 +3176,6 @@ static int __devinit azx_probe(struct pci_dev *pci,
|
|
|
return err;
|
|
return err;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /* set this here since it's referred in snd_hda_load_patch() */
|
|
|
|
|
snd_card_set_dev(card, &pci->dev);
|
|
snd_card_set_dev(card, &pci->dev);
|
|
|
|
|
|
|
|
err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
|
|
err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
|
|
@@ -3175,6 +3183,16 @@ static int __devinit azx_probe(struct pci_dev *pci,
|
|
|
goto out_free;
|
|
goto out_free;
|
|
|
card->private_data = chip;
|
|
card->private_data = chip;
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SND_HDA_PATCH_LOADER
|
|
|
|
|
+ if (patch[dev] && *patch[dev]) {
|
|
|
|
|
+ snd_printk(KERN_ERR SFX "Applying patch firmware '%s'\n",
|
|
|
|
|
+ patch[dev]);
|
|
|
|
|
+ err = request_firmware(&chip->fw, patch[dev], &pci->dev);
|
|
|
|
|
+ if (err < 0)
|
|
|
|
|
+ goto out_free;
|
|
|
|
|
+ }
|
|
|
|
|
+#endif /* CONFIG_SND_HDA_PATCH_LOADER */
|
|
|
|
|
+
|
|
|
if (!chip->disabled) {
|
|
if (!chip->disabled) {
|
|
|
err = azx_probe_continue(chip);
|
|
err = azx_probe_continue(chip);
|
|
|
if (err < 0)
|
|
if (err < 0)
|
|
@@ -3205,12 +3223,13 @@ static int DELAYED_INIT_MARK azx_probe_continue(struct azx *chip)
|
|
|
if (err < 0)
|
|
if (err < 0)
|
|
|
goto out_free;
|
|
goto out_free;
|
|
|
#ifdef CONFIG_SND_HDA_PATCH_LOADER
|
|
#ifdef CONFIG_SND_HDA_PATCH_LOADER
|
|
|
- if (patch[dev] && *patch[dev]) {
|
|
|
|
|
- snd_printk(KERN_ERR SFX "Applying patch firmware '%s'\n",
|
|
|
|
|
- patch[dev]);
|
|
|
|
|
- err = snd_hda_load_patch(chip->bus, patch[dev]);
|
|
|
|
|
|
|
+ if (chip->fw) {
|
|
|
|
|
+ err = snd_hda_load_patch(chip->bus, chip->fw->size,
|
|
|
|
|
+ chip->fw->data);
|
|
|
if (err < 0)
|
|
if (err < 0)
|
|
|
goto out_free;
|
|
goto out_free;
|
|
|
|
|
+ release_firmware(chip->fw); /* no longer needed */
|
|
|
|
|
+ chip->fw = NULL;
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
if ((probe_only[dev] & 1) == 0) {
|
|
if ((probe_only[dev] & 1) == 0) {
|