Lines Matching defs:rtc
6 #include <linux/rtc.h>
44 #define RTC_HOURMIN 0x00 /* 32bit rtc hour/min counter reg */
45 #define RTC_SECOND 0x04 /* 32bit rtc seconds counter reg */
46 #define RTC_ALRM_HM 0x08 /* 32bit rtc alarm hour/min reg */
47 #define RTC_ALRM_SEC 0x0C /* 32bit rtc alarm seconds reg */
48 #define RTC_RTCCTL 0x10 /* 32bit rtc control reg */
49 #define RTC_RTCISR 0x14 /* 32bit rtc interrupt status reg */
50 #define RTC_RTCIENR 0x18 /* 32bit rtc interrupt enable reg */
51 #define RTC_STPWCH 0x1C /* 32bit rtc stopwatch min reg */
52 #define RTC_DAYR 0x20 /* 32bit rtc days counter reg */
53 #define RTC_DAYALARM 0x24 /* 32bit rtc day alarm reg */
54 #define RTC_TEST1 0x28 /* 32bit rtc test reg 1 */
55 #define RTC_TEST2 0x2C /* 32bit rtc test reg 2 */
56 #define RTC_TEST3 0x30 /* 32bit rtc test reg 3 */
64 struct rtc_device *rtc;
75 .name = "imx1-rtc",
78 .name = "imx21-rtc",
88 { .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC },
89 { .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC },
189 spin_lock_irqsave(&pdata->rtc->irq_lock, flags);
198 spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags);
211 spin_lock_irqsave(&pdata->rtc->irq_lock, flags);
226 rtc_update_irq(pdata->rtc, 1, events);
227 spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags);
320 struct rtc_device *rtc;
341 rtc = devm_rtc_allocate_device(&pdev->dev);
342 if (IS_ERR(rtc))
343 return PTR_ERR(rtc);
345 pdata->rtc = rtc;
346 rtc->ops = &mxc_rtc_ops;
351 rtc->range_max = (1 << 9) * 86400 - 1;
358 rtc->start_secs = mktime64(tm.tm_year, 1, 1, 0, 0, 0);
359 rtc->set_start_time = true;
362 rtc->range_max = (1 << 16) * 86400ULL - 1;
401 dev_err(&pdev->dev, "rtc clock is not valid (%lu)\n", rate);
431 ret = rtc_register_device(rtc);