gusextreme.c (0612ec48762bf8712db1925b2e67246d2237ebab) gusextreme.c (788c6043335590e0a483fdc18f85b1405a157bf9)
1/*
2 * Driver for Gravis UltraSound Extreme soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
4 *
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 78 unchanged lines hidden (view full) ---

87module_param_array(pcm_channels, int, NULL, 0444);
88MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver.");
89
90static struct platform_device *devices[SNDRV_CARDS];
91
92
93#define PFX "gusextreme: "
94
1/*
2 * Driver for Gravis UltraSound Extreme soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
4 *
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 78 unchanged lines hidden (view full) ---

87module_param_array(pcm_channels, int, NULL, 0444);
88MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver.");
89
90static struct platform_device *devices[SNDRV_CARDS];
91
92
93#define PFX "gusextreme: "
94
95static int __init snd_gusextreme_detect(int dev,
95static int __devinit snd_gusextreme_detect(int dev,
96 struct snd_card *card,
97 struct snd_gus_card * gus,
98 struct snd_es1688 *es1688)
99{
100 unsigned long flags;
101 unsigned char d;
102
103 /*

--- 33 unchanged lines hidden (view full) ---

137 udelay(160);
138 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) {
139 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
140 return -EIO;
141 }
142 return 0;
143}
144
96 struct snd_card *card,
97 struct snd_gus_card * gus,
98 struct snd_es1688 *es1688)
99{
100 unsigned long flags;
101 unsigned char d;
102
103 /*

--- 33 unchanged lines hidden (view full) ---

137 udelay(160);
138 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) {
139 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
140 return -EIO;
141 }
142 return 0;
143}
144
145static void __init snd_gusextreme_init(int dev, struct snd_gus_card * gus)
145static void __devinit snd_gusextreme_init(int dev, struct snd_gus_card * gus)
146{
147 gus->joystick_dac = joystick_dac[dev];
148}
149
146{
147 gus->joystick_dac = joystick_dac[dev];
148}
149
150static int __init snd_gusextreme_mixer(struct snd_es1688 *chip)
150static int __devinit snd_gusextreme_mixer(struct snd_es1688 *chip)
151{
152 struct snd_card *card = chip->card;
153 struct snd_ctl_elem_id id1, id2;
154 int err;
155
156 memset(&id1, 0, sizeof(id1));
157 memset(&id2, 0, sizeof(id2));
158 id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER;

--- 5 unchanged lines hidden (view full) ---

164 /* reassign Master Playback Switch to Synth Playback Switch */
165 strcpy(id1.name, "Master Playback Switch");
166 strcpy(id2.name, "Synth Playback Switch");
167 if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0)
168 return err;
169 return 0;
170}
171
151{
152 struct snd_card *card = chip->card;
153 struct snd_ctl_elem_id id1, id2;
154 int err;
155
156 memset(&id1, 0, sizeof(id1));
157 memset(&id2, 0, sizeof(id2));
158 id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER;

--- 5 unchanged lines hidden (view full) ---

164 /* reassign Master Playback Switch to Synth Playback Switch */
165 strcpy(id1.name, "Master Playback Switch");
166 strcpy(id2.name, "Synth Playback Switch");
167 if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0)
168 return err;
169 return 0;
170}
171
172static int __init snd_gusextreme_probe(struct platform_device *pdev)
172static int __devinit snd_gusextreme_probe(struct platform_device *pdev)
173{
174 int dev = pdev->id;
175 static int possible_ess_irqs[] = {5, 9, 10, 7, -1};
176 static int possible_ess_dmas[] = {1, 3, 0, -1};
177 static int possible_gf1_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
178 static int possible_gf1_dmas[] = {5, 6, 7, 1, 3, -1};
179 int xgf1_irq, xgf1_dma, xess_irq, xmpu_irq, xess_dma;
180 struct snd_card *card;

--- 135 unchanged lines hidden (view full) ---

316 platform_set_drvdata(pdev, card);
317 return 0;
318
319 out:
320 snd_card_free(card);
321 return err;
322}
323
173{
174 int dev = pdev->id;
175 static int possible_ess_irqs[] = {5, 9, 10, 7, -1};
176 static int possible_ess_dmas[] = {1, 3, 0, -1};
177 static int possible_gf1_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
178 static int possible_gf1_dmas[] = {5, 6, 7, 1, 3, -1};
179 int xgf1_irq, xgf1_dma, xess_irq, xmpu_irq, xess_dma;
180 struct snd_card *card;

--- 135 unchanged lines hidden (view full) ---

316 platform_set_drvdata(pdev, card);
317 return 0;
318
319 out:
320 snd_card_free(card);
321 return err;
322}
323
324static int snd_gusextreme_remove(struct platform_device *devptr)
324static int __devexit snd_gusextreme_remove(struct platform_device *devptr)
325{
326 snd_card_free(platform_get_drvdata(devptr));
327 platform_set_drvdata(devptr, NULL);
328 return 0;
329}
330
331#define GUSEXTREME_DRIVER "snd_gusextreme"
332
333static struct platform_driver snd_gusextreme_driver = {
334 .probe = snd_gusextreme_probe,
325{
326 snd_card_free(platform_get_drvdata(devptr));
327 platform_set_drvdata(devptr, NULL);
328 return 0;
329}
330
331#define GUSEXTREME_DRIVER "snd_gusextreme"
332
333static struct platform_driver snd_gusextreme_driver = {
334 .probe = snd_gusextreme_probe,
335 .remove = snd_gusextreme_remove,
335 .remove = __devexit_p(snd_gusextreme_remove),
336 /* FIXME: suspend/resume */
337 .driver = {
338 .name = GUSEXTREME_DRIVER
339 },
340};
341
342static void __init_or_module snd_gusextreme_unregister_all(void)
343{

--- 48 unchanged lines hidden ---
336 /* FIXME: suspend/resume */
337 .driver = {
338 .name = GUSEXTREME_DRIVER
339 },
340};
341
342static void __init_or_module snd_gusextreme_unregister_all(void)
343{

--- 48 unchanged lines hidden ---