/linux-6.6.21/samples/pfsm/ |
D | pfsm-wakeup.c | 34 struct rtc_time rtc_tm; in main() local 53 ret = ioctl(fd_rtc, RTC_RD_TIME, &rtc_tm); in main() 59 rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900, in main() 60 rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec); in main() 63 rtc_tm.tm_sec += ALARM_DELTA_SEC; in main() 64 if (rtc_tm.tm_sec >= 60) { in main() 65 rtc_tm.tm_sec %= 60; in main() 66 rtc_tm.tm_min++; in main() 68 if (rtc_tm.tm_min == 60) { in main() 69 rtc_tm.tm_min = 0; in main() [all …]
|
/linux-6.6.21/drivers/rtc/ |
D | rtc-ds1511.c | 174 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 …]
|
D | rtc-da9052.c | 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() [all …]
|
D | rtc-da9055.c | 56 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 …]
|
D | rtc-pic32.c | 132 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 …]
|
D | rtc-sunxi.c | 218 static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sunxi_rtc_gettime() argument 232 rtc_tm->tm_sec = SUNXI_TIME_GET_SEC_VALUE(time); in sunxi_rtc_gettime() 233 rtc_tm->tm_min = SUNXI_TIME_GET_MIN_VALUE(time); in sunxi_rtc_gettime() 234 rtc_tm->tm_hour = SUNXI_TIME_GET_HOUR_VALUE(time); in sunxi_rtc_gettime() 236 rtc_tm->tm_mday = SUNXI_DATE_GET_DAY_VALUE(date); in sunxi_rtc_gettime() 237 rtc_tm->tm_mon = SUNXI_DATE_GET_MON_VALUE(date); in sunxi_rtc_gettime() 238 rtc_tm->tm_year = SUNXI_DATE_GET_YEAR_VALUE(date, in sunxi_rtc_gettime() 241 rtc_tm->tm_mon -= 1; in sunxi_rtc_gettime() 247 rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year); in sunxi_rtc_gettime() 326 static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sunxi_rtc_settime() argument [all …]
|
D | rtc-sun6i.c | 459 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_gettime() argument 480 rtc_time64_to_tm((date & 0xffff) * SECS_PER_DAY, rtc_tm); in sun6i_rtc_gettime() 482 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date); in sun6i_rtc_gettime() 483 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date) - 1; in sun6i_rtc_gettime() 484 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date); in sun6i_rtc_gettime() 490 rtc_tm->tm_year += SUN6I_YEAR_OFF; in sun6i_rtc_gettime() 493 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time); in sun6i_rtc_gettime() 494 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time); in sun6i_rtc_gettime() 495 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time); in sun6i_rtc_gettime() 597 static int sun6i_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_settime() argument [all …]
|
D | rtc-ac100.c | 384 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 …]
|
D | rtc-ab-b5ze-s3.c | 301 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 …]
|
D | rtc-stmp3xxx.c | 147 static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_gettime() argument 156 rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); in stmp3xxx_rtc_gettime() 160 static int stmp3xxx_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in stmp3xxx_rtc_settime() argument 164 writel(rtc_tm_to_time64(rtc_tm), rtc_data->io + STMP3XXX_RTC_SECONDS); in stmp3xxx_rtc_settime()
|
D | rtc-s3c.c | 210 struct rtc_time rtc_tm = *tm; in s3c_rtc_settime() local 218 rtc_tm.tm_year -= 100; in s3c_rtc_settime() 219 rtc_tm.tm_mon += 1; in s3c_rtc_settime() 221 return s3c_rtc_write_time(info, &rtc_tm); in s3c_rtc_settime()
|
D | rtc-isl1208.c | 432 struct rtc_time rtc_tm; in isl1208_i2c_set_alarm() local 435 err = isl1208_i2c_read_time(client, &rtc_tm); in isl1208_i2c_set_alarm() 440 if (!alarm->enabled || rtc_tm_sub(alarm_tm, &rtc_tm) <= 0) in isl1208_i2c_set_alarm()
|
/linux-6.6.21/arch/powerpc/kernel/ |
D | rtas-rtc.c | 47 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.6.21/arch/m68k/bvme6000/ |
D | rtc.c | 73 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.6.21/arch/m68k/mvme16x/ |
D | rtc.c | 68 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.6.21/tools/testing/selftests/rtc/ |
D | rtctest.c | 42 struct rtc_time rtc_tm; in TEST_F() local 49 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); in TEST_F() 53 rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900, in TEST_F() 54 rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec); in TEST_F() 88 struct rtc_time rtc_tm; variable 98 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); 100 start_rtc_read = rtc_time_to_timestamp(&rtc_tm); 106 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); 109 rtc_read = rtc_time_to_timestamp(&rtc_tm);
|