Lines Matching refs:alarm

126 	bool timer_alarm; /* current alarm is via timer A */
155 /* Clear alarm status bit. */
164 dev_err(dev, "%s: clearing alarm failed (%d)\n", __func__, ret);
169 /* Enable or disable alarm (i.e. alarm interrupt generation) */
179 dev_err(dev, "%s: writing alarm INT failed (%d)\n",
294 * Read alarm currently configured via a watchdog timer using timer A. This
298 struct rtc_wkalrm *alarm)
301 struct rtc_time rtc_tm, *alarm_tm = &alarm->time;
344 alarm->enabled = !!(reg & ABB5ZES3_REG_CTRL2_WTAIE);
349 /* Read alarm currently configured via a RTC alarm registers. */
351 struct rtc_wkalrm *alarm)
354 struct rtc_time rtc_tm, *alarm_tm = &alarm->time;
363 dev_err(dev, "%s: reading alarm section failed (%d)\n",
375 * The alarm section does not store year/month. We use the ones in rtc
377 * alarm after current time.
405 alarm->enabled = !!(reg & ABB5ZES3_REG_CTRL1_AIE);
413 * (up to 256 seconds w/ a second accuracy) for low alarm values (below
414 * 4 minutes). Otherwise, we use the common alarm mechanism provided
419 static int abb5zes3_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
425 ret = _abb5zes3_rtc_read_timer(dev, alarm);
427 ret = _abb5zes3_rtc_read_alarm(dev, alarm);
433 * Set alarm using chip alarm mechanism. It is only accurate to the
434 * minute (not the second). The function expects alarm interrupt to
437 static int _abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
440 struct rtc_time *alarm_tm = &alarm->time;
445 if (!alarm->enabled) {
454 * and checking alarm value is still below.
471 dev_err(dev, "%s: alarm maximum is one month in the future (%d)\n",
478 * Program all alarm registers but DW one. For each register, setting
479 * MSB to 0 enables associated alarm.
494 /* Record currently configured alarm is not a timer */
497 /* Enable or disable alarm interrupt generation */
502 * Set alarm using timer watchdog (via timer A) mechanism. The function expects
505 static int _abb5zes3_rtc_set_timer(struct device *dev, struct rtc_wkalrm *alarm,
528 /* Record currently configured alarm is a timer */
532 return _abb5zes3_rtc_update_timer(dev, alarm->enabled);
536 * The chip has an alarm which is only accurate to the minute. In order to
541 static int abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
544 struct rtc_time *alarm_tm = &alarm->time;
556 /* Let's first disable both the alarm and the timer interrupts */
559 dev_err(dev, "%s: unable to disable alarm (%d)\n", __func__,
573 * Let's now configure the alarm; if we are expected to ring in
574 * more than 240s, then we setup an alarm. Otherwise, a timer.
577 ret = _abb5zes3_rtc_set_timer(dev, alarm,
580 ret = _abb5zes3_rtc_set_alarm(dev, alarm);
583 dev_err(dev, "%s: unable to configure alarm (%d)\n", __func__,
613 * uselessly triggering the IRQ handler we install for alarm and battery
634 * Each component of the alarm (MN, HR, DT, DW) can be enabled/disabled
636 * we set all alarm enable bits to disable current alarm setting.
642 dev_err(dev, "%s: unable to disable alarm setting (%d)\n",
659 * Set Control 2 register (timer int. disabled, alarm status cleared).
774 /* Check alarm flag */
776 dev_dbg(dev, "RTC alarm!\n");
780 /* Acknowledge and disable the alarm */
794 * Acknowledge and disable the alarm. Note: WTAF