Lines Matching full:time

15 static int sandbox_rtc_get(struct udevice *dev, struct rtc_time *time)  in sandbox_rtc_get()  argument
17 time->tm_sec = dm_i2c_reg_read(dev, REG_SEC); in sandbox_rtc_get()
18 if (time->tm_sec < 0) in sandbox_rtc_get()
19 return time->tm_sec; in sandbox_rtc_get()
20 time->tm_min = dm_i2c_reg_read(dev, REG_MIN); in sandbox_rtc_get()
21 if (time->tm_min < 0) in sandbox_rtc_get()
22 return time->tm_min; in sandbox_rtc_get()
23 time->tm_hour = dm_i2c_reg_read(dev, REG_HOUR); in sandbox_rtc_get()
24 if (time->tm_hour < 0) in sandbox_rtc_get()
25 return time->tm_hour; in sandbox_rtc_get()
26 time->tm_mday = dm_i2c_reg_read(dev, REG_MDAY); in sandbox_rtc_get()
27 if (time->tm_mday < 0) in sandbox_rtc_get()
28 return time->tm_mday; in sandbox_rtc_get()
29 time->tm_mon = dm_i2c_reg_read(dev, REG_MON); in sandbox_rtc_get()
30 if (time->tm_mon < 0) in sandbox_rtc_get()
31 return time->tm_mon; in sandbox_rtc_get()
32 time->tm_year = dm_i2c_reg_read(dev, REG_YEAR); in sandbox_rtc_get()
33 if (time->tm_year < 0) in sandbox_rtc_get()
34 return time->tm_year; in sandbox_rtc_get()
35 time->tm_year += 1900; in sandbox_rtc_get()
36 time->tm_wday = dm_i2c_reg_read(dev, REG_WDAY); in sandbox_rtc_get()
37 if (time->tm_wday < 0) in sandbox_rtc_get()
38 return time->tm_wday; in sandbox_rtc_get()
43 static int sandbox_rtc_set(struct udevice *dev, const struct rtc_time *time) in sandbox_rtc_set() argument
47 ret = dm_i2c_reg_write(dev, REG_SEC, time->tm_sec); in sandbox_rtc_set()
50 ret = dm_i2c_reg_write(dev, REG_MIN, time->tm_min); in sandbox_rtc_set()
53 ret = dm_i2c_reg_write(dev, REG_HOUR, time->tm_hour); in sandbox_rtc_set()
56 ret = dm_i2c_reg_write(dev, REG_MDAY, time->tm_mday); in sandbox_rtc_set()
59 ret = dm_i2c_reg_write(dev, REG_MON, time->tm_mon); in sandbox_rtc_set()
62 ret = dm_i2c_reg_write(dev, REG_YEAR, time->tm_year - 1900); in sandbox_rtc_set()
65 ret = dm_i2c_reg_write(dev, REG_WDAY, time->tm_wday); in sandbox_rtc_set()