Lines Matching refs:RV3029_W_SEC
56 #define RV3029_W_SEC 0x08 macro
84 ret = dm_i2c_read(dev, RV3029_W_SEC, regs, sizeof(regs)); in rv3029_rtc_get()
90 tm->tm_sec = bcd2bin(regs[RV3029_W_SEC - RV3029_W_SEC]); in rv3029_rtc_get()
91 tm->tm_min = bcd2bin(regs[RV3029_W_MINUTES - RV3029_W_SEC]); in rv3029_rtc_get()
95 const u8 _hr = regs[RV3029_W_HOURS - RV3029_W_SEC]; in rv3029_rtc_get()
108 tm->tm_mday = bcd2bin(regs[RV3029_W_DATE - RV3029_W_SEC]); in rv3029_rtc_get()
109 tm->tm_mon = bcd2bin(regs[RV3029_W_MONTHS - RV3029_W_SEC]) - 1; in rv3029_rtc_get()
111 tm->tm_year = bcd2bin(regs[RV3029_W_YEARS - RV3029_W_SEC]) + 2000; in rv3029_rtc_get()
112 tm->tm_wday = bcd2bin(regs[RV3029_W_DAYS - RV3029_W_SEC]) - 1; in rv3029_rtc_get()
139 regs[RV3029_W_SEC - RV3029_W_SEC] = bin2bcd(tm->tm_sec); in rv3029_rtc_set()
140 regs[RV3029_W_MINUTES - RV3029_W_SEC] = bin2bcd(tm->tm_min); in rv3029_rtc_set()
141 regs[RV3029_W_HOURS - RV3029_W_SEC] = bin2bcd(tm->tm_hour); in rv3029_rtc_set()
142 regs[RV3029_W_DATE - RV3029_W_SEC] = bin2bcd(tm->tm_mday); in rv3029_rtc_set()
143 regs[RV3029_W_MONTHS - RV3029_W_SEC] = bin2bcd(tm->tm_mon + 1); in rv3029_rtc_set()
144 regs[RV3029_W_DAYS - RV3029_W_SEC] = bin2bcd(tm->tm_wday + 1) & 0x7; in rv3029_rtc_set()
145 regs[RV3029_W_YEARS - RV3029_W_SEC] = bin2bcd(tm->tm_year - 2000); in rv3029_rtc_set()
147 return dm_i2c_write(dev, RV3029_W_SEC, regs, sizeof(regs)); in rv3029_rtc_set()