Lines Matching refs:tmp
66 int rtc_get(struct rtc_time *tmp) in rtc_get() argument
92 tmp->tm_sec = bcd2bin(sec & 0x7F); in rtc_get()
93 tmp->tm_min = bcd2bin(min & 0x7F); in rtc_get()
94 tmp->tm_hour = bcd2bin(hour & 0x3F); in rtc_get()
95 tmp->tm_mday = bcd2bin(mday & 0x3F); in rtc_get()
96 tmp->tm_mon = bcd2bin(mon & 0x1F); in rtc_get()
97 tmp->tm_year = bcd2bin(year) + 2000; in rtc_get()
98 tmp->tm_wday = bcd2bin((wday - 1) & 0x07); in rtc_get()
99 tmp->tm_yday = 0; in rtc_get()
100 tmp->tm_isdst = 0; in rtc_get()
102 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_get()
103 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_get()
109 int rtc_set(struct rtc_time *tmp) in rtc_set() argument
112 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_set()
113 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_set()
115 rtc_write(RTC_YR_REG_ADDR, bin2bcd(tmp->tm_year % 100)); in rtc_set()
116 rtc_write(RTC_MON_REG_ADDR, bin2bcd(tmp->tm_mon)); in rtc_set()
117 rtc_write(RTC_DAY_REG_ADDR, bin2bcd(tmp->tm_wday + 1)); in rtc_set()
118 rtc_write(RTC_DATE_REG_ADDR, bin2bcd(tmp->tm_mday)); in rtc_set()
119 rtc_write(RTC_HR_REG_ADDR, bin2bcd(tmp->tm_hour)); in rtc_set()
120 rtc_write(RTC_MIN_REG_ADDR, bin2bcd(tmp->tm_min)); in rtc_set()
121 rtc_write(RTC_SEC_REG_ADDR, bin2bcd(tmp->tm_sec)); in rtc_set()
143 static int pt7c4338_rtc_get(struct udevice *dev, struct rtc_time *tmp) in pt7c4338_rtc_get() argument
171 tmp->tm_sec = bcd2bin(sec & 0x7F); in pt7c4338_rtc_get()
172 tmp->tm_min = bcd2bin(min & 0x7F); in pt7c4338_rtc_get()
173 tmp->tm_hour = bcd2bin(hour & 0x3F); in pt7c4338_rtc_get()
174 tmp->tm_mday = bcd2bin(mday & 0x3F); in pt7c4338_rtc_get()
175 tmp->tm_mon = bcd2bin(mon & 0x1F); in pt7c4338_rtc_get()
176 tmp->tm_year = bcd2bin(year) + 2000; in pt7c4338_rtc_get()
177 tmp->tm_wday = bcd2bin((wday - 1) & 0x07); in pt7c4338_rtc_get()
178 tmp->tm_yday = 0; in pt7c4338_rtc_get()
179 tmp->tm_isdst = 0; in pt7c4338_rtc_get()
181 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in pt7c4338_rtc_get()
182 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in pt7c4338_rtc_get()
187 static int pt7c4338_rtc_set(struct udevice *dev, const struct rtc_time *tmp) in pt7c4338_rtc_set() argument
190 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in pt7c4338_rtc_set()
191 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in pt7c4338_rtc_set()
193 rtc_write(dev, RTC_YR_REG_ADDR, bin2bcd(tmp->tm_year % 100)); in pt7c4338_rtc_set()
194 rtc_write(dev, RTC_MON_REG_ADDR, bin2bcd(tmp->tm_mon)); in pt7c4338_rtc_set()
195 rtc_write(dev, RTC_DAY_REG_ADDR, bin2bcd(tmp->tm_wday + 1)); in pt7c4338_rtc_set()
196 rtc_write(dev, RTC_DATE_REG_ADDR, bin2bcd(tmp->tm_mday)); in pt7c4338_rtc_set()
197 rtc_write(dev, RTC_HR_REG_ADDR, bin2bcd(tmp->tm_hour)); in pt7c4338_rtc_set()
198 rtc_write(dev, RTC_MIN_REG_ADDR, bin2bcd(tmp->tm_min)); in pt7c4338_rtc_set()
199 rtc_write(dev, RTC_SEC_REG_ADDR, bin2bcd(tmp->tm_sec)); in pt7c4338_rtc_set()