/drivers/rtc/ |
D | rtc-mcp795.c | 268 static int mcp795_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in mcp795_set_alarm() argument 282 later = rtc_tm_to_time64(&alm->time); in mcp795_set_alarm() 287 (SEC_PER_DAY * (365 + is_leap_year(alm->time.tm_year)))) in mcp795_set_alarm() 298 alm->time.tm_year = -1; in mcp795_set_alarm() 299 alm->time.tm_isdst = -1; in mcp795_set_alarm() 300 alm->time.tm_yday = -1; in mcp795_set_alarm() 302 tmp[0] = (tmp[0] & 0x80) | bin2bcd(alm->time.tm_sec); in mcp795_set_alarm() 303 tmp[1] = (tmp[1] & 0x80) | bin2bcd(alm->time.tm_min); in mcp795_set_alarm() 304 tmp[2] = (tmp[2] & 0xE0) | bin2bcd(alm->time.tm_hour); in mcp795_set_alarm() 305 tmp[3] = (tmp[3] & 0x80) | bin2bcd(alm->time.tm_wday + 1); in mcp795_set_alarm() [all …]
|
D | rtc-mv.c | 100 static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in mv_rtc_read_alarm() argument 119 alm->time.tm_sec = bcd2bin(second); in mv_rtc_read_alarm() 120 alm->time.tm_min = bcd2bin(minute); in mv_rtc_read_alarm() 121 alm->time.tm_hour = bcd2bin(hour); in mv_rtc_read_alarm() 122 alm->time.tm_mday = bcd2bin(day); in mv_rtc_read_alarm() 123 alm->time.tm_wday = bcd2bin(wday); in mv_rtc_read_alarm() 124 alm->time.tm_mon = bcd2bin(month) - 1; in mv_rtc_read_alarm() 126 alm->time.tm_year = bcd2bin(year) + 100; in mv_rtc_read_alarm() 128 if (rtc_valid_tm(&alm->time) < 0) { in mv_rtc_read_alarm() 130 rtc_time_to_tm(0, &alm->time); in mv_rtc_read_alarm() [all …]
|
D | rtc-s35390a.c | 277 static int s35390a_set_alarm(struct i2c_client *client, struct rtc_wkalrm *alm) in s35390a_set_alarm() argument 284 "mon=%d, year=%d, wday=%d\n", __func__, alm->time.tm_sec, in s35390a_set_alarm() 285 alm->time.tm_min, alm->time.tm_hour, alm->time.tm_mday, in s35390a_set_alarm() 286 alm->time.tm_mon, alm->time.tm_year, alm->time.tm_wday); in s35390a_set_alarm() 298 if (alm->enabled) in s35390a_set_alarm() 311 if (alm->time.tm_wday != -1) in s35390a_set_alarm() 312 buf[S35390A_ALRM_BYTE_WDAY] = bin2bcd(alm->time.tm_wday) | 0x80; in s35390a_set_alarm() 317 alm->time.tm_hour) | 0x80; in s35390a_set_alarm() 318 buf[S35390A_ALRM_BYTE_MINS] = bin2bcd(alm->time.tm_min) | 0x80; in s35390a_set_alarm() 320 if (alm->time.tm_hour >= 12) in s35390a_set_alarm() [all …]
|
D | rtc-sysfs.c | 136 struct rtc_wkalrm alm; in wakealarm_show() local 146 retval = rtc_read_alarm(to_rtc_device(dev), &alm); in wakealarm_show() 147 if (retval == 0 && alm.enabled) { in wakealarm_show() 148 rtc_tm_to_time(&alm.time, &alarm); in wakealarm_show() 162 struct rtc_wkalrm alm; in wakealarm_store() local 170 retval = rtc_read_time(rtc, &alm.time); in wakealarm_store() 173 rtc_tm_to_time(&alm.time, &now); in wakealarm_store() 195 retval = rtc_read_alarm(rtc, &alm); in wakealarm_store() 198 if (alm.enabled) { in wakealarm_store() 200 rtc_tm_to_time(&alm.time, &push); in wakealarm_store() [all …]
|
D | rtc-rc5t583.c | 117 static int rc5t583_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in rc5t583_rtc_read_alarm() argument 131 alm->time.tm_sec = 0; in rc5t583_rtc_read_alarm() 132 alm->time.tm_min = bcd2bin(alarm_data[0]); in rc5t583_rtc_read_alarm() 133 alm->time.tm_hour = bcd2bin(alarm_data[1]); in rc5t583_rtc_read_alarm() 134 alm->time.tm_mday = bcd2bin(alarm_data[2]); in rc5t583_rtc_read_alarm() 135 alm->time.tm_mon = bcd2bin(alarm_data[3]) - 1; in rc5t583_rtc_read_alarm() 136 alm->time.tm_year = bcd2bin(alarm_data[4]) + 100; in rc5t583_rtc_read_alarm() 144 alm->enabled = 1; in rc5t583_rtc_read_alarm() 149 static int rc5t583_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in rc5t583_rtc_set_alarm() argument 159 alarm_data[0] = bin2bcd(alm->time.tm_min); in rc5t583_rtc_set_alarm() [all …]
|
D | rtc-efi.c | 196 efi_time_t eft, alm; in efi_procfs() local 201 memset(&alm, 0, sizeof(alm)); in efi_procfs() 205 efi.get_wakeup_time(&enabled, &pending, &alm); in efi_procfs() 227 alm.hour, alm.minute, alm.second, alm.nanosecond, in efi_procfs() 228 alm.year, alm.month, alm.day, in efi_procfs() 229 alm.daylight, in efi_procfs() 237 seq_printf(seq, "Timezone\t: %u\n", alm.timezone); in efi_procfs()
|
D | rtc-davinci.c | 384 static int davinci_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in davinci_rtc_read_alarm() argument 391 alm->time.tm_sec = 0; in davinci_rtc_read_alarm() 396 alm->time.tm_min = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_AMIN)); in davinci_rtc_read_alarm() 399 alm->time.tm_hour = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_AHOUR)); in davinci_rtc_read_alarm() 412 if (convertfromdays(days, &alm->time) < 0) in davinci_rtc_read_alarm() 415 alm->pending = !!(rtcss_read(davinci_rtc, in davinci_rtc_read_alarm() 418 alm->enabled = alm->pending && device_may_wakeup(dev); in davinci_rtc_read_alarm() 423 static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in davinci_rtc_set_alarm() argument 429 if (alm->time.tm_mday <= 0 && alm->time.tm_mon < 0 in davinci_rtc_set_alarm() 430 && alm->time.tm_year < 0) { in davinci_rtc_set_alarm() [all …]
|
D | rtc-palmas.c | 161 static int palmas_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in palmas_rtc_read_alarm() argument 176 alm->time.tm_sec = bcd2bin(alarm_data[0]); in palmas_rtc_read_alarm() 177 alm->time.tm_min = bcd2bin(alarm_data[1]); in palmas_rtc_read_alarm() 178 alm->time.tm_hour = bcd2bin(alarm_data[2]); in palmas_rtc_read_alarm() 179 alm->time.tm_mday = bcd2bin(alarm_data[3]); in palmas_rtc_read_alarm() 180 alm->time.tm_mon = bcd2bin(alarm_data[4]) - 1; in palmas_rtc_read_alarm() 181 alm->time.tm_year = year_bcd2bin(alarm_data[5]); in palmas_rtc_read_alarm() 191 alm->enabled = 1; in palmas_rtc_read_alarm() 195 static int palmas_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in palmas_rtc_set_alarm() argument 207 alarm_data[0] = bin2bcd(alm->time.tm_sec); in palmas_rtc_set_alarm() [all …]
|
D | rtc-spear.c | 262 static int spear_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in spear_rtc_read_alarm() argument 271 alm->time.tm_sec = (time >> SECOND_SHIFT) & SECOND_MASK; in spear_rtc_read_alarm() 272 alm->time.tm_min = (time >> MINUTE_SHIFT) & MIN_MASK; in spear_rtc_read_alarm() 273 alm->time.tm_hour = (time >> HOUR_SHIFT) & HOUR_MASK; in spear_rtc_read_alarm() 274 alm->time.tm_mday = (date >> MDAY_SHIFT) & DAY_MASK; in spear_rtc_read_alarm() 275 alm->time.tm_mon = (date >> MONTH_SHIFT) & MONTH_MASK; in spear_rtc_read_alarm() 276 alm->time.tm_year = (date >> YEAR_SHIFT) & YEAR_MASK; in spear_rtc_read_alarm() 278 bcd2tm(&alm->time); in spear_rtc_read_alarm() 279 alm->enabled = readl(config->ioaddr + CTRL_REG) & INT_ENABLE; in spear_rtc_read_alarm() 292 static int spear_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in spear_rtc_set_alarm() argument [all …]
|
D | rtc-tps65910.c | 143 static int tps65910_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in tps65910_rtc_read_alarm() argument 157 alm->time.tm_sec = bcd2bin(alarm_data[0]); in tps65910_rtc_read_alarm() 158 alm->time.tm_min = bcd2bin(alarm_data[1]); in tps65910_rtc_read_alarm() 159 alm->time.tm_hour = bcd2bin(alarm_data[2]); in tps65910_rtc_read_alarm() 160 alm->time.tm_mday = bcd2bin(alarm_data[3]); in tps65910_rtc_read_alarm() 161 alm->time.tm_mon = bcd2bin(alarm_data[4]) - 1; in tps65910_rtc_read_alarm() 162 alm->time.tm_year = bcd2bin(alarm_data[5]) + 100; in tps65910_rtc_read_alarm() 169 alm->enabled = 1; in tps65910_rtc_read_alarm() 174 static int tps65910_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in tps65910_rtc_set_alarm() argument 184 alarm_data[0] = bin2bcd(alm->time.tm_sec); in tps65910_rtc_set_alarm() [all …]
|
D | rtc-ds1286.c | 266 static int ds1286_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in ds1286_read_alarm() argument 276 alm->time.tm_min = ds1286_rtc_read(priv, RTC_MINUTES_ALARM) & 0x7f; in ds1286_read_alarm() 277 alm->time.tm_hour = ds1286_rtc_read(priv, RTC_HOURS_ALARM) & 0x1f; in ds1286_read_alarm() 278 alm->time.tm_wday = ds1286_rtc_read(priv, RTC_DAY_ALARM) & 0x07; in ds1286_read_alarm() 282 alm->time.tm_min = bcd2bin(alm->time.tm_min); in ds1286_read_alarm() 283 alm->time.tm_hour = bcd2bin(alm->time.tm_hour); in ds1286_read_alarm() 284 alm->time.tm_sec = 0; in ds1286_read_alarm() 288 static int ds1286_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in ds1286_set_alarm() argument 293 hrs = alm->time.tm_hour; in ds1286_set_alarm() 294 min = alm->time.tm_min; in ds1286_set_alarm() [all …]
|
D | rtc-twl.c | 373 static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in twl_rtc_read_alarm() argument 387 alm->time.tm_sec = bcd2bin(rtc_data[0]); in twl_rtc_read_alarm() 388 alm->time.tm_min = bcd2bin(rtc_data[1]); in twl_rtc_read_alarm() 389 alm->time.tm_hour = bcd2bin(rtc_data[2]); in twl_rtc_read_alarm() 390 alm->time.tm_mday = bcd2bin(rtc_data[3]); in twl_rtc_read_alarm() 391 alm->time.tm_mon = bcd2bin(rtc_data[4]) - 1; in twl_rtc_read_alarm() 392 alm->time.tm_year = bcd2bin(rtc_data[5]) + 100; in twl_rtc_read_alarm() 396 alm->enabled = 1; in twl_rtc_read_alarm() 401 static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in twl_rtc_set_alarm() argument 412 alarm_data[0] = bin2bcd(alm->time.tm_sec); in twl_rtc_set_alarm() [all …]
|
D | rtc-omap.c | 350 static int omap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in omap_rtc_read_alarm() argument 358 alm->time.tm_sec = rtc_read(rtc, OMAP_RTC_ALARM_SECONDS_REG); in omap_rtc_read_alarm() 359 alm->time.tm_min = rtc_read(rtc, OMAP_RTC_ALARM_MINUTES_REG); in omap_rtc_read_alarm() 360 alm->time.tm_hour = rtc_read(rtc, OMAP_RTC_ALARM_HOURS_REG); in omap_rtc_read_alarm() 361 alm->time.tm_mday = rtc_read(rtc, OMAP_RTC_ALARM_DAYS_REG); in omap_rtc_read_alarm() 362 alm->time.tm_mon = rtc_read(rtc, OMAP_RTC_ALARM_MONTHS_REG); in omap_rtc_read_alarm() 363 alm->time.tm_year = rtc_read(rtc, OMAP_RTC_ALARM_YEARS_REG); in omap_rtc_read_alarm() 367 bcd2tm(&alm->time); in omap_rtc_read_alarm() 370 alm->enabled = !!(interrupts & OMAP_RTC_INTERRUPTS_IT_ALARM); in omap_rtc_read_alarm() 375 static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in omap_rtc_set_alarm() argument [all …]
|
D | rtc-ds1305.c | 271 static int ds1305_get_alarm(struct device *dev, struct rtc_wkalrm *alm) in ds1305_get_alarm() argument 290 alm->enabled = !!(ds1305->ctrl[0] & DS1305_AEI0); in ds1305_get_alarm() 291 alm->pending = !!(ds1305->ctrl[1] & DS1305_AEI0); in ds1305_get_alarm() 313 alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); in ds1305_get_alarm() 314 alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); in ds1305_get_alarm() 315 alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); in ds1305_get_alarm() 323 static int ds1305_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in ds1305_set_alarm() argument 333 status = rtc_tm_to_time(&alm->time, &later); in ds1305_set_alarm() 364 buf[1 + DS1305_SEC] = bin2bcd(alm->time.tm_sec); in ds1305_set_alarm() 365 buf[1 + DS1305_MIN] = bin2bcd(alm->time.tm_min); in ds1305_set_alarm() [all …]
|
D | rtc-mt6397.c | 219 static int mtk_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in mtk_rtc_read_alarm() argument 221 struct rtc_time *tm = &alm->time; in mtk_rtc_read_alarm() 240 alm->enabled = !!(irqen & RTC_IRQ_EN_AL); in mtk_rtc_read_alarm() 241 alm->pending = !!(pdn2 & RTC_PDN2_PWRON_ALARM); in mtk_rtc_read_alarm() 260 static int mtk_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in mtk_rtc_set_alarm() argument 262 struct rtc_time *tm = &alm->time; in mtk_rtc_set_alarm() 289 if (alm->enabled) { in mtk_rtc_set_alarm()
|
D | rtc-stmp3xxx.c | 213 static int stmp3xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in stmp3xxx_rtc_read_alarm() argument 217 rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time); in stmp3xxx_rtc_read_alarm() 221 static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in stmp3xxx_rtc_set_alarm() argument 226 rtc_tm_to_time(&alm->time, &t); in stmp3xxx_rtc_set_alarm() 229 stmp3xxx_alarm_irq_enable(dev, alm->enabled); in stmp3xxx_rtc_set_alarm()
|
D | rtc-hym8563.c | 189 static int hym8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) in hym8563_rtc_read_alarm() argument 192 struct rtc_time *alm_tm = &alm->time; in hym8563_rtc_read_alarm() 221 alm->enabled = 1; in hym8563_rtc_read_alarm() 226 static int hym8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) in hym8563_rtc_set_alarm() argument 229 struct rtc_time *alm_tm = &alm->time; in hym8563_rtc_set_alarm() 277 return hym8563_rtc_alarm_irq_enable(dev, alm->enabled); in hym8563_rtc_set_alarm()
|
/drivers/char/ |
D | efirtc.c | 301 efi_time_t eft, alm; in efi_rtc_proc_show() local 307 memset(&alm, 0, sizeof(alm)); in efi_rtc_proc_show() 313 efi.get_wakeup_time(&enabled, &pending, &alm); in efi_rtc_proc_show() 338 alm.hour, alm.minute, alm.second, alm.nanosecond, in efi_rtc_proc_show() 339 alm.year, alm.month, alm.day, in efi_rtc_proc_show() 340 alm.daylight, in efi_rtc_proc_show() 348 seq_printf(m, "Timezone : %u\n", alm.timezone); in efi_rtc_proc_show()
|
/drivers/clocksource/ |
D | timer-atmel-st.c | 154 u32 alm; in clkevt32k_next_event() local 169 alm = read_CRTR(); in clkevt32k_next_event() 172 regmap_write(regmap_st, AT91_ST_RTAR, alm); in clkevt32k_next_event() 176 alm += delta; in clkevt32k_next_event() 177 regmap_write(regmap_st, AT91_ST_RTAR, alm); in clkevt32k_next_event()
|