Home
last modified time | relevance | path

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

/linux-6.1.9/drivers/rtc/
Drtc-ds1511.c174 static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ds1511_rtc_set_time() argument
182 if (rtc_tm->tm_year < 1900) in ds1511_rtc_set_time()
183 rtc_tm->tm_year += 1900; in ds1511_rtc_set_time()
185 if (rtc_tm->tm_year < 1970) in ds1511_rtc_set_time()
188 yrs = rtc_tm->tm_year % 100; in ds1511_rtc_set_time()
189 cen = rtc_tm->tm_year / 100; in ds1511_rtc_set_time()
190 mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ in ds1511_rtc_set_time()
191 day = rtc_tm->tm_mday; in ds1511_rtc_set_time()
192 dow = rtc_tm->tm_wday & 0x7; /* automatic BCD */ in ds1511_rtc_set_time()
193 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-sun6i.c467 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_gettime() argument
488 rtc_time64_to_tm((date & 0xffff) * SECS_PER_DAY, rtc_tm); in sun6i_rtc_gettime()
490 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date); in sun6i_rtc_gettime()
491 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date) - 1; in sun6i_rtc_gettime()
492 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date); in sun6i_rtc_gettime()
498 rtc_tm->tm_year += SUN6I_YEAR_OFF; in sun6i_rtc_gettime()
501 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time); in sun6i_rtc_gettime()
502 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time); in sun6i_rtc_gettime()
503 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time); in sun6i_rtc_gettime()
605 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.c148 static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_gettime() argument
157 rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); in stmp3xxx_rtc_gettime()
161 static int stmp3xxx_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_settime() argument
165 writel(rtc_tm_to_time64(rtc_tm), rtc_data->io + STMP3XXX_RTC_SECONDS); in stmp3xxx_rtc_settime()
Drtc-s3c.c211 struct rtc_time rtc_tm = *tm; in s3c_rtc_settime() local
219 rtc_tm.tm_year -= 100; in s3c_rtc_settime()
220 rtc_tm.tm_mon += 1; in s3c_rtc_settime()
222 return s3c_rtc_write_time(info, &rtc_tm); in s3c_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()
/linux-6.1.9/arch/powerpc/kernel/
Drtas-rtc.c47 void rtas_get_rtc_time(struct rtc_time *rtc_tm) in rtas_get_rtc_time() argument
61 memset(rtc_tm, 0, sizeof(struct rtc_time)); in rtas_get_rtc_time()
78 rtc_tm->tm_sec = ret[5]; in rtas_get_rtc_time()
79 rtc_tm->tm_min = ret[4]; in rtas_get_rtc_time()
80 rtc_tm->tm_hour = ret[3]; in rtas_get_rtc_time()
81 rtc_tm->tm_mday = ret[2]; in rtas_get_rtc_time()
82 rtc_tm->tm_mon = ret[1] - 1; in rtas_get_rtc_time()
83 rtc_tm->tm_year = ret[0] - 1900; in rtas_get_rtc_time()
/linux-6.1.9/arch/m68k/bvme6000/
Drtc.c73 struct rtc_time rtc_tm; in rtc_ioctl() local
80 if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) in rtc_ioctl()
83 yrs = rtc_tm.tm_year; in rtc_ioctl()
86 mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ in rtc_ioctl()
87 day = rtc_tm.tm_mday; in rtc_ioctl()
88 hrs = rtc_tm.tm_hour; in rtc_ioctl()
89 min = rtc_tm.tm_min; in rtc_ioctl()
90 sec = rtc_tm.tm_sec; in rtc_ioctl()
119 if (rtc_tm.tm_wday >= 0) in rtc_ioctl()
120 rtc->bcd_dow = bin2bcd(rtc_tm.tm_wday+1); in rtc_ioctl()
/linux-6.1.9/arch/m68k/mvme16x/
Drtc.c68 struct rtc_time rtc_tm; in rtc_ioctl() local
75 if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) in rtc_ioctl()
78 yrs = rtc_tm.tm_year; in rtc_ioctl()
81 mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ in rtc_ioctl()
82 day = rtc_tm.tm_mday; in rtc_ioctl()
83 hrs = rtc_tm.tm_hour; in rtc_ioctl()
84 min = rtc_tm.tm_min; in rtc_ioctl()
85 sec = rtc_tm.tm_sec; in rtc_ioctl()
/linux-6.1.9/tools/testing/selftests/rtc/
Drtctest.c43 struct rtc_time rtc_tm; in TEST_F() local
46 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); in TEST_F()
50 rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900, in TEST_F()
51 rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec); in TEST_F()
85 struct rtc_time rtc_tm; variable
91 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm);
93 start_rtc_read = rtc_time_to_timestamp(&rtc_tm);
99 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm);
102 rtc_read = rtc_time_to_timestamp(&rtc_tm);