Lines Matching refs:cmos
253 struct cmos_rtc *cmos; member
269 if (p->cmos->day_alrm) { in cmos_read_alarm_callback()
271 time->tm_mday = CMOS_READ(p->cmos->day_alrm) & 0x3f; in cmos_read_alarm_callback()
275 if (p->cmos->mon_alrm) { in cmos_read_alarm_callback()
276 time->tm_mon = CMOS_READ(p->cmos->mon_alrm); in cmos_read_alarm_callback()
287 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_read_alarm() local
289 .cmos = cmos, in cmos_read_alarm()
294 if (!is_valid_irq(cmos->irq)) in cmos_read_alarm()
327 if (cmos->day_alrm) { in cmos_read_alarm()
333 if (cmos->mon_alrm) { in cmos_read_alarm()
348 static void cmos_checkintr(struct cmos_rtc *cmos, unsigned char rtc_control) in cmos_checkintr() argument
362 rtc_update_irq(cmos->rtc, 1, rtc_intr); in cmos_checkintr()
365 static void cmos_irq_enable(struct cmos_rtc *cmos, unsigned char mask) in cmos_irq_enable() argument
373 cmos_checkintr(cmos, rtc_control); in cmos_irq_enable()
381 if (cmos->wake_on) in cmos_irq_enable()
382 cmos->wake_on(cmos->dev); in cmos_irq_enable()
385 cmos_checkintr(cmos, rtc_control); in cmos_irq_enable()
388 static void cmos_irq_disable(struct cmos_rtc *cmos, unsigned char mask) in cmos_irq_disable() argument
399 if (cmos->wake_off) in cmos_irq_disable()
400 cmos->wake_off(cmos->dev); in cmos_irq_disable()
403 cmos_checkintr(cmos, rtc_control); in cmos_irq_disable()
408 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_validate_alarm() local
413 if (!cmos->day_alrm) { in cmos_validate_alarm()
425 } else if (!cmos->mon_alrm) { in cmos_validate_alarm()
474 struct cmos_rtc *cmos; member
489 cmos_irq_disable(p->cmos, RTC_AIE); in cmos_set_alarm_callback()
497 if (p->cmos->day_alrm) { in cmos_set_alarm_callback()
498 CMOS_WRITE(p->mday, p->cmos->day_alrm); in cmos_set_alarm_callback()
499 if (p->cmos->mon_alrm) in cmos_set_alarm_callback()
500 CMOS_WRITE(p->mon, p->cmos->mon_alrm); in cmos_set_alarm_callback()
513 cmos_irq_enable(p->cmos, RTC_AIE); in cmos_set_alarm_callback()
518 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_set_alarm() local
520 .cmos = cmos, in cmos_set_alarm()
527 if (!is_valid_irq(cmos->irq)) in cmos_set_alarm()
562 cmos->alarm_expires = rtc_tm_to_time64(&t->time); in cmos_set_alarm()
569 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_alarm_irq_enable() local
575 cmos_irq_enable(cmos, RTC_AIE); in cmos_alarm_irq_enable()
577 cmos_irq_disable(cmos, RTC_AIE); in cmos_alarm_irq_enable()
587 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_procfs() local
613 cmos->rtc->irq_freq, in cmos_procfs()
665 struct cmos_rtc *cmos = priv; in cmos_nvram_write() local
677 if (off == cmos->day_alrm in cmos_nvram_write()
678 || off == cmos->mon_alrm in cmos_nvram_write()
679 || off == cmos->century) in cmos_nvram_write()
752 struct cmos_rtc *cmos = dev_get_drvdata(dev); in rtc_handler() local
764 cmos_interrupt(0, (void *)cmos->rtc); in rtc_handler()
774 rtc_update_irq(cmos->rtc, 1, rtc_intr); in rtc_handler()
874 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_check_acpi_rtc_status() local
889 rtc_update_irq(cmos->rtc, 1, mask); in cmos_check_acpi_rtc_status()
1157 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_do_remove() local
1160 cmos_do_shutdown(cmos->irq); in cmos_do_remove()
1162 if (is_valid_irq(cmos->irq)) { in cmos_do_remove()
1163 free_irq(cmos->irq, cmos->rtc); in cmos_do_remove()
1171 cmos->rtc = NULL; in cmos_do_remove()
1173 ports = cmos->iomem; in cmos_do_remove()
1178 cmos->iomem = NULL; in cmos_do_remove()
1180 cmos->dev = NULL; in cmos_do_remove()
1185 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_aie_poweroff() local
1191 if (!cmos->alarm_expires) in cmos_aie_poweroff()
1214 if (cmos->alarm_expires == t_now + 1) { in cmos_aie_poweroff()
1221 } else if (cmos->alarm_expires > t_now + 1) { in cmos_aie_poweroff()
1230 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_suspend() local
1235 cmos->suspend_ctrl = tmp = CMOS_READ(RTC_CONTROL); in cmos_suspend()
1247 cmos_checkintr(cmos, tmp); in cmos_suspend()
1252 cmos->enabled_wake = 1; in cmos_suspend()
1253 if (cmos->wake_on) in cmos_suspend()
1254 cmos->wake_on(dev); in cmos_suspend()
1256 enable_irq_wake(cmos->irq); in cmos_suspend()
1259 memset(&cmos->saved_wkalrm, 0, sizeof(struct rtc_wkalrm)); in cmos_suspend()
1260 cmos_read_alarm(dev, &cmos->saved_wkalrm); in cmos_suspend()
1285 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_check_wkalrm() local
1293 if (!(cmos->suspend_ctrl & RTC_AIE)) in cmos_check_wkalrm()
1303 if (t_now >= cmos->alarm_expires && cmos_use_acpi_alarm()) { in cmos_check_wkalrm()
1305 cmos_interrupt(0, (void *)cmos->rtc); in cmos_check_wkalrm()
1313 t_saved_expires = rtc_tm_to_time64(&cmos->saved_wkalrm.time); in cmos_check_wkalrm()
1315 cmos->saved_wkalrm.enabled != current_alarm.enabled) { in cmos_check_wkalrm()
1316 cmos_set_alarm(dev, &cmos->saved_wkalrm); in cmos_check_wkalrm()
1322 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_resume() local
1325 if (cmos->enabled_wake && !cmos_use_acpi_alarm()) { in cmos_resume()
1326 if (cmos->wake_off) in cmos_resume()
1327 cmos->wake_off(dev); in cmos_resume()
1329 disable_irq_wake(cmos->irq); in cmos_resume()
1330 cmos->enabled_wake = 0; in cmos_resume()
1337 tmp = cmos->suspend_ctrl; in cmos_resume()
1338 cmos->suspend_ctrl = 0; in cmos_resume()
1359 rtc_update_irq(cmos->rtc, 1, mask); in cmos_resume()
1419 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_pnp_shutdown() local
1428 cmos_do_shutdown(cmos->irq); in cmos_pnp_shutdown()
1515 struct cmos_rtc *cmos = dev_get_drvdata(dev); in cmos_platform_shutdown() local
1524 cmos_do_shutdown(cmos->irq); in cmos_platform_shutdown()