Lines Matching refs:time
88 static int sandbox_i2c_rtc_get(struct udevice *dev, struct rtc_time *time) in sandbox_i2c_rtc_get() argument
101 rtc_to_tm(now + plat->offset, time); in sandbox_i2c_rtc_get()
106 static int sandbox_i2c_rtc_set(struct udevice *dev, const struct rtc_time *time) in sandbox_i2c_rtc_set() argument
118 plat->offset = rtc_mktime(time) - now; in sandbox_i2c_rtc_set()
128 struct rtc_time time; in sandbox_i2c_rtc_prepare_read() local
131 ret = sandbox_i2c_rtc_get(emul, &time); in sandbox_i2c_rtc_prepare_read()
135 plat->reg[REG_SEC] = time.tm_sec; in sandbox_i2c_rtc_prepare_read()
136 plat->reg[REG_MIN] = time.tm_min; in sandbox_i2c_rtc_prepare_read()
137 plat->reg[REG_HOUR] = time.tm_hour; in sandbox_i2c_rtc_prepare_read()
138 plat->reg[REG_MDAY] = time.tm_mday; in sandbox_i2c_rtc_prepare_read()
139 plat->reg[REG_MON] = time.tm_mon; in sandbox_i2c_rtc_prepare_read()
140 plat->reg[REG_YEAR] = time.tm_year - 1900; in sandbox_i2c_rtc_prepare_read()
141 plat->reg[REG_WDAY] = time.tm_wday; in sandbox_i2c_rtc_prepare_read()
149 struct rtc_time time; in sandbox_i2c_rtc_complete_write() local
152 time.tm_sec = plat->reg[REG_SEC]; in sandbox_i2c_rtc_complete_write()
153 time.tm_min = plat->reg[REG_MIN]; in sandbox_i2c_rtc_complete_write()
154 time.tm_hour = plat->reg[REG_HOUR]; in sandbox_i2c_rtc_complete_write()
155 time.tm_mday = plat->reg[REG_MDAY]; in sandbox_i2c_rtc_complete_write()
156 time.tm_mon = plat->reg[REG_MON]; in sandbox_i2c_rtc_complete_write()
157 time.tm_year = plat->reg[REG_YEAR] + 1900; in sandbox_i2c_rtc_complete_write()
158 time.tm_wday = plat->reg[REG_WDAY]; in sandbox_i2c_rtc_complete_write()
160 ret = sandbox_i2c_rtc_set(emul, &time); in sandbox_i2c_rtc_complete_write()