Lines Matching refs:val
55 static void ds1302_sendbits(unsigned int val) in ds1302_sendbits() argument
59 for (i = 8; (i); i--, val >>= 1) { in ds1302_sendbits()
60 set_dp((get_dp() & ~RTC_IODATA) | ((val & 0x1) ? RTC_IODATA : 0)); in ds1302_sendbits()
68 unsigned int val; in ds1302_recvbits() local
71 for (i = 0, val = 0; (i < 8); i++) { in ds1302_recvbits()
72 val |= (((get_dp() & RTC_IODATA) ? 1 : 0) << i); in ds1302_recvbits()
76 return(val); in ds1302_recvbits()
81 unsigned int val; in ds1302_readbyte() local
95 val = ds1302_recvbits(); in ds1302_readbyte()
99 return(val); in ds1302_readbyte()
102 static void ds1302_writebyte(unsigned int addr, unsigned int val) in ds1302_writebyte() argument
115 ds1302_sendbits(val); in ds1302_writebyte()
132 static inline int bcd2int(int val) in bcd2int() argument
134 return((((val & 0xf0) >> 4) * 10) + (val & 0xf)); in bcd2int()
137 static inline int int2bcd(int val) in int2bcd() argument
139 return(((val / 10) << 4) + (val % 10)); in int2bcd()
271 unsigned char val = 0; in secureedge5410_cmos_read() local
277 case RTC_SECONDS: val = ds1302_readbyte(RTC_ADDR_SEC); break; in secureedge5410_cmos_read()
279 case RTC_MINUTES: val = ds1302_readbyte(RTC_ADDR_MIN); break; in secureedge5410_cmos_read()
281 case RTC_HOURS: val = ds1302_readbyte(RTC_ADDR_HOUR); break; in secureedge5410_cmos_read()
283 case RTC_DAY_OF_WEEK: val = ds1302_readbyte(RTC_ADDR_DAY); break; in secureedge5410_cmos_read()
284 case RTC_DAY_OF_MONTH: val = ds1302_readbyte(RTC_ADDR_DATE); break; in secureedge5410_cmos_read()
285 case RTC_MONTH: val = ds1302_readbyte(RTC_ADDR_MON); break; in secureedge5410_cmos_read()
286 case RTC_YEAR: val = ds1302_readbyte(RTC_ADDR_YEAR); break; in secureedge5410_cmos_read()
290 case RTC_REG_D: val = RTC_VRT /* RTC_VALID */; break; in secureedge5410_cmos_read()
294 return(val); in secureedge5410_cmos_read()
297 void secureedge5410_cmos_write(unsigned char val, int addr) in secureedge5410_cmos_write() argument
300 __CMOS_WRITE(val, addr, w); in secureedge5410_cmos_write()
305 case RTC_SECONDS: ds1302_writebyte(RTC_ADDR_SEC, val); break; in secureedge5410_cmos_write()
307 case RTC_MINUTES: ds1302_writebyte(RTC_ADDR_MIN, val); break; in secureedge5410_cmos_write()
309 case RTC_HOURS: ds1302_writebyte(RTC_ADDR_HOUR, val); break; in secureedge5410_cmos_write()
311 case RTC_DAY_OF_WEEK: ds1302_writebyte(RTC_ADDR_DAY, val); break; in secureedge5410_cmos_write()
312 case RTC_DAY_OF_MONTH: ds1302_writebyte(RTC_ADDR_DATE, val); break; in secureedge5410_cmos_write()
313 case RTC_MONTH: ds1302_writebyte(RTC_ADDR_MON, val); break; in secureedge5410_cmos_write()
314 case RTC_YEAR: ds1302_writebyte(RTC_ADDR_YEAR, val); break; in secureedge5410_cmos_write()