spin_unlock_irqrestore(&rtc_lock, flags); 
int xicor_set_time(unsigned long t){	struct rtc_time tm;	int tmp;	to_tm(t, &tm);	/* unlock writes to the CCR */	xicor_write(X1241REG_SR, X1241REG_SR_WEL);	xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL);	/* trivial ones */	tm.tm_sec = BIN2BCD(tm.tm_sec);	xicor_write(X1241REG_SC, tm.tm_sec);	tm.tm_min = BIN2BCD(tm.tm_min);	xicor_write(X1241REG_MN, tm.tm_min);	tm.tm_mday = BIN2BCD(tm.tm_mday);	xicor_write(X1241REG_DT, tm.tm_mday);	/* tm_mon starts from 0, *ick* */	tm.tm_mon ++;	tm.tm_mon = BIN2BCD(tm.tm_mon);	xicor_write(X1241REG_MO, tm.tm_mon);	/* year is split */	tmp = tm.tm_year / 100;	tm.tm_year %= 100;	xicor_write(X1241REG_YR, tm.tm_year);	xicor_write(X1241REG_Y2K, tmp);	/* hour is the most tricky one */	tmp = xicor_read(X1241REG_HR);	if (tmp & X1241REG_HR_MIL) {		/* 24 hour format */		tm.tm_hour = BIN2BCD(tm.tm_hour);		tmp = (tmp & ~0x3f) | (tm.tm_hour & 0x3f);	} else {		/* 12 hour format, with 0x2 for pm */		tmp = tmp & ~0x3f;		if (tm.tm_hour >= 12) {			tmp |= 0x20;			tm.tm_hour -= 12;		}		tm.tm_hour = BIN2BCD(tm.tm_hour);		tmp |= tm.tm_hour;	}	xicor_write(X1241REG_HR, tmp);	xicor_write(X1241REG_SR, 0);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/53c2df2f4ebbc1d8231ca7cc13ac5381230888b1/rtc_xicor1241.c/buggy/arch/mips/sibyte/swarm/rtc_xicor1241.c