Lines Matching full:time

16 static int sandbox_rtc_get(struct udevice *dev, struct rtc_time *time)  in sandbox_rtc_get()  argument
18 time->tm_sec = dm_i2c_reg_read(dev, REG_SEC); in sandbox_rtc_get()
19 if (time->tm_sec < 0) in sandbox_rtc_get()
20 return time->tm_sec; in sandbox_rtc_get()
21 time->tm_min = dm_i2c_reg_read(dev, REG_MIN); in sandbox_rtc_get()
22 if (time->tm_min < 0) in sandbox_rtc_get()
23 return time->tm_min; in sandbox_rtc_get()
24 time->tm_hour = dm_i2c_reg_read(dev, REG_HOUR); in sandbox_rtc_get()
25 if (time->tm_hour < 0) in sandbox_rtc_get()
26 return time->tm_hour; in sandbox_rtc_get()
27 time->tm_mday = dm_i2c_reg_read(dev, REG_MDAY); in sandbox_rtc_get()
28 if (time->tm_mday < 0) in sandbox_rtc_get()
29 return time->tm_mday; in sandbox_rtc_get()
30 time->tm_mon = dm_i2c_reg_read(dev, REG_MON); in sandbox_rtc_get()
31 if (time->tm_mon < 0) in sandbox_rtc_get()
32 return time->tm_mon; in sandbox_rtc_get()
33 time->tm_year = dm_i2c_reg_read(dev, REG_YEAR); in sandbox_rtc_get()
34 if (time->tm_year < 0) in sandbox_rtc_get()
35 return time->tm_year; in sandbox_rtc_get()
36 time->tm_year += 1900; in sandbox_rtc_get()
37 time->tm_wday = dm_i2c_reg_read(dev, REG_WDAY); in sandbox_rtc_get()
38 if (time->tm_wday < 0) in sandbox_rtc_get()
39 return time->tm_wday; in sandbox_rtc_get()
44 static int sandbox_rtc_set(struct udevice *dev, const struct rtc_time *time) in sandbox_rtc_set() argument
48 ret = dm_i2c_reg_write(dev, REG_SEC, time->tm_sec); in sandbox_rtc_set()
51 ret = dm_i2c_reg_write(dev, REG_MIN, time->tm_min); in sandbox_rtc_set()
54 ret = dm_i2c_reg_write(dev, REG_HOUR, time->tm_hour); in sandbox_rtc_set()
57 ret = dm_i2c_reg_write(dev, REG_MDAY, time->tm_mday); in sandbox_rtc_set()
60 ret = dm_i2c_reg_write(dev, REG_MON, time->tm_mon); in sandbox_rtc_set()
63 ret = dm_i2c_reg_write(dev, REG_YEAR, time->tm_year - 1900); in sandbox_rtc_set()
66 ret = dm_i2c_reg_write(dev, REG_WDAY, time->tm_wday); in sandbox_rtc_set()