/Linux-v4.19/drivers/rtc/ |
D | rtc-ds1511.c | 183 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 …]
|
D | rtc-da9052.c | 61 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 …]
|
D | rtc-da9055.c | 61 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 …]
|
D | rtc-pic32.c | 140 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 …]
|
D | rtc-s3c.c | 190 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 …]
|
D | rtc-sunxi.c | 233 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() 341 static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sunxi_rtc_settime() argument [all …]
|
D | rtc-sun6i.c | 322 static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_gettime() argument 336 rtc_tm->tm_sec = SUN6I_TIME_GET_SEC_VALUE(time); in sun6i_rtc_gettime() 337 rtc_tm->tm_min = SUN6I_TIME_GET_MIN_VALUE(time); in sun6i_rtc_gettime() 338 rtc_tm->tm_hour = SUN6I_TIME_GET_HOUR_VALUE(time); in sun6i_rtc_gettime() 340 rtc_tm->tm_mday = SUN6I_DATE_GET_DAY_VALUE(date); in sun6i_rtc_gettime() 341 rtc_tm->tm_mon = SUN6I_DATE_GET_MON_VALUE(date); in sun6i_rtc_gettime() 342 rtc_tm->tm_year = SUN6I_DATE_GET_YEAR_VALUE(date); in sun6i_rtc_gettime() 344 rtc_tm->tm_mon -= 1; in sun6i_rtc_gettime() 350 rtc_tm->tm_year += SUN6I_YEAR_OFF; in sun6i_rtc_gettime() 434 static int sun6i_rtc_settime(struct device *dev, struct rtc_time *rtc_tm) in sun6i_rtc_settime() argument [all …]
|
D | rtc-ac100.c | 392 static int ac100_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_get_time() argument 403 rtc_tm->tm_sec = bcd2bin(reg[0] & AC100_RTC_SEC_MASK); in ac100_rtc_get_time() 404 rtc_tm->tm_min = bcd2bin(reg[1] & AC100_RTC_MIN_MASK); in ac100_rtc_get_time() 405 rtc_tm->tm_hour = bcd2bin(reg[2] & AC100_RTC_HOU_MASK); in ac100_rtc_get_time() 406 rtc_tm->tm_wday = bcd2bin(reg[3] & AC100_RTC_WEE_MASK); in ac100_rtc_get_time() 407 rtc_tm->tm_mday = bcd2bin(reg[4] & AC100_RTC_DAY_MASK); in ac100_rtc_get_time() 408 rtc_tm->tm_mon = bcd2bin(reg[5] & AC100_RTC_MON_MASK) - 1; in ac100_rtc_get_time() 409 rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) + in ac100_rtc_get_time() 415 static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_set_time() argument 423 year = rtc_tm->tm_year - AC100_YEAR_OFF; in ac100_rtc_set_time() [all …]
|
D | rtc-puv3.c | 89 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()
|
D | rtc-ab-b5ze-s3.c | 318 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_timer() local 339 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_read_timer() 344 ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); in _abb5zes3_rtc_read_timer() 374 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_alarm() local 399 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_read_alarm() 403 alarm_tm->tm_year = rtc_tm.tm_year; in _abb5zes3_rtc_read_alarm() 404 alarm_tm->tm_mon = rtc_tm.tm_mon; in _abb5zes3_rtc_read_alarm() 406 ret = rtc_tm_to_time(&rtc_tm, &rtc_secs); in _abb5zes3_rtc_read_alarm() 471 struct rtc_time rtc_tm; in _abb5zes3_rtc_set_alarm() local 474 ret = _abb5zes3_rtc_read_time(dev, &rtc_tm); in _abb5zes3_rtc_set_alarm() [all …]
|
D | rtc-stmp3xxx.c | 154 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()
|
D | rtc-isl1208.c | 392 struct rtc_time rtc_tm; in isl1208_i2c_set_alarm() local 395 err = isl1208_i2c_read_time(client, &rtc_tm); in isl1208_i2c_set_alarm() 400 if (!alarm->enabled || rtc_tm_sub(alarm_tm, &rtc_tm) <= 0) in isl1208_i2c_set_alarm()
|
/Linux-v4.19/drivers/char/ |
D | rtc.c | 147 static void rtc_get_rtc_time(struct rtc_time *rtc_tm); 535 struct rtc_time rtc_tm; in rtc_do_ioctl() local 546 if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg, in rtc_do_ioctl() 550 yrs = rtc_tm.tm_year + 1900; in rtc_do_ioctl() 551 mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ in rtc_do_ioctl() 552 day = rtc_tm.tm_mday; in rtc_do_ioctl() 553 hrs = rtc_tm.tm_hour; in rtc_do_ioctl() 554 min = rtc_tm.tm_min; in rtc_do_ioctl() 555 sec = rtc_tm.tm_sec; in rtc_do_ioctl() 1183 static void rtc_get_rtc_time(struct rtc_time *rtc_tm) in rtc_get_rtc_time() argument [all …]
|
/Linux-v4.19/arch/powerpc/kernel/ |
D | rtas-rtc.c | 48 void rtas_get_rtc_time(struct rtc_time *rtc_tm) in rtas_get_rtc_time() argument 62 memset(rtc_tm, 0, sizeof(struct rtc_time)); in rtas_get_rtc_time() 79 rtc_tm->tm_sec = ret[5]; in rtas_get_rtc_time() 80 rtc_tm->tm_min = ret[4]; in rtas_get_rtc_time() 81 rtc_tm->tm_hour = ret[3]; in rtas_get_rtc_time() 82 rtc_tm->tm_mday = ret[2]; in rtas_get_rtc_time() 83 rtc_tm->tm_mon = ret[1] - 1; in rtas_get_rtc_time() 84 rtc_tm->tm_year = ret[0] - 1900; in rtas_get_rtc_time()
|
/Linux-v4.19/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-v4.19/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-v4.19/tools/testing/selftests/rtc/ |
D | rtctest.c | 41 struct rtc_time rtc_tm; in TEST_F() local 44 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); in TEST_F() 48 rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900, in TEST_F() 49 rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec); in TEST_F()
|