aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/atiixp_modem.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/atiixp_modem.c')
-rw-r--r--sound/pci/atiixp_modem.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index c1a239a4dac6..0cf202079571 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -39,20 +39,21 @@ MODULE_DESCRIPTION("ATI IXP MC97 controller");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}"); 40MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}");
41 41
42static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ 42static int index = -2; /* Exclude the first card */
43static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 43static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
44static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 44static int ac97_clock = 48000;
45static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
46 45
47module_param_array(index, int, NULL, 0444); 46module_param(index, int, 0444);
48MODULE_PARM_DESC(index, "Index value for ATI IXP controller."); 47MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
49module_param_array(id, charp, NULL, 0444); 48module_param(id, charp, 0444);
50MODULE_PARM_DESC(id, "ID string for ATI IXP controller."); 49MODULE_PARM_DESC(id, "ID string for ATI IXP controller.");
51module_param_array(enable, bool, NULL, 0444); 50module_param(ac97_clock, int, 0444);
52MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
53module_param_array(ac97_clock, int, NULL, 0444);
54MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); 51MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
55 52
53/* just for backward compatibility */
54static int enable;
55module_param(enable, bool, 0444);
56
56 57
57/* 58/*
58 */ 59 */
@@ -306,8 +307,7 @@ static int snd_atiixp_update_bits(atiixp_t *chip, unsigned int reg,
306 307
307/* delay for one tick */ 308/* delay for one tick */
308#define do_delay() do { \ 309#define do_delay() do { \
309 set_current_state(TASK_UNINTERRUPTIBLE); \ 310 schedule_timeout_uninterruptible(1); \
310 schedule_timeout(1); \
311} while (0) 311} while (0)
312 312
313 313
@@ -989,6 +989,7 @@ static int __devinit snd_atiixp_pcm_new(atiixp_t *chip)
989 return err; 989 return err;
990 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_atiixp_playback_ops); 990 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_atiixp_playback_ops);
991 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_atiixp_capture_ops); 991 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_atiixp_capture_ops);
992 pcm->dev_class = SNDRV_PCM_CLASS_MODEM;
992 pcm->private_data = chip; 993 pcm->private_data = chip;
993 strcpy(pcm->name, "ATI IXP MC97"); 994 strcpy(pcm->name, "ATI IXP MC97");
994 chip->pcmdevs[ATI_PCMDEV_ANALOG] = pcm; 995 chip->pcmdevs[ATI_PCMDEV_ANALOG] = pcm;
@@ -1067,7 +1068,6 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
1067 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)
1068 return err; 1069 return err;
1069 pbus->clock = clock; 1070 pbus->clock = clock;
1070 pbus->shared_type = AC97_SHARED_TYPE_ATIIXP; /* shared with audio driver */
1071 chip->ac97_bus = pbus; 1071 chip->ac97_bus = pbus;
1072 1072
1073 codec_count = 0; 1073 codec_count = 0;
@@ -1256,20 +1256,12 @@ static int __devinit snd_atiixp_create(snd_card_t *card,
1256static int __devinit snd_atiixp_probe(struct pci_dev *pci, 1256static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1257 const struct pci_device_id *pci_id) 1257 const struct pci_device_id *pci_id)
1258{ 1258{
1259 static int dev;
1260 snd_card_t *card; 1259 snd_card_t *card;
1261 atiixp_t *chip; 1260 atiixp_t *chip;
1262 unsigned char revision; 1261 unsigned char revision;
1263 int err; 1262 int err;
1264 1263
1265 if (dev >= SNDRV_CARDS) 1264 card = snd_card_new(index, id, THIS_MODULE, 0);
1266 return -ENODEV;
1267 if (!enable[dev]) {
1268 dev++;
1269 return -ENOENT;
1270 }
1271
1272 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
1273 if (card == NULL) 1265 if (card == NULL)
1274 return -ENOMEM; 1266 return -ENOMEM;
1275 1267
@@ -1283,7 +1275,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1283 if ((err = snd_atiixp_aclink_reset(chip)) < 0) 1275 if ((err = snd_atiixp_aclink_reset(chip)) < 0)
1284 goto __error; 1276 goto __error;
1285 1277
1286 if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev])) < 0) 1278 if ((err = snd_atiixp_mixer_new(chip, ac97_clock)) < 0)
1287 goto __error; 1279 goto __error;
1288 1280
1289 if ((err = snd_atiixp_pcm_new(chip)) < 0) 1281 if ((err = snd_atiixp_pcm_new(chip)) < 0)
@@ -1302,7 +1294,6 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1302 goto __error; 1294 goto __error;
1303 1295
1304 pci_set_drvdata(pci, card); 1296 pci_set_drvdata(pci, card);
1305 dev++;
1306 return 0; 1297 return 0;
1307 1298
1308 __error: 1299 __error: