 /* Set the direction of this bit to out. */ genconfig_shadow = ((genconfig_shadow & ~IO_MASK(R_GEN_CONFIG, g0dir)) | (IO_STATE(R_GEN_CONFIG, g0dir, out))); *R_GEN_CONFIG = genconfig_shadow; 
if (cris_io_interface_allocate_pins(if_gpio_grp_a, 'g', CONFIG_ETRAX_DS1302_RSTBIT, CONFIG_ETRAX_DS1302_RSTBIT)) { printk(KERN_WARNING "ds1302: Failed to get IO interface\n"); return -1; }  /* Set the direction of this bit to out. */ genconfig_shadow = ((genconfig_shadow & ~IO_MASK(R_GEN_CONFIG, g0dir)) | (IO_STATE(R_GEN_CONFIG, g0dir, out))); *R_GEN_CONFIG = genconfig_shadow; 
ds1302_init(void) {	i2c_init();	if (!ds1302_probe()) {#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT#if CONFIG_ETRAX_DS1302_RSTBIT == 27		/*		 * The only way to set g27 to output is to enable ATA.		 *		 * Make sure that R_GEN_CONFIG is setup correct.		 */    		genconfig_shadow = ((genconfig_shadow &				     ~IO_MASK(R_GEN_CONFIG, ata)) | 				   (IO_STATE(R_GEN_CONFIG, ata, select)));        		*R_GEN_CONFIG = genconfig_shadow;#elif CONFIG_ETRAX_DS1302_RSTBIT == 0				/* Set the direction of this bit to out. */		    		genconfig_shadow = ((genconfig_shadow &				     ~IO_MASK(R_GEN_CONFIG, g0dir)) | 				   (IO_STATE(R_GEN_CONFIG, g0dir, out)));        		*R_GEN_CONFIG = genconfig_shadow;#endif		if (!ds1302_probe()) {			printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);      			return -1;		}#else		printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);    		return -1;#endif  	}	/* Initialise trickle charger */	ds1302_writereg(RTC_TRICKLECHARGER,			RTC_TCR_PATTERN |(CONFIG_ETRAX_DS1302_TRICKLE_CHARGE & 0x0F));        /* Start clock by resetting CLOCK_HALT */	ds1302_writereg(RTC_SECONDS, (ds1302_readreg(RTC_SECONDS) & 0x7F));	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7e9204265b4ec6680fad9abc7a78b94087983916/ds1302.c/clean/arch/cris/arch-v10/drivers/ds1302.c