Lines Matching refs:tmp
26 int rtc_get (struct rtc_time *tmp) in rtc_get() argument
54 tmp->tm_sec = bcd2bin (sec & 0x7F); in rtc_get()
55 tmp->tm_min = bcd2bin (min & 0x7F); in rtc_get()
56 tmp->tm_hour = bcd2bin (hour & 0x3F); in rtc_get()
57 tmp->tm_mday = bcd2bin (mday & 0x3F); in rtc_get()
58 tmp->tm_mon = bcd2bin (mon_cent & 0x1F); in rtc_get()
59 tmp->tm_year = bcd2bin (year) + ((mon_cent & 0x80) ? 1900 : 2000); in rtc_get()
60 tmp->tm_wday = bcd2bin (wday & 0x07); in rtc_get()
61 tmp->tm_yday = 0; in rtc_get()
62 tmp->tm_isdst= 0; in rtc_get()
65 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_get()
66 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_get()
71 int rtc_set (struct rtc_time *tmp) in rtc_set() argument
76 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_set()
77 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_set()
79 rtc_write (0x08, bin2bcd(tmp->tm_year % 100)); in rtc_set()
81 century = (tmp->tm_year >= 2000) ? 0 : 0x80; in rtc_set()
82 rtc_write (0x07, bin2bcd(tmp->tm_mon) | century); in rtc_set()
84 rtc_write (0x06, bin2bcd(tmp->tm_wday)); in rtc_set()
85 rtc_write (0x05, bin2bcd(tmp->tm_mday)); in rtc_set()
86 rtc_write (0x04, bin2bcd(tmp->tm_hour)); in rtc_set()
87 rtc_write (0x03, bin2bcd(tmp->tm_min )); in rtc_set()
88 rtc_write (0x02, bin2bcd(tmp->tm_sec )); in rtc_set()
122 static int pcf8563_rtc_get(struct udevice *dev, struct rtc_time *tmp) in pcf8563_rtc_get() argument
150 tmp->tm_sec = bcd2bin(sec & 0x7F); in pcf8563_rtc_get()
151 tmp->tm_min = bcd2bin(min & 0x7F); in pcf8563_rtc_get()
152 tmp->tm_hour = bcd2bin(hour & 0x3F); in pcf8563_rtc_get()
153 tmp->tm_mday = bcd2bin(mday & 0x3F); in pcf8563_rtc_get()
154 tmp->tm_mon = bcd2bin(mon_cent & 0x1F); in pcf8563_rtc_get()
155 tmp->tm_year = bcd2bin(year) + ((mon_cent & 0x80) ? 1900 : 2000); in pcf8563_rtc_get()
156 tmp->tm_wday = bcd2bin(wday & 0x07); in pcf8563_rtc_get()
157 tmp->tm_yday = 0; in pcf8563_rtc_get()
158 tmp->tm_isdst = 0; in pcf8563_rtc_get()
161 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in pcf8563_rtc_get()
162 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in pcf8563_rtc_get()
167 static int pcf8563_rtc_set(struct udevice *dev, const struct rtc_time *tmp) in pcf8563_rtc_set() argument
172 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in pcf8563_rtc_set()
173 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in pcf8563_rtc_set()
175 dm_i2c_reg_write(dev, 0x08, bin2bcd(tmp->tm_year % 100)); in pcf8563_rtc_set()
177 century = (tmp->tm_year >= 2000) ? 0 : 0x80; in pcf8563_rtc_set()
178 dm_i2c_reg_write(dev, 0x07, bin2bcd(tmp->tm_mon) | century); in pcf8563_rtc_set()
180 dm_i2c_reg_write(dev, 0x06, bin2bcd(tmp->tm_wday)); in pcf8563_rtc_set()
181 dm_i2c_reg_write(dev, 0x05, bin2bcd(tmp->tm_mday)); in pcf8563_rtc_set()
182 dm_i2c_reg_write(dev, 0x04, bin2bcd(tmp->tm_hour)); in pcf8563_rtc_set()
183 dm_i2c_reg_write(dev, 0x03, bin2bcd(tmp->tm_min)); in pcf8563_rtc_set()
184 dm_i2c_reg_write(dev, 0x02, bin2bcd(tmp->tm_sec)); in pcf8563_rtc_set()