diff options
Diffstat (limited to 'sound/pci/ac97')
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 41fc290149ed..56549add80a8 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -220,12 +220,6 @@ const char *snd_ac97_stereo_enhancements[] = | |||
220 | /* 31 */ "Reserved 31" | 220 | /* 31 */ "Reserved 31" |
221 | }; | 221 | }; |
222 | 222 | ||
223 | /* | ||
224 | * Shared AC97 controllers (ICH, ATIIXP...) | ||
225 | */ | ||
226 | static DECLARE_MUTEX(shared_codec_mutex); | ||
227 | static ac97_t *shared_codec[AC97_SHARED_TYPES][4]; | ||
228 | |||
229 | 223 | ||
230 | /* | 224 | /* |
231 | * I/O routines | 225 | * I/O routines |
@@ -996,14 +990,8 @@ static int snd_ac97_free(ac97_t *ac97) | |||
996 | { | 990 | { |
997 | if (ac97) { | 991 | if (ac97) { |
998 | snd_ac97_proc_done(ac97); | 992 | snd_ac97_proc_done(ac97); |
999 | if (ac97->bus) { | 993 | if (ac97->bus) |
1000 | ac97->bus->codec[ac97->num] = NULL; | 994 | ac97->bus->codec[ac97->num] = NULL; |
1001 | if (ac97->bus->shared_type) { | ||
1002 | down(&shared_codec_mutex); | ||
1003 | shared_codec[ac97->bus->shared_type-1][ac97->num] = NULL; | ||
1004 | up(&shared_codec_mutex); | ||
1005 | } | ||
1006 | } | ||
1007 | if (ac97->private_free) | 995 | if (ac97->private_free) |
1008 | ac97->private_free(ac97); | 996 | ac97->private_free(ac97); |
1009 | kfree(ac97); | 997 | kfree(ac97); |
@@ -1889,21 +1877,6 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97) | |||
1889 | snd_assert(bus != NULL && template != NULL, return -EINVAL); | 1877 | snd_assert(bus != NULL && template != NULL, return -EINVAL); |
1890 | snd_assert(template->num < 4 && bus->codec[template->num] == NULL, return -EINVAL); | 1878 | snd_assert(template->num < 4 && bus->codec[template->num] == NULL, return -EINVAL); |
1891 | 1879 | ||
1892 | snd_assert(bus->shared_type <= AC97_SHARED_TYPES, return -EINVAL); | ||
1893 | if (bus->shared_type) { | ||
1894 | /* already shared? */ | ||
1895 | down(&shared_codec_mutex); | ||
1896 | ac97 = shared_codec[bus->shared_type-1][template->num]; | ||
1897 | if (ac97) { | ||
1898 | if ((ac97_is_audio(ac97) && (template->scaps & AC97_SCAP_SKIP_AUDIO)) || | ||
1899 | (ac97_is_modem(ac97) && (template->scaps & AC97_SCAP_SKIP_MODEM))) { | ||
1900 | up(&shared_codec_mutex); | ||
1901 | return -EACCES; /* skip this */ | ||
1902 | } | ||
1903 | } | ||
1904 | up(&shared_codec_mutex); | ||
1905 | } | ||
1906 | |||
1907 | card = bus->card; | 1880 | card = bus->card; |
1908 | ac97 = kzalloc(sizeof(*ac97), GFP_KERNEL); | 1881 | ac97 = kzalloc(sizeof(*ac97), GFP_KERNEL); |
1909 | if (ac97 == NULL) | 1882 | if (ac97 == NULL) |
@@ -2153,7 +2126,7 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97) | |||
2153 | } | 2126 | } |
2154 | } | 2127 | } |
2155 | /* make sure the proper powerdown bits are cleared */ | 2128 | /* make sure the proper powerdown bits are cleared */ |
2156 | if (ac97->scaps) { | 2129 | if (ac97->scaps && ac97_is_audio(ac97)) { |
2157 | reg = snd_ac97_read(ac97, AC97_EXTENDED_STATUS); | 2130 | reg = snd_ac97_read(ac97, AC97_EXTENDED_STATUS); |
2158 | if (ac97->scaps & AC97_SCAP_SURROUND_DAC) | 2131 | if (ac97->scaps & AC97_SCAP_SURROUND_DAC) |
2159 | reg &= ~AC97_EA_PRJ; | 2132 | reg &= ~AC97_EA_PRJ; |
@@ -2167,13 +2140,6 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97) | |||
2167 | return err; | 2140 | return err; |
2168 | } | 2141 | } |
2169 | *rac97 = ac97; | 2142 | *rac97 = ac97; |
2170 | |||
2171 | if (bus->shared_type) { | ||
2172 | down(&shared_codec_mutex); | ||
2173 | shared_codec[bus->shared_type-1][ac97->num] = ac97; | ||
2174 | up(&shared_codec_mutex); | ||
2175 | } | ||
2176 | |||
2177 | return 0; | 2143 | return 0; |
2178 | } | 2144 | } |
2179 | 2145 | ||