Home
last modified time | relevance | path

Searched refs:rtc_tm (Results 1 – 11 of 11) sorted by relevance

/drivers/rtc/
Drtc-ds1511.c180 static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ds1511_rtc_set_time() argument
188 if (rtc_tm->tm_year < 1900) in ds1511_rtc_set_time()
189 rtc_tm->tm_year += 1900; in ds1511_rtc_set_time()
191 if (rtc_tm->tm_year < 1970) in ds1511_rtc_set_time()
194 yrs = rtc_tm->tm_year % 100; in ds1511_rtc_set_time()
195 cen = rtc_tm->tm_year / 100; in ds1511_rtc_set_time()
196 mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ in ds1511_rtc_set_time()
197 day = rtc_tm->tm_mday; in ds1511_rtc_set_time()
198 dow = rtc_tm->tm_wday & 0x7; /* automatic BCD */ in ds1511_rtc_set_time()
199 hrs = rtc_tm->tm_hour; in ds1511_rtc_set_time()
[all …]
Drtc-da9052.c56 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()
[all …]
Drtc-da9055.c56 static int da9055_read_alarm(struct da9055 *da9055, struct rtc_time *rtc_tm) in da9055_read_alarm() argument
67 rtc_tm->tm_year = (v[4] & DA9055_RTC_ALM_YEAR) + 100; in da9055_read_alarm()
68 rtc_tm->tm_mon = (v[3] & DA9055_RTC_ALM_MONTH) - 1; in da9055_read_alarm()
69 rtc_tm->tm_mday = v[2] & DA9055_RTC_ALM_DAY; in da9055_read_alarm()
70 rtc_tm->tm_hour = v[1] & DA9055_RTC_ALM_HOUR; in da9055_read_alarm()
71 rtc_tm->tm_min = v[0] & DA9055_RTC_ALM_MIN; in da9055_read_alarm()
72 rtc_tm->tm_sec = 0; in da9055_read_alarm()
74 return rtc_valid_tm(rtc_tm); in da9055_read_alarm()
77 static int da9055_set_alarm(struct da9055 *da9055, struct rtc_time *rtc_tm) in da9055_set_alarm() argument
82 rtc_tm->tm_year -= 100; in da9055_set_alarm()
[all …]
Drtc-pic32.c132 static int pic32_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in pic32_rtc_gettime() argument
141 rtc_tm->tm_hour = readb(base + PIC32_RTCHOUR); in pic32_rtc_gettime()
142 rtc_tm->tm_min = readb(base + PIC32_RTCMIN); in pic32_rtc_gettime()
143 rtc_tm->tm_mon = readb(base + PIC32_RTCMON); in pic32_rtc_gettime()
144 rtc_tm->tm_mday = readb(base + PIC32_RTCDAY); in pic32_rtc_gettime()
145 rtc_tm->tm_year = readb(base + PIC32_RTCYEAR); in pic32_rtc_gettime()
146 rtc_tm->tm_sec = readb(base + PIC32_RTCSEC); in pic32_rtc_gettime()
154 } while (rtc_tm->tm_sec == 0 && tries < 2); in pic32_rtc_gettime()
156 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); in pic32_rtc_gettime()
157 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); in pic32_rtc_gettime()
[all …]
Drtc-sunxi.c220 static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sunxi_rtc_gettime() argument
234 rtc_tm->tm_sec = SUNXI_TIME_GET_SEC_VALUE(time); in sunxi_rtc_gettime()
235 rtc_tm->tm_min = SUNXI_TIME_GET_MIN_VALUE(time); in sunxi_rtc_gettime()
236 rtc_tm->tm_hour = SUNXI_TIME_GET_HOUR_VALUE(time); in sunxi_rtc_gettime()
238 rtc_tm->tm_mday = SUNXI_DATE_GET_DAY_VALUE(date); in sunxi_rtc_gettime()
239 rtc_tm->tm_mon = SUNXI_DATE_GET_MON_VALUE(date); in sunxi_rtc_gettime()
240 rtc_tm->tm_year = SUNXI_DATE_GET_YEAR_VALUE(date, in sunxi_rtc_gettime()
243 rtc_tm->tm_mon -= 1; in sunxi_rtc_gettime()
249 rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year); in sunxi_rtc_gettime()
328 static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sunxi_rtc_settime() argument
[all …]
Drtc-s3c.c174 static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in s3c_rtc_gettime() argument
185 rtc_tm->tm_min = readb(info->base + S3C2410_RTCMIN); in s3c_rtc_gettime()
186 rtc_tm->tm_hour = readb(info->base + S3C2410_RTCHOUR); in s3c_rtc_gettime()
187 rtc_tm->tm_mday = readb(info->base + S3C2410_RTCDATE); in s3c_rtc_gettime()
188 rtc_tm->tm_mon = readb(info->base + S3C2410_RTCMON); in s3c_rtc_gettime()
189 rtc_tm->tm_year = readb(info->base + S3C2410_RTCYEAR); in s3c_rtc_gettime()
190 rtc_tm->tm_sec = readb(info->base + S3C2410_RTCSEC); in s3c_rtc_gettime()
197 if (rtc_tm->tm_sec == 0 && !have_retried) { in s3c_rtc_gettime()
202 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); in s3c_rtc_gettime()
203 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); in s3c_rtc_gettime()
[all …]
Drtc-sun6i.c448 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_gettime() argument
462 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time); in sun6i_rtc_gettime()
463 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time); in sun6i_rtc_gettime()
464 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time); in sun6i_rtc_gettime()
466 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date); in sun6i_rtc_gettime()
467 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date); in sun6i_rtc_gettime()
468 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date); in sun6i_rtc_gettime()
470 rtc_tm->tm_mon -= 1; in sun6i_rtc_gettime()
476 rtc_tm->tm_year += SUN6I_YEAR_OFF; in sun6i_rtc_gettime()
556 static int sun6i_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_settime() argument
[all …]
Drtc-ac100.c384 static int ac100_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_get_time() argument
395 rtc_tm->tm_sec = bcd2bin(reg[0] & AC100_RTC_SEC_MASK); in ac100_rtc_get_time()
396 rtc_tm->tm_min = bcd2bin(reg[1] & AC100_RTC_MIN_MASK); in ac100_rtc_get_time()
397 rtc_tm->tm_hour = bcd2bin(reg[2] & AC100_RTC_HOU_MASK); in ac100_rtc_get_time()
398 rtc_tm->tm_wday = bcd2bin(reg[3] & AC100_RTC_WEE_MASK); in ac100_rtc_get_time()
399 rtc_tm->tm_mday = bcd2bin(reg[4] & AC100_RTC_DAY_MASK); in ac100_rtc_get_time()
400 rtc_tm->tm_mon = bcd2bin(reg[5] & AC100_RTC_MON_MASK) - 1; in ac100_rtc_get_time()
401 rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) + in ac100_rtc_get_time()
407 static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_set_time() argument
415 year = rtc_tm->tm_year - AC100_YEAR_OFF; in ac100_rtc_set_time()
[all …]
Drtc-ab-b5ze-s3.c301 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_timer() local
322 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_read_timer()
327 rtc_secs = rtc_tm_to_time64(&rtc_tm); in _abb5zes3_rtc_read_timer()
354 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_alarm() local
379 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_read_alarm()
383 alarm_tm->tm_year = rtc_tm.tm_year; in _abb5zes3_rtc_read_alarm()
384 alarm_tm->tm_mon = rtc_tm.tm_mon; in _abb5zes3_rtc_read_alarm()
386 rtc_secs = rtc_tm_to_time64(&rtc_tm); in _abb5zes3_rtc_read_alarm()
442 struct rtc_time rtc_tm; in _abb5zes3_rtc_set_alarm() local
456 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_set_alarm()
[all …]
Drtc-stmp3xxx.c146 static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_gettime() argument
155 rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); in stmp3xxx_rtc_gettime()
159 static int stmp3xxx_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_settime() argument
163 writel(rtc_tm_to_time64(rtc_tm), rtc_data->io + STMP3XXX_RTC_SECONDS); in stmp3xxx_rtc_settime()
Drtc-isl1208.c399 struct rtc_time rtc_tm; in isl1208_i2c_set_alarm() local
402 err = isl1208_i2c_read_time(client, &rtc_tm); in isl1208_i2c_set_alarm()
407 if (!alarm->enabled || rtc_tm_sub(alarm_tm, &rtc_tm) <= 0) in isl1208_i2c_set_alarm()