status = pcc_get(sock, (unsigned int)PLD_CFBUFCR); if (status != 0) { /* buffer off */ pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); udelay(50); pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101); udelay(25); /* for IDE reset */ pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100); mdelay(2);  /* for IDE reset */ } else { *value |= SS_POWERON; *value |= SS_READY; } 
*value |= SS_POWERON;  pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); udelay(50); pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101); udelay(25); /* for IDE reset */ pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100); mdelay(2);  /* for IDE reset */  *value |= SS_READY; *value |= SS_3VCARD; } else { /* disable CF power */ pcc_set(sock, (unsigned int)PLD_CPCR, 0); udelay(100); debug(3, "m32r_cfc: _pcc_get_status: " "power off (CPCR=0x%08x)\n", status); 
static int _pcc_get_status(u_short sock, u_int *value){	u_int status;	debug(3, "m32r_cfc: _pcc_get_status:\n");	status = pcc_get(sock, (unsigned int)PLD_CFSTS);	*value = (status) ? SS_DETECT : 0; 	debug(3, "m32r_cfc: _pcc_get_status: status=0x%08x\n", status);#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT)	if ( status ) {		/* enable CF power */		status = inw((unsigned int)PLD_CPCR);		if (!(status & PLD_CPCR_CF)) {			debug(3, "m32r_cfc: _pcc_get_status: "				 "power on (CPCR=0x%08x)\n", status);			status |= PLD_CPCR_CF;			outw(status, (unsigned int)PLD_CPCR);			udelay(100);		}		*value |= SS_POWERON;		pcc_set(sock, (unsigned int)PLD_CFBUFCR,0);/* enable buffer */		udelay(100);		*value |= SS_READY; 		/* always ready */		*value |= SS_3VCARD;	} else {		/* disable CF power */		status = inw((unsigned int)PLD_CPCR);		status &= ~PLD_CPCR_CF;		outw(status, (unsigned int)PLD_CPCR);		udelay(100);		debug(3, "m32r_cfc: _pcc_get_status: "			 "power off (CPCR=0x%08x)\n", status);	}#elif defined(CONFIG_PLAT_MAPPI2)	if ( status ) {		status = pcc_get(sock, (unsigned int)PLD_CPCR);		if (status == 0) { /* power off */			pcc_set(sock, (unsigned int)PLD_CPCR, 1);			pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); /* force buffer off for ZA-36 */			udelay(50);		}		status = pcc_get(sock, (unsigned int)PLD_CFBUFCR);		if (status != 0) { /* buffer off */			pcc_set(sock, (unsigned int)PLD_CFBUFCR,0);			udelay(50);			pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101);			udelay(25); /* for IDE reset */			pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100);			mdelay(2);  /* for IDE reset */		} else {			*value |= SS_POWERON;			*value |= SS_READY;		}	}#else#error no platform configuration#endif	debug(3, "m32r_cfc: _pcc_get_status: GetStatus(%d) = %#4.4x\n",		 sock, *value);	return 0;} /* _get_status */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/934bb7f88eb398f62314fa63ba72ac6dcd21192a/m32r_cfc.c/buggy/drivers/pcmcia/m32r_cfc.c