Lines Matching refs:RV3029_W_SEC
57 #define RV3029_W_SEC 0x08 macro
319 ret = regmap_bulk_read(rv3029->regmap, RV3029_W_SEC, regs, in rv3029_read_time()
324 tm->tm_sec = bcd2bin(regs[RV3029_W_SEC - RV3029_W_SEC]); in rv3029_read_time()
325 tm->tm_min = bcd2bin(regs[RV3029_W_MINUTES - RV3029_W_SEC]); in rv3029_read_time()
329 const u8 _hr = regs[RV3029_W_HOURS - RV3029_W_SEC]; in rv3029_read_time()
340 tm->tm_mday = bcd2bin(regs[RV3029_W_DATE - RV3029_W_SEC]); in rv3029_read_time()
341 tm->tm_mon = bcd2bin(regs[RV3029_W_MONTHS - RV3029_W_SEC]) - 1; in rv3029_read_time()
342 tm->tm_year = bcd2bin(regs[RV3029_W_YEARS - RV3029_W_SEC]) + 100; in rv3029_read_time()
343 tm->tm_wday = bcd2bin(regs[RV3029_W_DAYS - RV3029_W_SEC]) - 1; in rv3029_read_time()
428 regs[RV3029_W_SEC - RV3029_W_SEC] = bin2bcd(tm->tm_sec); in rv3029_set_time()
429 regs[RV3029_W_MINUTES - RV3029_W_SEC] = bin2bcd(tm->tm_min); in rv3029_set_time()
430 regs[RV3029_W_HOURS - RV3029_W_SEC] = bin2bcd(tm->tm_hour); in rv3029_set_time()
431 regs[RV3029_W_DATE - RV3029_W_SEC] = bin2bcd(tm->tm_mday); in rv3029_set_time()
432 regs[RV3029_W_MONTHS - RV3029_W_SEC] = bin2bcd(tm->tm_mon + 1); in rv3029_set_time()
433 regs[RV3029_W_DAYS - RV3029_W_SEC] = bin2bcd(tm->tm_wday + 1) & 0x7; in rv3029_set_time()
434 regs[RV3029_W_YEARS - RV3029_W_SEC] = bin2bcd(tm->tm_year - 100); in rv3029_set_time()
436 ret = regmap_bulk_write(rv3029->regmap, RV3029_W_SEC, regs, in rv3029_set_time()