Esempio n. 1
0
int probe_sgalaxy( struct address_info *ai )
{
	if ( check_region( ai->io_base, 8 ) )
	{
		printk(KERN_ERR "sgalaxy: WSS IO port 0x%03x not available\n", ai->io_base);
		return 0;
	}
        
	if ( ad1848_detect( ai->io_base+4, NULL, ai->osp ) )
		return probe_ms_sound(ai);  /* The card is already active, check irq etc... */

	if ( check_region( ai->ai_sgbase, 0x10 ) )
	{
		printk(KERN_ERR "sgalaxy: SB IO port 0x%03x not available\n", ai->ai_sgbase);
		return 0;
	}
        
	/* switch to MSS/WSS mode */
   
	sb_rst( ai->ai_sgbase );
   
	sb_cmd( ai->ai_sgbase, 9 );
	sb_cmd( ai->ai_sgbase, 0 );

	sleep( HZ/10 );

      	return probe_ms_sound(ai);
}
Esempio n. 2
0
static int
sb_identify_board(struct resource *io)
{
	int ver, essver, rev;

    	sb_cmd(io, DSP_CMD_GETVER);	/* Get version */
    	ver = (sb_get_byte(io) << 8) | sb_get_byte(io);
	if (ver < 0x100 || ver > 0x4ff) return 0;
    	if (ver == 0x0301) {
	    	/* Try to detect ESS chips. */
	    	sb_cmd(io, DSP_CMD_GETID); /* Return ident. bytes. */
	    	essver = (sb_get_byte(io) << 8) | sb_get_byte(io);
	    	rev = essver & 0x000f;
	    	essver &= 0xfff0;
	    	if (essver == 0x4880) ver |= 0x1000;
	    	else if (essver == 0x6880) ver = 0x0500 | rev;
	}
	return ver;
}