/linux-master/drivers/rtc/ |
H A D | rtc-rx8581.c | 69 static int rx8581_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 118 tm->tm_sec = bcd2bin(date[RX8581_REG_SC] & 0x7F); 119 tm->tm_min = bcd2bin(date[RX8581_REG_MN] & 0x7F); 120 tm->tm_hour = bcd2bin(date[RX8581_REG_HR] & 0x3F); /* rtc hr 0-23 */ 121 tm->tm_wday = ilog2(date[RX8581_REG_DW] & 0x7F); 122 tm->tm_mday = bcd2bin(date[RX8581_REG_DM] & 0x3F); 123 tm->tm_mon = bcd2bin(date[RX8581_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ 124 tm->tm_year = bcd2bin(date[RX8581_REG_YR]) + 100; 126 dev_dbg(dev, "%s: tm is secs=%d, mins=%d, hours=%d, " 129 tm 135 rx8581_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-rk808.c | 68 static time64_t nov2dec_transitions(struct rtc_time *tm) argument 70 return (tm->tm_year + 1900) - 2016 + (tm->tm_mon + 1 > 11 ? 1 : 0); 73 static void rockchip_to_gregorian(struct rtc_time *tm) argument 76 time64_t time = rtc_tm_to_time64(tm); 77 rtc_time64_to_tm(time + nov2dec_transitions(tm) * 86400, tm); 80 static void gregorian_to_rockchip(struct rtc_time *tm) argument 82 time64_t extra_days = nov2dec_transitions(tm); 83 time64_t time = rtc_tm_to_time64(tm); 96 rk808_rtc_readtime(struct device *dev, struct rtc_time *tm) argument 146 rk808_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-pcf8563.c | 198 static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 224 tm->tm_sec = bcd2bin(buf[PCF8563_REG_SC] & 0x7F); 225 tm->tm_min = bcd2bin(buf[PCF8563_REG_MN] & 0x7F); 226 tm->tm_hour = bcd2bin(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */ 227 tm->tm_mday = bcd2bin(buf[PCF8563_REG_DM] & 0x3F); 228 tm->tm_wday = buf[PCF8563_REG_DW] & 0x07; 229 tm->tm_mon = bcd2bin(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ 230 tm->tm_year = bcd2bin(buf[PCF8563_REG_YR]) + 100; 233 (tm->tm_year >= 100) : (tm 244 pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 295 pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm) argument 327 pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm) argument [all...] |
H A D | rtc-s3c.c | 130 static int s3c_rtc_read_time(struct s3c_rtc *info, struct rtc_time *tm) argument 140 tm->tm_min = readb(info->base + S3C2410_RTCMIN); 141 tm->tm_hour = readb(info->base + S3C2410_RTCHOUR); 142 tm->tm_mday = readb(info->base + S3C2410_RTCDATE); 143 tm->tm_mon = readb(info->base + S3C2410_RTCMON); 144 tm->tm_year = readb(info->base + S3C2410_RTCYEAR); 145 tm->tm_sec = readb(info->base + S3C2410_RTCSEC); 152 if (tm->tm_sec == 0 && !have_retried) { 159 tm->tm_sec = bcd2bin(tm 170 s3c_rtc_write_time(struct s3c_rtc *info, const struct rtc_time *tm) argument 190 s3c_rtc_gettime(struct device *dev, struct rtc_time *tm) argument 207 s3c_rtc_settime(struct device *dev, struct rtc_time *tm) argument 277 struct rtc_time *tm = &alrm->time; local [all...] |
H A D | rtc-opal.c | 21 static void opal_to_tm(u32 y_m_d, u64 h_m_s_ms, struct rtc_time *tm) argument 23 tm->tm_year = ((bcd2bin(y_m_d >> 24) * 100) + 25 tm->tm_mon = bcd2bin((y_m_d >> 8) & 0xff) - 1; 26 tm->tm_mday = bcd2bin(y_m_d & 0xff); 27 tm->tm_hour = bcd2bin((h_m_s_ms >> 56) & 0xff); 28 tm->tm_min = bcd2bin((h_m_s_ms >> 48) & 0xff); 29 tm->tm_sec = bcd2bin((h_m_s_ms >> 40) & 0xff); 31 tm->tm_wday = -1; 34 static void tm_to_opal(struct rtc_time *tm, u32 *y_m_d, u64 *h_m_s_ms) argument 36 *y_m_d |= ((u32)bin2bcd((tm 46 opal_get_rtc_time(struct device *dev, struct rtc_time *tm) argument 80 opal_set_rtc_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-optee.c | 55 static int optee_rtc_readtime(struct device *dev, struct rtc_time *tm) argument 83 tm->tm_sec = optee_tm->tm_sec; 84 tm->tm_min = optee_tm->tm_min; 85 tm->tm_hour = optee_tm->tm_hour; 86 tm->tm_mday = optee_tm->tm_mday; 87 tm->tm_mon = optee_tm->tm_mon; 88 tm->tm_year = optee_tm->tm_year - 1900; 89 tm->tm_wday = optee_tm->tm_wday; 90 tm->tm_yday = rtc_year_days(tm 95 optee_rtc_settime(struct device *dev, struct rtc_time *tm) argument 196 struct optee_rtc_time *tm; local [all...] |
H A D | rtc-r7301.c | 148 static void rtc7301_get_time(struct rtc7301_priv *priv, struct rtc_time *tm, argument 153 tm->tm_sec = rtc7301_read(priv, RTC7301_1_SEC); 154 tm->tm_sec += (rtc7301_read(priv, RTC7301_10_SEC) & ~RTC7301_AE) * 10; 155 tm->tm_min = rtc7301_read(priv, RTC7301_1_MIN); 156 tm->tm_min += (rtc7301_read(priv, RTC7301_10_MIN) & ~RTC7301_AE) * 10; 157 tm->tm_hour = rtc7301_read(priv, RTC7301_1_HOUR); 158 tm->tm_hour += (rtc7301_read(priv, RTC7301_10_HOUR) & ~RTC7301_AE) * 10; 159 tm->tm_mday = rtc7301_read(priv, RTC7301_1_DAY); 160 tm->tm_mday += (rtc7301_read(priv, RTC7301_10_DAY) & ~RTC7301_AE) * 10; 163 tm 182 rtc7301_write_time(struct rtc7301_priv *priv, struct rtc_time *tm, bool alarm) argument 225 rtc7301_read_time(struct device *dev, struct rtc_time *tm) argument 244 rtc7301_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-as3722.c | 33 static void as3722_time_to_reg(u8 *rbuff, struct rtc_time *tm) argument 35 rbuff[0] = bin2bcd(tm->tm_sec); 36 rbuff[1] = bin2bcd(tm->tm_min); 37 rbuff[2] = bin2bcd(tm->tm_hour); 38 rbuff[3] = bin2bcd(tm->tm_mday); 39 rbuff[4] = bin2bcd(tm->tm_mon + 1); 40 rbuff[5] = bin2bcd(tm->tm_year - (AS3722_RTC_START_YEAR - 1900)); 43 static void as3722_reg_to_time(u8 *rbuff, struct rtc_time *tm) argument 45 tm->tm_sec = bcd2bin(rbuff[0] & 0x7F); 46 tm 54 as3722_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 71 as3722_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-rtd119x.c | 82 static int rtd119x_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 91 tm->tm_sec = (readl_relaxed(data->base + RTD_RTCSEC) & RTD_RTCSEC_RTCSEC_MASK) >> 1; 92 tm->tm_min = readl_relaxed(data->base + RTD_RTCMIN) & RTD_RTCMIN_RTCMIN_MASK; 93 tm->tm_hour = readl_relaxed(data->base + RTD_RTCHR) & RTD_RTCHR_RTCHR_MASK; 99 if (sec == tm->tm_sec) 113 tm->tm_year = year - 1900; 114 tm->tm_yday = day; 116 tm->tm_mon = 0; 117 while (day >= rtc_month_days(tm->tm_mon, year)) { 118 day -= rtc_month_days(tm 126 rtd119x_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-max8998.c | 75 static void max8998_data_to_tm(u8 *data, struct rtc_time *tm) argument 77 tm->tm_sec = bcd2bin(data[RTC_SEC]); 78 tm->tm_min = bcd2bin(data[RTC_MIN]); 80 tm->tm_hour = bcd2bin(data[RTC_HOUR] & 0x1f); 82 tm->tm_hour += 12; 84 tm->tm_hour = bcd2bin(data[RTC_HOUR] & 0x3f); 86 tm->tm_wday = data[RTC_WEEKDAY] & 0x07; 87 tm->tm_mday = bcd2bin(data[RTC_DATE]); 88 tm->tm_mon = bcd2bin(data[RTC_MONTH]); 89 tm 93 max8998_tm_to_data(struct rtc_time *tm, u8 *data) argument 105 max8998_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 120 max8998_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-stm32.c | 238 static void tm2bcd(struct rtc_time *tm) argument 240 tm->tm_sec = bin2bcd(tm->tm_sec); 241 tm->tm_min = bin2bcd(tm->tm_min); 242 tm->tm_hour = bin2bcd(tm->tm_hour); 244 tm->tm_mday = bin2bcd(tm->tm_mday); 245 tm 256 bcd2tm(struct rtc_time *tm) argument 273 stm32_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 299 stm32_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 344 struct rtc_time *tm = &alrm->time; local 433 stm32_rtc_valid_alrm(struct device *dev, struct rtc_time *tm) argument 475 struct rtc_time *tm = &alrm->time; local [all...] |
H A D | rtc-mt2712.c | 139 struct rtc_time *tm, int *sec) 141 tm->tm_sec = mt2712_readl(mt2712_rtc, MT2712_TC_SEC) 143 tm->tm_min = mt2712_readl(mt2712_rtc, MT2712_TC_MIN) 145 tm->tm_hour = mt2712_readl(mt2712_rtc, MT2712_TC_HOU) 147 tm->tm_mday = mt2712_readl(mt2712_rtc, MT2712_TC_DOM) 149 tm->tm_mon = (mt2712_readl(mt2712_rtc, MT2712_TC_MTH) - 1) 151 tm->tm_year = (mt2712_readl(mt2712_rtc, MT2712_TC_YEA) + 100) 157 static int mt2712_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 166 __mt2712_rtc_read_time(mt2712_rtc, tm, &sec); 167 } while (sec < tm 138 __mt2712_rtc_read_time(struct mt2712_rtc *mt2712_rtc, struct rtc_time *tm, int *sec) argument 172 mt2712_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 196 struct rtc_time *tm = &alm->time; local 234 struct rtc_time *tm = &alm->time; local [all...] |
H A D | rtc-sd3078.c | 83 static int sd3078_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 98 tm->tm_sec = bcd2bin(rtc_data[SD3078_REG_SC] & 0x7F); 99 tm->tm_min = bcd2bin(rtc_data[SD3078_REG_MN] & 0x7F); 108 tm->tm_hour = bcd2bin(rtc_data[SD3078_REG_HR] & 0x3F); 110 tm->tm_hour = bcd2bin(rtc_data[SD3078_REG_HR] & 0x1F) + 12; 112 tm->tm_hour = bcd2bin(rtc_data[SD3078_REG_HR] & 0x1F); 114 tm->tm_mday = bcd2bin(rtc_data[SD3078_REG_DM] & 0x3F); 115 tm->tm_wday = rtc_data[SD3078_REG_DW] & 0x07; 116 tm->tm_mon = bcd2bin(rtc_data[SD3078_REG_MO] & 0x1F) - 1; 117 tm 122 sd3078_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-bq32k.c | 90 static int bq32k_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 106 tm->tm_sec = bcd2bin(regs.seconds & BQ32K_SECONDS_MASK); 107 tm->tm_min = bcd2bin(regs.minutes & BQ32K_MINUTES_MASK); 108 tm->tm_hour = bcd2bin(regs.cent_hours & BQ32K_HOURS_MASK); 109 tm->tm_mday = bcd2bin(regs.date); 110 tm->tm_wday = bcd2bin(regs.day) - 1; 111 tm->tm_mon = bcd2bin(regs.month) - 1; 112 tm->tm_year = bcd2bin(regs.years) + 118 static int bq32k_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 122 regs.seconds = bin2bcd(tm [all...] |
H A D | rtc-pl031.c | 116 struct rtc_time *tm, unsigned long *st_time, 119 int year = tm->tm_year + 1900; 120 int wday = tm->tm_wday; 124 dev_err(dev, "invalid wday value %d\n", tm->tm_wday); 130 rtc_time64_to_tm(rtc_tm_to_time64(tm), &calc_tm); 136 *st_time = ((tm->tm_mon + 1) << RTC_MON_SHIFT) 137 | (tm->tm_mday << RTC_MDAY_SHIFT) 139 | (tm->tm_hour << RTC_HOUR_SHIFT) 140 | (tm->tm_min << RTC_MIN_SHIFT) 141 | (tm 115 pl031_stv2_tm_to_time(struct device *dev, struct rtc_time *tm, unsigned long *st_time, unsigned long *bcd_year) argument 149 pl031_stv2_time_to_tm(unsigned long st_time, unsigned long bcd_year, struct rtc_time *tm) argument 166 pl031_stv2_read_time(struct device *dev, struct rtc_time *tm) argument 176 pl031_stv2_set_time(struct device *dev, struct rtc_time *tm) argument 243 pl031_read_time(struct device *dev, struct rtc_time *tm) argument 252 pl031_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-mpc5121.c | 88 struct rtc_time *tm) 90 out_8(®s->second_set, tm->tm_sec); 91 out_8(®s->minute_set, tm->tm_min); 92 out_8(®s->hour_set, tm->tm_hour); 101 static int mpc5121_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 112 rtc_time64_to_tm(now, tm); 118 mpc5121_rtc_update_smh(regs, tm); 123 static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 133 now = rtc_tm_to_time64(tm); 140 mpc5121_rtc_update_smh(regs, tm); 87 mpc5121_rtc_update_smh(struct mpc5121_rtc_regs __iomem *regs, struct rtc_time *tm) argument 145 mpc5200_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 172 mpc5200_rtc_set_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-vt8500.c | 101 static int vt8500_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 109 tm->tm_sec = bcd2bin(time & TIME_SEC_MASK); 110 tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S); 111 tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S); 112 tm->tm_mday = bcd2bin(date & DATE_DAY_MASK); 113 tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1; 114 tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S) 116 tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S; 121 static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 125 writel((bin2bcd(tm [all...] |
H A D | rtc-max6900.c | 140 static int max6900_rtc_read_time(struct device *dev, struct rtc_time *tm) argument 150 tm->tm_sec = bcd2bin(regs[MAX6900_REG_SC]); 151 tm->tm_min = bcd2bin(regs[MAX6900_REG_MN]); 152 tm->tm_hour = bcd2bin(regs[MAX6900_REG_HR] & 0x3f); 153 tm->tm_mday = bcd2bin(regs[MAX6900_REG_DT]); 154 tm->tm_mon = bcd2bin(regs[MAX6900_REG_MO]) - 1; 155 tm->tm_year = bcd2bin(regs[MAX6900_REG_YR]) + 157 tm->tm_wday = bcd2bin(regs[MAX6900_REG_DW]); 167 static int max6900_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 177 regs[MAX6900_REG_SC] = bin2bcd(tm [all...] |
H A D | rtc-ds1742.c | 55 static int ds1742_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 61 century = bin2bcd((tm->tm_year + 1900) / 100); 65 writeb(bin2bcd(tm->tm_year % 100), ioaddr + RTC_YEAR); 66 writeb(bin2bcd(tm->tm_mon + 1), ioaddr + RTC_MONTH); 67 writeb(bin2bcd(tm->tm_wday) & RTC_DAY_MASK, ioaddr + RTC_DAY); 68 writeb(bin2bcd(tm->tm_mday), ioaddr + RTC_DATE); 69 writeb(bin2bcd(tm->tm_hour), ioaddr + RTC_HOURS); 70 writeb(bin2bcd(tm->tm_min), ioaddr + RTC_MINUTES); 71 writeb(bin2bcd(tm->tm_sec) & RTC_SECONDS_MASK, ioaddr + RTC_SECONDS); 79 static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm) argument [all...] |
H A D | rtc-s35390a.c | 210 static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm) argument 217 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d mday=%d, " 218 "mon=%d, year=%d, wday=%d\n", __func__, tm->tm_sec, 219 tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon, tm->tm_year, 220 tm->tm_wday); 225 buf[S35390A_BYTE_YEAR] = bin2bcd(tm 240 s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm) argument [all...] |
/linux-master/arch/powerpc/kernel/ |
H A D | rtas-rtc.c | 86 int rtas_set_rtc_time(struct rtc_time *tm) argument 94 tm->tm_year + 1900, tm->tm_mon + 1, 95 tm->tm_mday, tm->tm_hour, tm->tm_min, 96 tm->tm_sec, 0);
|
/linux-master/arch/sh/boards/mach-sh03/ |
H A D | rtc.c | 41 static int sh03_rtc_gettimeofday(struct device *dev, struct rtc_time *tm) argument 79 tm->tm_sec = sec; 80 tm->tm_min = min; 81 tm->tm_hour = hour; 82 tm->tm_mday = day; 83 tm->tm_mon = mon; 84 tm->tm_year = year - 1900; 89 static int set_rtc_mmss(struct rtc_time *tm) argument 101 real_seconds = tm->tm_sec; 102 real_minutes = tm 123 sh03_rtc_settimeofday(struct device *dev, struct rtc_time *tm) argument [all...] |
/linux-master/arch/powerpc/include/asm/ |
H A D | tm.h | 9 #include <uapi/asm/tm.h>
|
/linux-master/arch/powerpc/platforms/powermac/ |
H A D | time.c | 88 struct rtc_time tm; local 90 if (smu_get_rtc_time(&tm, 1)) 92 return rtc_tm_to_time64(&tm); 118 void pmac_get_rtc_time(struct rtc_time *tm) argument 124 rtc_time64_to_tm(cuda_get_time(), tm); local 129 rtc_time64_to_tm(pmu_get_time(), tm); local 134 smu_get_rtc_time(tm, 1); 142 int pmac_set_rtc_time(struct rtc_time *tm) argument 147 return cuda_set_rtc_time(tm); 151 return pmu_set_rtc_time(tm); [all...] |
/linux-master/arch/s390/include/asm/ |
H A D | scsw.h | 138 * @tm: transport-mode SCSW 143 struct tm_scsw tm; member in union:scsw 233 return css_general_characteristics.fcx && (scsw->tm.x == 1); 246 return scsw->tm.key; 261 return scsw->tm.eswf; 276 return scsw->tm.cc; 291 return scsw->tm.ectl; 306 return scsw->tm.pno; 321 return scsw->tm.fctl; 336 return scsw->tm [all...] |