gusclassic.c (7b7e394185014e0f3bd8989cac937003f20ef9ce) | gusclassic.c (788c6043335590e0a483fdc18f85b1405a157bf9) |
---|---|
1/* 2 * Driver for Gravis UltraSound Classic soundcard 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 --- 62 unchanged lines hidden (view full) --- 71module_param_array(pcm_channels, int, NULL, 0444); 72MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Classic driver."); 73 74static struct platform_device *devices[SNDRV_CARDS]; 75 76 77#define PFX "gusclassic: " 78 | 1/* 2 * Driver for Gravis UltraSound Classic soundcard 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 --- 62 unchanged lines hidden (view full) --- 71module_param_array(pcm_channels, int, NULL, 0444); 72MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Classic driver."); 73 74static struct platform_device *devices[SNDRV_CARDS]; 75 76 77#define PFX "gusclassic: " 78 |
79static int __init snd_gusclassic_detect(struct snd_gus_card * gus) | 79static int __devinit snd_gusclassic_detect(struct snd_gus_card * gus) |
80{ 81 unsigned char d; 82 83 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ 84 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 0) { 85 snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); 86 return -ENODEV; 87 } 88 udelay(160); 89 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */ 90 udelay(160); 91 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) { 92 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); 93 return -ENODEV; 94 } 95 return 0; 96} 97 | 80{ 81 unsigned char d; 82 83 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ 84 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 0) { 85 snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); 86 return -ENODEV; 87 } 88 udelay(160); 89 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */ 90 udelay(160); 91 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) { 92 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); 93 return -ENODEV; 94 } 95 return 0; 96} 97 |
98static void __init snd_gusclassic_init(int dev, struct snd_gus_card * gus) | 98static void __devinit snd_gusclassic_init(int dev, struct snd_gus_card * gus) |
99{ 100 gus->equal_irq = 0; 101 gus->codec_flag = 0; 102 gus->max_flag = 0; 103 gus->joystick_dac = joystick_dac[dev]; 104} 105 | 99{ 100 gus->equal_irq = 0; 101 gus->codec_flag = 0; 102 gus->max_flag = 0; 103 gus->joystick_dac = joystick_dac[dev]; 104} 105 |
106static int __init snd_gusclassic_probe(struct platform_device *pdev) | 106static int __devinit snd_gusclassic_probe(struct platform_device *pdev) |
107{ 108 int dev = pdev->id; 109 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, 4, -1}; 110 static int possible_dmas[] = {5, 6, 7, 1, 3, -1}; 111 int xirq, xdma1, xdma2; 112 struct snd_card *card; 113 struct snd_gus_card *gus = NULL; 114 int err; --- 91 unchanged lines hidden (view full) --- 206 platform_set_drvdata(pdev, card); 207 return 0; 208 209 _err: 210 snd_card_free(card); 211 return err; 212} 213 | 107{ 108 int dev = pdev->id; 109 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, 4, -1}; 110 static int possible_dmas[] = {5, 6, 7, 1, 3, -1}; 111 int xirq, xdma1, xdma2; 112 struct snd_card *card; 113 struct snd_gus_card *gus = NULL; 114 int err; --- 91 unchanged lines hidden (view full) --- 206 platform_set_drvdata(pdev, card); 207 return 0; 208 209 _err: 210 snd_card_free(card); 211 return err; 212} 213 |
214static int snd_gusclassic_remove(struct platform_device *devptr) | 214static int __devexit snd_gusclassic_remove(struct platform_device *devptr) |
215{ 216 snd_card_free(platform_get_drvdata(devptr)); 217 platform_set_drvdata(devptr, NULL); 218 return 0; 219} 220 221#define GUSCLASSIC_DRIVER "snd_gusclassic" 222 223static struct platform_driver snd_gusclassic_driver = { 224 .probe = snd_gusclassic_probe, | 215{ 216 snd_card_free(platform_get_drvdata(devptr)); 217 platform_set_drvdata(devptr, NULL); 218 return 0; 219} 220 221#define GUSCLASSIC_DRIVER "snd_gusclassic" 222 223static struct platform_driver snd_gusclassic_driver = { 224 .probe = snd_gusclassic_probe, |
225 .remove = snd_gusclassic_remove, | 225 .remove = __devexit_p(snd_gusclassic_remove), |
226 /* FIXME: suspend/resume */ 227 .driver = { 228 .name = GUSCLASSIC_DRIVER 229 }, 230}; 231 232static void __init_or_module snd_gusclassic_unregister_all(void) 233{ --- 48 unchanged lines hidden --- | 226 /* FIXME: suspend/resume */ 227 .driver = { 228 .name = GUSCLASSIC_DRIVER 229 }, 230}; 231 232static void __init_or_module snd_gusclassic_unregister_all(void) 233{ --- 48 unchanged lines hidden --- |