/linux/drivers/rtc/ |
A D | rtc-mc146818-lib.c | 64 time->tm_year = CMOS_READ(RTC_YEAR); in mc146818_get_time() 99 time->tm_year = bcd2bin(time->tm_year); in mc146818_get_time() 104 time->tm_year += real_year - 72; in mc146818_get_time() 108 time->tm_year += (century - 19) * 100; in mc146818_get_time() 114 if (time->tm_year <= 69) in mc146818_get_time() 115 time->tm_year += 100; in mc146818_get_time() 135 yrs = time->tm_year; in mc146818_set_time()
|
A D | rtc-max6902.c | 72 dt->tm_year = bcd2bin(buf[6]); in max6902_read_time() 81 dt->tm_year += century; in max6902_read_time() 82 dt->tm_year -= 1900; in max6902_read_time() 89 dt->tm_year = dt->tm_year + 1900; in max6902_set_time() 101 max6902_set_reg(dev, MAX6902_REG_YEAR, bin2bcd(dt->tm_year % 100)); in max6902_set_time() 102 max6902_set_reg(dev, MAX6902_REG_CENTURY, bin2bcd(dt->tm_year / 100)); in max6902_set_time()
|
A D | rtc-ds1511.c | 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() 200 if (day > rtc_month_days(rtc_tm->tm_mon, rtc_tm->tm_year)) in ds1511_rtc_set_time() 247 rtc_tm->tm_year = rtc_read(RTC_YEAR) & 0x7f; in ds1511_rtc_read_time() 259 rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); in ds1511_rtc_read_time() 266 century += rtc_tm->tm_year; in ds1511_rtc_read_time() 267 rtc_tm->tm_year = century - 1900; in ds1511_rtc_read_time()
|
A D | rtc-moxart.c | 147 (((tm->tm_year - 100) / 10) << 4) | in moxart_rtc_set_time() 148 ((tm->tm_year - 100) % 10)); in moxart_rtc_set_time() 176 __func__, tm->tm_year, tm->tm_mon, tm->tm_mday, in moxart_rtc_set_time() 215 tm->tm_year = (((v & 0xF0) >> 4) * 10) + (v & 0x0F); in moxart_rtc_read_time() 216 tm->tm_year += 100; in moxart_rtc_read_time() 217 if (tm->tm_year <= 69) in moxart_rtc_read_time() 218 tm->tm_year += 100; in moxart_rtc_read_time() 225 if (!(tm->tm_year % 4) && (tm->tm_year % 100)) in moxart_rtc_read_time()
|
A D | rtc-da9052.c | 78 rtc_tm->tm_year = (v[0][4] & DA9052_RTC_YEAR) + 100; in da9052_read_alarm() 114 rtc_tm->tm_year -= 100; in da9052_set_alarm() 133 DA9052_RTC_YEAR, rtc_tm->tm_year); in da9052_set_alarm() 176 rtc_tm->tm_year = (v[0][5] & DA9052_RTC_YEAR) + 100; in da9052_rtc_read_time() 203 if ((tm->tm_year < 100) || (tm->tm_year > 163)) in da9052_rtc_set_time() 213 v[5] = tm->tm_year - 100; in da9052_rtc_set_time() 244 if ((tm->tm_year < 100) || (tm->tm_year > 163)) in da9052_rtc_set_alarm()
|
A D | rtc-m41t94.c | 38 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t94_set_time() 49 if (tm->tm_year >= 100) in m41t94_set_time() 51 buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); in m41t94_set_time() 89 tm->tm_year = bcd2bin(spi_w8r8(spi, M41T94_REG_YEAR)); in m41t94_read_time() 91 tm->tm_year += 100; in m41t94_read_time() 97 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t94_read_time()
|
A D | rtc-m48t35.c | 74 tm->tm_year = readb(&priv->reg->year); in m48t35_read_time() 83 tm->tm_year = bcd2bin(tm->tm_year); in m48t35_read_time() 89 tm->tm_year += 70; in m48t35_read_time() 90 if (tm->tm_year <= 69) in m48t35_read_time() 91 tm->tm_year += 100; in m48t35_read_time() 104 yrs = tm->tm_year + 1900; in m48t35_set_time()
|
A D | rtc-msm6242.c | 132 tm->tm_year = msm6242_read(priv, MSM6242_YEAR10) * 10 + in msm6242_read_time() 134 if (tm->tm_year <= 69) in msm6242_read_time() 135 tm->tm_year += 100; in msm6242_read_time() 175 if (tm->tm_year >= 100) in msm6242_set_time() 176 tm->tm_year -= 100; in msm6242_set_time() 177 msm6242_write(priv, tm->tm_year / 10, MSM6242_YEAR10); in msm6242_set_time() 178 msm6242_write(priv, tm->tm_year % 10, MSM6242_YEAR1); in msm6242_set_time()
|
A D | rtc-ds1286.c | 186 tm->tm_year = ds1286_rtc_read(priv, RTC_YEAR); in ds1286_read_time() 196 tm->tm_year = bcd2bin(tm->tm_year); in ds1286_read_time() 202 if (tm->tm_year < 45) in ds1286_read_time() 203 tm->tm_year += 30; in ds1286_read_time() 204 tm->tm_year += 40; in ds1286_read_time() 205 if (tm->tm_year < 70) in ds1286_read_time() 206 tm->tm_year += 100; in ds1286_read_time() 221 yrs = tm->tm_year + 1900; in ds1286_set_time()
|
A D | lib.c | 130 tm->tm_year = (int) (year - 1900); in rtc_time64_to_tm() 149 if (tm->tm_year < 70 || in rtc_valid_tm() 150 tm->tm_year > (INT_MAX - 1900) || in rtc_valid_tm() 154 ((unsigned int)tm->tm_year + 1900)) || in rtc_valid_tm() 170 return mktime64(((unsigned int)tm->tm_year + 1900), tm->tm_mon + 1, in rtc_tm_to_time64()
|
A D | rtc-rp5c01.c | 111 tm->tm_year = rp5c01_read(priv, RP5C01_10_YEAR) * 10 + in rp5c01_read_time() 113 if (tm->tm_year <= 69) in rp5c01_read_time() 114 tm->tm_year += 100; in rp5c01_read_time() 141 if (tm->tm_year >= 100) in rp5c01_set_time() 142 tm->tm_year -= 100; in rp5c01_set_time() 143 rp5c01_write(priv, tm->tm_year / 10, RP5C01_10_YEAR); in rp5c01_set_time() 144 rp5c01_write(priv, tm->tm_year % 10, RP5C01_1_YEAR); in rp5c01_set_time()
|
A D | rtc-m41t93.c | 56 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t93_set_time() 58 if (tm->tm_year < 100) { in m41t93_set_time() 91 ((tm->tm_year/100-1) << 6); in m41t93_set_time() 95 data[M41T93_REG_YEAR] = bin2bcd(tm->tm_year % 100); in m41t93_set_time() 151 tm->tm_year = bcd2bin(buf[M41T93_REG_YEAR]) + century_after_1900 * 100; in m41t93_get_time() 157 tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t93_get_time()
|
A D | rtc-max6916.c | 72 dt->tm_year = bcd2bin(buf[6]) + 100; in max6916_read_time() 82 if (dt->tm_year < 100 || dt->tm_year > 199) { in max6916_set_time() 84 dt->tm_year + 1900); in max6916_set_time() 95 buf[7] = bin2bcd(dt->tm_year % 100); in max6916_set_time()
|
A D | rtc-rx4581.c | 156 tm->tm_year = bcd2bin(date[RX4581_REG_YR]); in rx4581_get_datetime() 157 if (tm->tm_year < 70) in rx4581_get_datetime() 158 tm->tm_year += 100; /* assume we are in 1970...2069 */ in rx4581_get_datetime() 165 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in rx4581_get_datetime() 180 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in rx4581_set_datetime() 194 buf[RX4581_REG_YR+1] = bin2bcd(tm->tm_year % 100); in rx4581_set_datetime()
|
A D | rtc-bq4802.c | 67 tm->tm_year = p->read(p, 0x0a); in bq4802_read_time() 80 tm->tm_year = bcd2bin(tm->tm_year); in bq4802_read_time() 84 tm->tm_year += (century * 100); in bq4802_read_time() 85 tm->tm_year -= 1900; in bq4802_read_time() 99 year = tm->tm_year + 1900; in bq4802_set_time()
|
A D | rtc-mt6397.c | 79 tm->tm_year = data[RTC_OFFSET_YEAR]; in __mtk_rtc_read_time() 103 tm->tm_year += RTC_MIN_YEAR_OFFSET; in mtk_rtc_read_time() 125 tm->tm_year -= RTC_MIN_YEAR_OFFSET; in mtk_rtc_set_time() 133 data[RTC_OFFSET_YEAR] = tm->tm_year; in mtk_rtc_set_time() 179 tm->tm_year = data[RTC_OFFSET_YEAR] & RTC_AL_YEA_MASK; in mtk_rtc_read_alarm() 181 tm->tm_year += RTC_MIN_YEAR_OFFSET; in mtk_rtc_read_alarm() 197 tm->tm_year -= RTC_MIN_YEAR_OFFSET; in mtk_rtc_set_alarm() 217 (tm->tm_year & RTC_AL_YEA_MASK)); in mtk_rtc_set_alarm()
|
A D | rtc-pic32.c | 145 rtc_tm->tm_year = readb(base + PIC32_RTCYEAR); in pic32_rtc_gettime() 161 rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); in pic32_rtc_gettime() 163 rtc_tm->tm_year += 100; in pic32_rtc_gettime() 184 writeb(bin2bcd(tm->tm_year - 100), base + PIC32_RTCYEAR); in pic32_rtc_settime() 203 alm_tm->tm_year = readb(base + PIC32_ALRMYEAR); in pic32_rtc_getalarm() 216 alm_tm->tm_year = bcd2bin(alm_tm->tm_year); in pic32_rtc_getalarm()
|
/linux/arch/powerpc/platforms/maple/ |
A D | time.c | 59 tm->tm_year = maple_clock_read(RTC_YEAR); in maple_get_rtc_time() 69 tm->tm_year = bcd2bin(tm->tm_year); in maple_get_rtc_time() 71 if ((tm->tm_year + 1900) < 1970) in maple_get_rtc_time() 72 tm->tm_year += 100; in maple_get_rtc_time() 97 year = tm->tm_year; in maple_set_rtc_time()
|
/linux/arch/m68k/hp300/ |
A D | config.c | 217 t->tm_year = hp300_rtc_read(RTC_REG_YEAR1) * 10 + in hp300_hwclk() 219 if (t->tm_year <= 69) in hp300_hwclk() 220 t->tm_year += 100; in hp300_hwclk() 233 if (t->tm_year >= 100) in hp300_hwclk() 234 t->tm_year -= 100; in hp300_hwclk() 235 hp300_rtc_write(RTC_REG_YEAR1, t->tm_year / 10); in hp300_hwclk() 236 hp300_rtc_write(RTC_REG_YEAR2, t->tm_year % 10); in hp300_hwclk()
|
/linux/tools/testing/selftests/rtc/ |
A D | setdate.c | 47 sscanf(date, "%d-%d-%d", &new.tm_mday, &new.tm_mon, &new.tm_year); in main() 49 new.tm_year -= 1900; in main() 53 new.tm_mday, new.tm_mon + 1, new.tm_year + 1900, in main() 72 current.tm_mday, current.tm_mon + 1, current.tm_year + 1900, in main()
|
/linux/arch/m68k/sun3/ |
A D | intersil.c | 46 todintersil->year = (t->tm_year - 68) % 100; in sun3_hwclk() 56 t->tm_year = todintersil->year + 68; in sun3_hwclk() 58 if (t->tm_year < 70) in sun3_hwclk() 59 t->tm_year += 100; in sun3_hwclk()
|
/linux/arch/m68k/sun3x/ |
A D | time.c | 56 h->year = bin2bcd(t->tm_year % 100); in sun3x_hwclk() 66 t->tm_year = bcd2bin(h->year); in sun3x_hwclk() 68 if (t->tm_year < 70) in sun3x_hwclk() 69 t->tm_year += 100; in sun3x_hwclk()
|
/linux/arch/m68k/bvme6000/ |
A D | config.c | 295 rtc->t0cr_rtmr = t->tm_year%4; in bvme6000_hwclk() 302 rtc->bcd_year = bin2bcd(t->tm_year%100); in bvme6000_hwclk() 305 rtc->t0cr_rtmr = t->tm_year%4 | 0x08; in bvme6000_hwclk() 315 t->tm_year = bcd2bin(rtc->bcd_year); in bvme6000_hwclk() 316 if (t->tm_year < 70) in bvme6000_hwclk() 317 t->tm_year += 100; in bvme6000_hwclk()
|
/linux/arch/m68k/mvme16x/ |
A D | rtc.c | 57 wtime.tm_year = bcd2bin(rtc->bcd_year); in rtc_ioctl() 58 if (wtime.tm_year < 70) in rtc_ioctl() 59 wtime.tm_year += 100; in rtc_ioctl() 78 yrs = rtc_tm.tm_year; in rtc_ioctl()
|
/linux/arch/powerpc/platforms/chrp/ |
A D | time.c | 109 tm.tm_year = bin2bcd(tm.tm_year); in chrp_set_rtc_time() 116 chrp_cmos_clock_write(tm.tm_year,RTC_YEAR); in chrp_set_rtc_time() 160 tm->tm_year = year; in chrp_get_rtc_time()
|