TSLOT_WRITE(td, TS102_REG_CARD_A_STS, TSLOT_READ(td, TS102_REG_CARD_A_STS) | TS102_CARD_STS_LVL);
tslot_slot_enable(pcmcia_chipset_handle_t pch){	struct tslot_data *td = (struct tslot_data *)pch;	int status, intr, i;#ifdef TSLOT_DEBUG	printf("%s: enable slot %d\n",	    td->td_parent->sc_dev.dv_xname, td->td_slot);#endif	/* Pover down the socket to reset it */	status = TSLOT_READ(td, TS102_REG_CARD_A_STS);	TSLOT_WRITE(td, TS102_REG_CARD_A_STS, status | TS102_CARD_STS_VCCEN);	/*	 * wait 300ms until power fails (Tpf).  Then, wait 100ms since we	 * are changing Vcc (Toff).	 */	DELAY((300 + 100) * 1000);	/*	 * Power on the card if not already done, and enable card access	 */	status |= TS102_CARD_STS_ACEN;	status &= ~TS102_CARD_STS_VCCEN;	TSLOT_WRITE(td, TS102_REG_CARD_A_STS, status);	/*	 * wait 100ms until power raise (Tpr) and 20ms to become	 * stable (Tsu(Vcc)).	 */	DELAY((100 + 20) * 1000);	status &= ~TS102_CARD_STS_VPP1_MASK;	status |= TS102_CARD_STS_VPP1_VCC;	TSLOT_WRITE(td, TS102_REG_CARD_A_STS, status);	/*	 * hold RESET at least 20us.	 */	intr = TSLOT_READ(td, TS102_REG_CARD_A_INT);	TSLOT_WRITE(td, TS102_REG_CARD_A_INT, TS102_CARD_INT_SOFT_RESET);	DELAY(20);	TSLOT_WRITE(td, TS102_REG_CARD_A_INT, intr);	/* wait 20ms as per pc card standard (r2.01) section 4.3.6 */	DELAY(20 * 1000);	/*	 * Wait until the card is unbusy. If it is still busy after 3 seconds,	 * give up. We could enable card interrupts and wait for the interrupt	 * to happen when BUSY is released, but the interrupt could also be	 * triggered by the card itself if it's an I/O card, so better poll	 * here.	 */	for (i = 30000; i != 0; i--) {		status = TSLOT_READ(td, TS102_REG_CARD_A_STS);		if ((status & TS102_CARD_STS_PRES) == 0) {			tslot_slot_disable(pch);			return;		}		if (status & TS102_CARD_STS_RDY)			break;		else			DELAY(100);	}	if (i == 0) {		printf("%s: slot %d still busy after 3 seconds, status 0x%x\n",		    td->td_parent->sc_dev.dv_xname, td->td_slot,		    TSLOT_READ(td, TS102_REG_CARD_A_STS));		return;	}	/*	 * Enable the card interrupts if this is an I/O card.	 * Note that the TS102_CARD_STS_IO bit in the status register will	 * never get set, despite what the documentation says!	 */	if (pcmcia_card_gettype(td->td_pcmcia) == PCMCIA_IFTYPE_IO) {		TSLOT_WRITE(td, TS102_REG_CARD_A_STS,		    TSLOT_READ(td, TS102_REG_CARD_A_STS) | TS102_CARD_STS_IO);		TSLOT_WRITE(td, TS102_REG_CARD_A_INT,		    TS102_CARD_INT_MASK_CARDDETECT_STATUS |		    TS102_CARD_INT_MASK_IRQ);	}}