/* The device-tree contains that in the hwclock node */ if (macio->type == macio_intrepid) { UN_OUT(UNI_N_CLOCK_SPREADING, 0); mdelay(40); } 
/* Disable clock spreading */ pmac_tweak_clock_spreading(macio, 0); 
core99_sleep(void){	struct macio_chip* macio;	int i;	macio = &macio_chips[0];	if (macio->type != macio_keylargo && macio->type != macio_pangea &&	    macio->type != macio_intrepid)		return -ENODEV;	/* The device-tree contains that in the hwclock node */	if (macio->type == macio_intrepid) {		UN_OUT(UNI_N_CLOCK_SPREADING, 0);		mdelay(40);	}	/* We power off the wireless slot in case it was not done	 * by the driver. We don't power it on automatically however	 */	if (macio->flags & MACIO_FLAG_AIRPORT_ON)		core99_airport_enable(macio->of_node, 0, 0);	/* We power off the FW cable. Should be done by the driver... */	if (macio->flags & MACIO_FLAG_FW_SUPPORTED) {		core99_firewire_enable(NULL, 0, 0);		core99_firewire_cable_power(NULL, 0, 0);	}	/* We make sure int. modem is off (in case driver lost it) */	if (macio->type == macio_keylargo)		core99_modem_enable(macio->of_node, 0, 0);	else		pangea_modem_enable(macio->of_node, 0, 0);	/* We make sure the sound is off as well */	core99_sound_chip_enable(macio->of_node, 0, 0);	/*	 * Save various bits of KeyLargo	 */	/* Save the state of the various GPIOs */	save_gpio_levels[0] = MACIO_IN32(KEYLARGO_GPIO_LEVELS0);	save_gpio_levels[1] = MACIO_IN32(KEYLARGO_GPIO_LEVELS1);	for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)		save_gpio_extint[i] = MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+i);	for (i=0; i<KEYLARGO_GPIO_CNT; i++)		save_gpio_normal[i] = MACIO_IN8(KEYLARGO_GPIO_0+i);	/* Save the FCRs */	if (macio->type == macio_keylargo)		save_mbcr = MACIO_IN32(KEYLARGO_MBCR);	save_fcr[0] = MACIO_IN32(KEYLARGO_FCR0);	save_fcr[1] = MACIO_IN32(KEYLARGO_FCR1);	save_fcr[2] = MACIO_IN32(KEYLARGO_FCR2);	save_fcr[3] = MACIO_IN32(KEYLARGO_FCR3);	save_fcr[4] = MACIO_IN32(KEYLARGO_FCR4);	if (macio->type == macio_pangea || macio->type == macio_intrepid)		save_fcr[5] = MACIO_IN32(KEYLARGO_FCR5);	/* Save state & config of DBDMA channels */	dbdma_save(macio, save_dbdma);	/*	 * Turn off as much as we can	 */	if (macio->type == macio_pangea)		pangea_shutdown(macio, 1);	else if (macio->type == macio_intrepid)		intrepid_shutdown(macio, 1);	else if (macio->type == macio_keylargo)		keylargo_shutdown(macio, 1);	/*	 * Put the host bridge to sleep	 */	save_unin_clock_ctl = UN_IN(UNI_N_CLOCK_CNTL);	/* Note: do not switch GMAC off, driver does it when necessary, WOL must keep it	 * enabled !	 */	UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl &	       ~(/*UNI_N_CLOCK_CNTL_GMAC|*/UNI_N_CLOCK_CNTL_FW/*|UNI_N_CLOCK_CNTL_PCI*/));	udelay(100);	UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING);	UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_SLEEP);	mdelay(10);	/*	 * FIXME: A bit of black magic with OpenPIC (don't ask me why)	 */	if (pmac_mb.model_id == PMAC_TYPE_SAWTOOTH) {		MACIO_BIS(0x506e0, 0x00400000);		MACIO_BIS(0x506e0, 0x80000000);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b20cc8aff258eea5a2339107605ebea949fa6ecf/pmac_feature.c/clean/arch/ppc/platforms/pmac_feature.c