aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasha Khapyorsky <sashak@smlink.com>2005-09-29 06:58:24 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:16:59 -0500
commit2ba71978c04d4dba983b4fc658f82eae164c2bca (patch)
treeb0b6407e8b7bf5c89cd54ad7fee278f262800dc3
parent6632d198c6643294319a4ca3f614539dc1ad37a8 (diff)
[ALSA] Removing obsolete AC97_SHARED_TYPES
This patch cleans last ac97 audio/modem codec interception in initialization procedures (ac97_mixer_new()) and removes obsolete SHARED_TYPE 'locking' which prevents from AMC codecs to function correctly. Signed-off-by: Sasha Khapyorsky <sashak@smlink.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/sound/ac97_codec.h10
-rw-r--r--sound/pci/ac97/ac97_codec.c38
-rw-r--r--sound/pci/atiixp.c1
-rw-r--r--sound/pci/atiixp_modem.c1
-rw-r--r--sound/pci/intel8x0.c1
-rw-r--r--sound/pci/intel8x0m.c1
-rw-r--r--sound/pci/via82xx.c2
-rw-r--r--sound/pci/via82xx_modem.c1
8 files changed, 3 insertions, 52 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index d11f34832a97..7f0ca79d6c98 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -387,15 +387,6 @@
387#define AC97_RATES_MIC_ADC 4 387#define AC97_RATES_MIC_ADC 4
388#define AC97_RATES_SPDIF 5 388#define AC97_RATES_SPDIF 5
389 389
390/* shared controllers */
391enum {
392 AC97_SHARED_TYPE_NONE,
393 AC97_SHARED_TYPE_ICH,
394 AC97_SHARED_TYPE_ATIIXP,
395 AC97_SHARED_TYPE_VIA,
396 AC97_SHARED_TYPES
397};
398
399/* 390/*
400 * 391 *
401 */ 392 */
@@ -468,7 +459,6 @@ struct _snd_ac97_bus {
468 unsigned short used_slots[2][4]; /* actually used PCM slots */ 459 unsigned short used_slots[2][4]; /* actually used PCM slots */
469 unsigned short pcms_count; /* count of PCMs */ 460 unsigned short pcms_count; /* count of PCMs */
470 struct ac97_pcm *pcms; 461 struct ac97_pcm *pcms;
471 unsigned int shared_type; /* type of shared controller betwen audio and modem */
472 ac97_t *codec[4]; 462 ac97_t *codec[4];
473 snd_info_entry_t *proc; 463 snd_info_entry_t *proc;
474}; 464};
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 */
226static DECLARE_MUTEX(shared_codec_mutex);
227static 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
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 241eacf1e652..cb1741102bbc 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1372,7 +1372,6 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock, const char
1372 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) 1372 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0)
1373 return err; 1373 return err;
1374 pbus->clock = clock; 1374 pbus->clock = clock;
1375 pbus->shared_type = AC97_SHARED_TYPE_ATIIXP; /* shared with modem driver */
1376 chip->ac97_bus = pbus; 1375 chip->ac97_bus = pbus;
1377 1376
1378 codec_count = 0; 1377 codec_count = 0;
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index c020c53a0cda..a88a6f372050 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -1068,7 +1068,6 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
1068 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) 1068 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0)
1069 return err; 1069 return err;
1070 pbus->clock = clock; 1070 pbus->clock = clock;
1071 pbus->shared_type = AC97_SHARED_TYPE_ATIIXP; /* shared with audio driver */
1072 chip->ac97_bus = pbus; 1071 chip->ac97_bus = pbus;
1073 1072
1074 codec_count = 0; 1073 codec_count = 0;
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 1a96198a17ae..0d11cf7d569a 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2022,7 +2022,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const
2022 if ((err = snd_ac97_bus(chip->card, 0, ops, chip, &pbus)) < 0) 2022 if ((err = snd_ac97_bus(chip->card, 0, ops, chip, &pbus)) < 0)
2023 goto __err; 2023 goto __err;
2024 pbus->private_free = snd_intel8x0_mixer_free_ac97_bus; 2024 pbus->private_free = snd_intel8x0_mixer_free_ac97_bus;
2025 pbus->shared_type = AC97_SHARED_TYPE_ICH; /* shared with modem driver */
2026 if (ac97_clock >= 8000 && ac97_clock <= 48000) 2025 if (ac97_clock >= 8000 && ac97_clock <= 48000)
2027 pbus->clock = ac97_clock; 2026 pbus->clock = ac97_clock;
2028 /* FIXME: my test board doesn't work well with VRA... */ 2027 /* FIXME: my test board doesn't work well with VRA... */
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 2ac1fec5059a..15364d27804d 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -855,7 +855,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
855 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) 855 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0)
856 goto __err; 856 goto __err;
857 pbus->private_free = snd_intel8x0_mixer_free_ac97_bus; 857 pbus->private_free = snd_intel8x0_mixer_free_ac97_bus;
858 pbus->shared_type = AC97_SHARED_TYPE_ICH; /* shared with audio driver */
859 if (ac97_clock >= 8000 && ac97_clock <= 48000) 858 if (ac97_clock >= 8000 && ac97_clock <= 48000)
860 pbus->clock = ac97_clock; 859 pbus->clock = ac97_clock;
861 chip->ac97_bus = pbus; 860 chip->ac97_bus = pbus;
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 3c0205b91e10..ecc4836ba8de 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1616,12 +1616,12 @@ static int __devinit snd_via82xx_mixer_new(via82xx_t *chip, const char *quirk_ov
1616 return err; 1616 return err;
1617 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus; 1617 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus;
1618 chip->ac97_bus->clock = chip->ac97_clock; 1618 chip->ac97_bus->clock = chip->ac97_clock;
1619 chip->ac97_bus->shared_type = AC97_SHARED_TYPE_VIA;
1620 1619
1621 memset(&ac97, 0, sizeof(ac97)); 1620 memset(&ac97, 0, sizeof(ac97));
1622 ac97.private_data = chip; 1621 ac97.private_data = chip;
1623 ac97.private_free = snd_via82xx_mixer_free_ac97; 1622 ac97.private_free = snd_via82xx_mixer_free_ac97;
1624 ac97.pci = chip->pci; 1623 ac97.pci = chip->pci;
1624 ac97.scaps = AC97_SCAP_SKIP_MODEM;
1625 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0) 1625 if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97)) < 0)
1626 return err; 1626 return err;
1627 1627
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 034dc1c6262a..c3ab8fbf582c 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -879,7 +879,6 @@ static int __devinit snd_via82xx_mixer_new(via82xx_t *chip)
879 return err; 879 return err;
880 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus; 880 chip->ac97_bus->private_free = snd_via82xx_mixer_free_ac97_bus;
881 chip->ac97_bus->clock = chip->ac97_clock; 881 chip->ac97_bus->clock = chip->ac97_clock;
882 chip->ac97_bus->shared_type = AC97_SHARED_TYPE_VIA;
883 882
884 memset(&ac97, 0, sizeof(ac97)); 883 memset(&ac97, 0, sizeof(ac97));
885 ac97.private_data = chip; 884 ac97.private_data = chip;