Home
last modified time | relevance | path

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

/drivers/char/
Dds1302.c119 get_rtc_time(struct rtc_time *rtc_tm) in get_rtc_time() argument
125 rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); in get_rtc_time()
126 rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); in get_rtc_time()
127 rtc_tm->tm_hour = CMOS_READ(RTC_HOURS); in get_rtc_time()
128 rtc_tm->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH); in get_rtc_time()
129 rtc_tm->tm_mon = CMOS_READ(RTC_MONTH); in get_rtc_time()
130 rtc_tm->tm_year = CMOS_READ(RTC_YEAR); in get_rtc_time()
134 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); in get_rtc_time()
135 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); in get_rtc_time()
136 rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); in get_rtc_time()
[all …]
Drtc.c147 static void rtc_get_rtc_time(struct rtc_time *rtc_tm);
548 struct rtc_time rtc_tm; in rtc_do_ioctl() local
559 if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg, in rtc_do_ioctl()
563 yrs = rtc_tm.tm_year + 1900; in rtc_do_ioctl()
564 mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ in rtc_do_ioctl()
565 day = rtc_tm.tm_mday; in rtc_do_ioctl()
566 hrs = rtc_tm.tm_hour; in rtc_do_ioctl()
567 min = rtc_tm.tm_min; in rtc_do_ioctl()
568 sec = rtc_tm.tm_sec; in rtc_do_ioctl()
1294 static void rtc_get_rtc_time(struct rtc_time *rtc_tm) in rtc_get_rtc_time() argument
[all …]
/drivers/rtc/
Drtc-ds1511.c183 static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ds1511_rtc_set_time() argument
191 if (rtc_tm->tm_year < 1900) in ds1511_rtc_set_time()
192 rtc_tm->tm_year += 1900; in ds1511_rtc_set_time()
194 if (rtc_tm->tm_year < 1970) in ds1511_rtc_set_time()
197 yrs = rtc_tm->tm_year % 100; in ds1511_rtc_set_time()
198 cen = rtc_tm->tm_year / 100; in ds1511_rtc_set_time()
199 mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ in ds1511_rtc_set_time()
200 day = rtc_tm->tm_mday; in ds1511_rtc_set_time()
201 dow = rtc_tm->tm_wday & 0x7; /* automatic BCD */ in ds1511_rtc_set_time()
202 hrs = rtc_tm->tm_hour; in ds1511_rtc_set_time()
[all …]
Drtc-da9052.c61 static int da9052_read_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) in da9052_read_alarm() argument
83 rtc_tm->tm_year = (v[0][4] & DA9052_RTC_YEAR) + 100; in da9052_read_alarm()
84 rtc_tm->tm_mon = (v[0][3] & DA9052_RTC_MONTH) - 1; in da9052_read_alarm()
85 rtc_tm->tm_mday = v[0][2] & DA9052_RTC_DAY; in da9052_read_alarm()
86 rtc_tm->tm_hour = v[0][1] & DA9052_RTC_HOUR; in da9052_read_alarm()
87 rtc_tm->tm_min = v[0][0] & DA9052_RTC_MIN; in da9052_read_alarm()
88 rtc_tm->tm_sec = 0; in da9052_read_alarm()
90 ret = rtc_valid_tm(rtc_tm); in da9052_read_alarm()
104 static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) in da9052_set_alarm() argument
111 ret = rtc_tm_to_time(rtc_tm, &alm_time); in da9052_set_alarm()
[all …]
Drtc-pic32.c140 static int pic32_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in pic32_rtc_gettime() argument
149 rtc_tm->tm_hour = readb(base + PIC32_RTCHOUR); in pic32_rtc_gettime()
150 rtc_tm->tm_min = readb(base + PIC32_RTCMIN); in pic32_rtc_gettime()
151 rtc_tm->tm_mon = readb(base + PIC32_RTCMON); in pic32_rtc_gettime()
152 rtc_tm->tm_mday = readb(base + PIC32_RTCDAY); in pic32_rtc_gettime()
153 rtc_tm->tm_year = readb(base + PIC32_RTCYEAR); in pic32_rtc_gettime()
154 rtc_tm->tm_sec = readb(base + PIC32_RTCSEC); in pic32_rtc_gettime()
162 } while (rtc_tm->tm_sec == 0 && tries < 2); in pic32_rtc_gettime()
164 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); in pic32_rtc_gettime()
165 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); in pic32_rtc_gettime()
[all …]
Drtc-da9055.c61 static int da9055_read_alarm(struct da9055 *da9055, struct rtc_time *rtc_tm) in da9055_read_alarm() argument
72 rtc_tm->tm_year = (v[4] & DA9055_RTC_ALM_YEAR) + 100; in da9055_read_alarm()
73 rtc_tm->tm_mon = (v[3] & DA9055_RTC_ALM_MONTH) - 1; in da9055_read_alarm()
74 rtc_tm->tm_mday = v[2] & DA9055_RTC_ALM_DAY; in da9055_read_alarm()
75 rtc_tm->tm_hour = v[1] & DA9055_RTC_ALM_HOUR; in da9055_read_alarm()
76 rtc_tm->tm_min = v[0] & DA9055_RTC_ALM_MIN; in da9055_read_alarm()
77 rtc_tm->tm_sec = 0; in da9055_read_alarm()
79 return rtc_valid_tm(rtc_tm); in da9055_read_alarm()
82 static int da9055_set_alarm(struct da9055 *da9055, struct rtc_time *rtc_tm) in da9055_set_alarm() argument
87 rtc_tm->tm_year -= 100; in da9055_set_alarm()
[all …]
Drtc-s3c.c190 static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in s3c_rtc_gettime() argument
201 rtc_tm->tm_min = readb(info->base + S3C2410_RTCMIN); in s3c_rtc_gettime()
202 rtc_tm->tm_hour = readb(info->base + S3C2410_RTCHOUR); in s3c_rtc_gettime()
203 rtc_tm->tm_mday = readb(info->base + S3C2410_RTCDATE); in s3c_rtc_gettime()
204 rtc_tm->tm_mon = readb(info->base + S3C2410_RTCMON); in s3c_rtc_gettime()
205 rtc_tm->tm_year = readb(info->base + S3C2410_RTCYEAR); in s3c_rtc_gettime()
206 rtc_tm->tm_sec = readb(info->base + S3C2410_RTCSEC); in s3c_rtc_gettime()
213 if (rtc_tm->tm_sec == 0 && !have_retried) { in s3c_rtc_gettime()
218 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); in s3c_rtc_gettime()
219 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); in s3c_rtc_gettime()
[all …]
Drtc-sunxi.c233 static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sunxi_rtc_gettime() argument
247 rtc_tm->tm_sec = SUNXI_TIME_GET_SEC_VALUE(time); in sunxi_rtc_gettime()
248 rtc_tm->tm_min = SUNXI_TIME_GET_MIN_VALUE(time); in sunxi_rtc_gettime()
249 rtc_tm->tm_hour = SUNXI_TIME_GET_HOUR_VALUE(time); in sunxi_rtc_gettime()
251 rtc_tm->tm_mday = SUNXI_DATE_GET_DAY_VALUE(date); in sunxi_rtc_gettime()
252 rtc_tm->tm_mon = SUNXI_DATE_GET_MON_VALUE(date); in sunxi_rtc_gettime()
253 rtc_tm->tm_year = SUNXI_DATE_GET_YEAR_VALUE(date, in sunxi_rtc_gettime()
256 rtc_tm->tm_mon -= 1; in sunxi_rtc_gettime()
262 rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year); in sunxi_rtc_gettime()
264 return rtc_valid_tm(rtc_tm); in sunxi_rtc_gettime()
[all …]
Drtc-sun6i.c320 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_gettime() argument
334 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time); in sun6i_rtc_gettime()
335 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time); in sun6i_rtc_gettime()
336 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time); in sun6i_rtc_gettime()
338 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date); in sun6i_rtc_gettime()
339 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date); in sun6i_rtc_gettime()
340 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date); in sun6i_rtc_gettime()
342 rtc_tm->tm_mon -= 1; in sun6i_rtc_gettime()
348 rtc_tm->tm_year += SUN6I_YEAR_OFF; in sun6i_rtc_gettime()
350 return rtc_valid_tm(rtc_tm); in sun6i_rtc_gettime()
[all …]
Drtc-ac100.c370 static int ac100_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_get_time() argument
381 rtc_tm->tm_sec = bcd2bin(reg[0] & AC100_RTC_SEC_MASK); in ac100_rtc_get_time()
382 rtc_tm->tm_min = bcd2bin(reg[1] & AC100_RTC_MIN_MASK); in ac100_rtc_get_time()
383 rtc_tm->tm_hour = bcd2bin(reg[2] & AC100_RTC_HOU_MASK); in ac100_rtc_get_time()
384 rtc_tm->tm_wday = bcd2bin(reg[3] & AC100_RTC_WEE_MASK); in ac100_rtc_get_time()
385 rtc_tm->tm_mday = bcd2bin(reg[4] & AC100_RTC_DAY_MASK); in ac100_rtc_get_time()
386 rtc_tm->tm_mon = bcd2bin(reg[5] & AC100_RTC_MON_MASK) - 1; in ac100_rtc_get_time()
387 rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) + in ac100_rtc_get_time()
390 return rtc_valid_tm(rtc_tm); in ac100_rtc_get_time()
393 static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_set_time() argument
[all …]
Drtc-ab-b5ze-s3.c329 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_timer() local
350 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_read_timer()
355 ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); in _abb5zes3_rtc_read_timer()
385 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_alarm() local
410 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_read_alarm()
414 alarm_tm->tm_year = rtc_tm.tm_year; in _abb5zes3_rtc_read_alarm()
415 alarm_tm->tm_mon = rtc_tm.tm_mon; in _abb5zes3_rtc_read_alarm()
417 ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); in _abb5zes3_rtc_read_alarm()
482 struct rtc_time rtc_tm; in _abb5zes3_rtc_set_alarm() local
485 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_set_alarm()
[all …]
Drtc-puv3.c89 static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in puv3_rtc_gettime() argument
91 rtc_time_to_tm(readl(RTC_RCNR), rtc_tm); in puv3_rtc_gettime()
94 rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday, in puv3_rtc_gettime()
95 rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec); in puv3_rtc_gettime()
Drtc-stmp3xxx.c154 static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_gettime() argument
163 rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); in stmp3xxx_rtc_gettime()
Drtc-isl1208.c371 struct rtc_time rtc_tm; in isl1208_i2c_set_alarm() local
374 err = isl1208_i2c_read_time(client, &rtc_tm); in isl1208_i2c_set_alarm()
379 if (!alarm->enabled || rtc_tm_sub(alarm_tm, &rtc_tm) <= 0) in isl1208_i2c_set_alarm()