#if 0 snd_cs4231_debug(chip); #endif 
static int snd_cs4231_probe(cs4231_t *chip){	unsigned long flags;	int i, id, vers;	unsigned char *ptr;#if 0	snd_cs4231_debug(chip);#endif	id = vers = 0;	for (i = 0; i < 50; i++) {		mb();		if (__cs4231_readb(chip, CS4231P(chip, REGSEL)) & CS4231_INIT)			udelay(2000);		else {			spin_lock_irqsave(&chip->lock, flags);			snd_cs4231_out(chip, CS4231_MISC_INFO, CS4231_MODE2);			id = snd_cs4231_in(chip, CS4231_MISC_INFO) & 0x0f;			vers = snd_cs4231_in(chip, CS4231_VERSION);			spin_unlock_irqrestore(&chip->lock, flags);			if (id == 0x0a)				break;	/* this is valid value */		}	}	snd_printdd("cs4231: port = %p, id = 0x%x\n", chip->port, id);	if (id != 0x0a)		return -ENODEV;	/* no valid device found */	spin_lock_irqsave(&chip->lock, flags);	/* Reset DMA engine.  */#ifdef EBUS_SUPPORT	if (chip->flags & CS4231_FLAG_EBUS) {		/* Done by ebus_dma_register */	} else {#endif#ifdef SBUS_SUPPORT                sbus_writel(APC_CHIP_RESET, chip->port + APCCSR);                sbus_writel(0x00, chip->port + APCCSR);                sbus_writel(sbus_readl(chip->port + APCCSR) | APC_CDC_RESET,			    chip->port + APCCSR);                  udelay(20);                  sbus_writel(sbus_readl(chip->port + APCCSR) & ~APC_CDC_RESET,			    chip->port + APCCSR);                sbus_writel(sbus_readl(chip->port + APCCSR) | (APC_XINT_ENA |							       APC_XINT_PENA |							       APC_XINT_CENA),			    chip->port + APCCSR);#endif#ifdef EBUS_SUPPORT	}#endif	__cs4231_readb(chip, CS4231P(chip, STATUS));	/* clear any pendings IRQ */	__cs4231_writeb(chip, 0, CS4231P(chip, STATUS));	mb();	spin_unlock_irqrestore(&chip->lock, flags);	chip->image[CS4231_MISC_INFO] = CS4231_MODE2;	chip->image[CS4231_IFACE_CTRL] =		chip->image[CS4231_IFACE_CTRL] & ~CS4231_SINGLE_DMA;	chip->image[CS4231_ALT_FEATURE_1] = 0x80;	chip->image[CS4231_ALT_FEATURE_2] = 0x01;	if (vers & 0x20)		chip->image[CS4231_ALT_FEATURE_2] |= 0x02;	ptr = (unsigned char *) &chip->image;	snd_cs4231_mce_down(chip);	spin_lock_irqsave(&chip->lock, flags);	for (i = 0; i < 32; i++)	/* ok.. fill all CS4231 registers */		snd_cs4231_out(chip, i, *ptr++);	spin_unlock_irqrestore(&chip->lock, flags);	snd_cs4231_mce_up(chip);	snd_cs4231_mce_down(chip);	mdelay(2);	return 0;		/* all things are ok.. */}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a131430c200f6bda313bf5d0a8e238c41afdfe0a/cs4231.c/clean/sound/sparc/cs4231.c