|
28 | 28 | #include <linux/module.h>
|
29 | 29 | #include <linux/firmware.h>
|
30 | 30 | #include <linux/kernel.h>
|
| 31 | +#include <linux/types.h> |
| 32 | +#include <linux/io.h> |
| 33 | +#include <linux/pci.h> |
31 | 34 | #include <sound/core.h>
|
32 | 35 | #include "hda_codec.h"
|
33 | 36 | #include "hda_local.h"
|
@@ -764,6 +767,11 @@ struct ca0132_spec {
|
764 | 767 | #ifdef ENABLE_TUNING_CONTROLS
|
765 | 768 | long cur_ctl_vals[TUNING_CTLS_COUNT];
|
766 | 769 | #endif
|
| 770 | + /* |
| 771 | + * Sound Blaster Z PCI region 2 iomem, used for input and output |
| 772 | + * switching, and other unknown commands. |
| 773 | + */ |
| 774 | + void __iomem *mem_base; |
767 | 775 | };
|
768 | 776 |
|
769 | 777 | /*
|
@@ -4700,6 +4708,8 @@ static void ca0132_free(struct hda_codec *codec)
|
4700 | 4708 | snd_hda_sequence_write(codec, spec->base_exit_verbs);
|
4701 | 4709 | ca0132_exit_chip(codec);
|
4702 | 4710 | snd_hda_power_down(codec);
|
| 4711 | + if (spec->mem_base) |
| 4712 | + iounmap(spec->mem_base); |
4703 | 4713 | kfree(spec->spec_init_verbs);
|
4704 | 4714 | kfree(codec->spec);
|
4705 | 4715 | }
|
@@ -4915,6 +4925,15 @@ static int patch_ca0132(struct hda_codec *codec)
|
4915 | 4925 | else
|
4916 | 4926 | spec->quirk = QUIRK_NONE;
|
4917 | 4927 |
|
| 4928 | + /* Setup BAR Region 2 for Sound Blaster Z */ |
| 4929 | + if (spec->quirk == QUIRK_SBZ) { |
| 4930 | + spec->mem_base = pci_iomap(codec->bus->pci, 2, 0xC20); |
| 4931 | + if (spec->mem_base == NULL) { |
| 4932 | + codec_warn(codec, "pci_iomap failed!"); |
| 4933 | + codec_info(codec, "perhaps this is not an SBZ?"); |
| 4934 | + spec->quirk = QUIRK_NONE; |
| 4935 | + } |
| 4936 | + } |
4918 | 4937 | spec->dsp_state = DSP_DOWNLOAD_INIT;
|
4919 | 4938 | spec->num_mixers = 1;
|
4920 | 4939 | spec->mixers[0] = ca0132_mixer;
|
|
0 commit comments