Lines Matching refs:rtc_tm
56 static int da9052_read_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) in da9052_read_alarm() argument
78 rtc_tm->tm_year = (v[0][4] & DA9052_RTC_YEAR) + 100; in da9052_read_alarm()
79 rtc_tm->tm_mon = (v[0][3] & DA9052_RTC_MONTH) - 1; in da9052_read_alarm()
80 rtc_tm->tm_mday = v[0][2] & DA9052_RTC_DAY; in da9052_read_alarm()
81 rtc_tm->tm_hour = v[0][1] & DA9052_RTC_HOUR; in da9052_read_alarm()
82 rtc_tm->tm_min = v[0][0] & DA9052_RTC_MIN; in da9052_read_alarm()
83 rtc_tm->tm_sec = 0; in da9052_read_alarm()
85 ret = rtc_valid_tm(rtc_tm); in da9052_read_alarm()
99 static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) in da9052_set_alarm() argument
106 alm_time = rtc_tm_to_time64(rtc_tm); in da9052_set_alarm()
108 if (rtc_tm->tm_sec > 0) { in da9052_set_alarm()
109 alm_time += 60 - rtc_tm->tm_sec; in da9052_set_alarm()
110 rtc_time64_to_tm(alm_time, rtc_tm); in da9052_set_alarm()
112 BUG_ON(rtc_tm->tm_sec); /* it will cause repeated irqs if not zero */ in da9052_set_alarm()
114 rtc_tm->tm_year -= 100; in da9052_set_alarm()
115 rtc_tm->tm_mon += 1; in da9052_set_alarm()
118 DA9052_RTC_MIN, rtc_tm->tm_min); in da9052_set_alarm()
124 v[0] = rtc_tm->tm_hour; in da9052_set_alarm()
125 v[1] = rtc_tm->tm_mday; in da9052_set_alarm()
126 v[2] = rtc_tm->tm_mon; in da9052_set_alarm()
133 DA9052_RTC_YEAR, rtc_tm->tm_year); in da9052_set_alarm()
153 static int da9052_rtc_read_time(struct device *dev, struct rtc_time *rtc_tm) in da9052_rtc_read_time() argument
176 rtc_tm->tm_year = (v[0][5] & DA9052_RTC_YEAR) + 100; in da9052_rtc_read_time()
177 rtc_tm->tm_mon = (v[0][4] & DA9052_RTC_MONTH) - 1; in da9052_rtc_read_time()
178 rtc_tm->tm_mday = v[0][3] & DA9052_RTC_DAY; in da9052_rtc_read_time()
179 rtc_tm->tm_hour = v[0][2] & DA9052_RTC_HOUR; in da9052_rtc_read_time()
180 rtc_tm->tm_min = v[0][1] & DA9052_RTC_MIN; in da9052_rtc_read_time()
181 rtc_tm->tm_sec = v[0][0] & DA9052_RTC_SEC; in da9052_rtc_read_time()