Ejemplo n.º 1
0
void
soundcard_init (void)
{
#ifndef MODULE
  module_register_chrdev (sound_major, "sound", &sound_fops);
  chrdev_registered = 1;
#endif

  soundcard_configured = 1;

  sndtable_init ();		/* Initialize call tables and detect cards */



#ifdef CONFIG_LOWLEVEL_SOUND
  {
    extern void     sound_init_lowlevel_drivers (void);

    sound_init_lowlevel_drivers ();
  }
#endif

  if (sndtable_get_cardcount () == 0)
    return;			/* No cards detected */

#ifdef CONFIG_AUDIO
  if (num_audiodevs)		/* Audio devices present */
    {
      DMAbuf_init ();
      audio_init ();
    }
#endif

#ifdef CONFIG_MIDI
  if (num_midis)
    MIDIbuf_init ();
#endif

#ifdef CONFIG_SEQUENCER
  if (num_midis + num_synths)
    sequencer_init ();
#endif

}
Ejemplo n.º 2
0
int
sndtable_init_card(int unit, struct address_info * hw_config)
{
    int     i, n = num_sound_cards;
    struct card_info *ci = snd_installed_cards ;

    DDB(printf("sndtable_init_card(%d) entered\n", unit));

    if (!unit) {
        sndtable_init() ;
        return TRUE;
    }
    for (i = 0; i < n && ci->card_type; ci++, i++)
        if (ci->card_type == unit) {
            int             drv;

            ci->config.io_base = hw_config->io_base;
            ci->config.irq = hw_config->irq;
            ci->config.dma = hw_config->dma;
            ci->config.dma2 = hw_config->dma2;
            ci->config.name = hw_config->name;
            ci->config.always_detect = hw_config->always_detect;
            ci->config.card_subtype = hw_config->card_subtype;
            ci->config.osp = hw_config->osp;

            if ((drv = snd_find_driver(ci->card_type)) == -1)
                ci->enabled = 0; /* Mark not fnd */
            else {
                DDB(printf("Located card - calling attach routine\n"));
                sound_drivers[drv].attach(hw_config) ;
                DDB(printf("attach routine finished\n"));
            }
            start_services();
            return TRUE;
        }
    DDB(printf("sndtable_init_card: No card defined with type=%d, num cards: %d\n",
               unit, num_sound_cards));
    return FALSE;
}