/[openvortex]/alsa/alsa-kernel/isa/ad1848/ad1848.c
ViewVC logotype

Diff of /alsa/alsa-kernel/isa/ad1848/ad1848.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by vizard, Tue Apr 15 21:34:56 2003 UTC revision 1.2 by vizard, Mon Aug 11 00:06:39 2003 UTC
# Line 46  static int enable[SNDRV_CARDS] = SNDRV_D Line 46  static int enable[SNDRV_CARDS] = SNDRV_D
46  static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;     /* PnP setup */  static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;     /* PnP setup */
47  static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;        /* 5,7,9,11,12,15 */  static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;        /* 5,7,9,11,12,15 */
48  static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;       /* 0,1,3,5,6,7 */  static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;       /* 0,1,3,5,6,7 */
49    static int thinkpad[SNDRV_CARDS];                       /* Thinkpad special case */
50    
51  MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");  MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
52  MODULE_PARM_DESC(index, "Index value for AD1848 soundcard.");  MODULE_PARM_DESC(index, "Index value for AD1848 soundcard.");
# Line 65  MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC); Line 66  MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
66  MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");  MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
67  MODULE_PARM_DESC(dma1, "DMA1 # for AD1848 driver.");  MODULE_PARM_DESC(dma1, "DMA1 # for AD1848 driver.");
68  MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);  MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
69    MODULE_PARM(thinkpad, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
70    MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series.");
71    MODULE_PARM_SYNTAX(thinkpad,  SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
72    
73  static snd_card_t *snd_ad1848_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;  static snd_card_t *snd_ad1848_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
74    
# Line 77  static int __init snd_card_ad1848_probe( Line 81  static int __init snd_card_ad1848_probe(
81          int err;          int err;
82    
83          if (port[dev] == SNDRV_AUTO_PORT) {          if (port[dev] == SNDRV_AUTO_PORT) {
84                  snd_printk("specify port\n");                  snd_printk(KERN_ERR "ad1848: specify port\n");
85                  return -EINVAL;                  return -EINVAL;
86          }          }
87          if (irq[dev] == SNDRV_AUTO_IRQ) {          if (irq[dev] == SNDRV_AUTO_IRQ) {
88                  snd_printk("specify irq\n");                  snd_printk(KERN_ERR "ad1848: specify irq\n");
89                  return -EINVAL;                  return -EINVAL;
90          }          }
91          if (dma1[dev] == SNDRV_AUTO_DMA) {          if (dma1[dev] == SNDRV_AUTO_DMA) {
92                  snd_printk("specify dma1\n");                  snd_printk(KERN_ERR "ad1848: specify dma1\n");
93                  return -EINVAL;                  return -EINVAL;
94          }          }
95    
# Line 96  static int __init snd_card_ad1848_probe( Line 100  static int __init snd_card_ad1848_probe(
100          if ((err = snd_ad1848_create(card, port[dev],          if ((err = snd_ad1848_create(card, port[dev],
101                                       irq[dev],                                       irq[dev],
102                                       dma1[dev],                                       dma1[dev],
103                                       AD1848_HW_DETECT,                                       thinkpad[dev] ? AD1848_HW_THINKPAD : AD1848_HW_DETECT,
104                                       &chip)) < 0) {                                       &chip)) < 0) {
105                  snd_card_free(card);                  snd_card_free(card);
106                  return err;                  return err;
# Line 116  static int __init snd_card_ad1848_probe( Line 120  static int __init snd_card_ad1848_probe(
120          sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",          sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
121                  pcm->name, chip->port, irq[dev], dma1[dev]);                  pcm->name, chip->port, irq[dev], dma1[dev]);
122    
123            if (thinkpad[dev]) {
124                    strcat(card->longname, " [Thinkpad]");
125            }
126    
127          if ((err = snd_card_register(card)) < 0) {          if ((err = snd_card_register(card)) < 0) {
128                  snd_card_free(card);                  snd_card_free(card);
129                  return err;                  return err;
# Line 168  static int __init alsa_card_ad1848_setup Line 176  static int __init alsa_card_ad1848_setup
176                 get_id(&str,&id[nr_dev]) == 2 &&                 get_id(&str,&id[nr_dev]) == 2 &&
177                 get_option(&str,(int *)&port[nr_dev]) == 2 &&                 get_option(&str,(int *)&port[nr_dev]) == 2 &&
178                 get_option(&str,&irq[nr_dev]) == 2 &&                 get_option(&str,&irq[nr_dev]) == 2 &&
179                 get_option(&str,&dma1[nr_dev]) == 2);                 get_option(&str,&dma1[nr_dev]) == 2 &&
180                   get_option(&str,&thinkpad[nr_dev]) == 2);
181          nr_dev++;          nr_dev++;
182          return 1;          return 1;
183  }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26