Lines Matching full:rtd
26 struct rtc_test_data *rtd = dev_get_drvdata(dev); in test_rtc_read_alarm() local
29 alarm = (rtd->alarm.expires - jiffies) / HZ; in test_rtc_read_alarm()
30 alarm += ktime_get_real_seconds() + rtd->offset; in test_rtc_read_alarm()
33 alrm->enabled = rtd->alarm_en; in test_rtc_read_alarm()
40 struct rtc_test_data *rtd = dev_get_drvdata(dev); in test_rtc_set_alarm() local
45 timeout -= rtd->offset; in test_rtc_set_alarm()
47 del_timer(&rtd->alarm); in test_rtc_set_alarm()
53 rtd->alarm.expires = expires; in test_rtc_set_alarm()
56 add_timer(&rtd->alarm); in test_rtc_set_alarm()
58 rtd->alarm_en = alrm->enabled; in test_rtc_set_alarm()
65 struct rtc_test_data *rtd = dev_get_drvdata(dev); in test_rtc_read_time() local
67 rtc_time64_to_tm(ktime_get_real_seconds() + rtd->offset, tm); in test_rtc_read_time()
74 struct rtc_test_data *rtd = dev_get_drvdata(dev); in test_rtc_set_time() local
76 rtd->offset = rtc_tm_to_time64(tm) - ktime_get_real_seconds(); in test_rtc_set_time()
83 struct rtc_test_data *rtd = dev_get_drvdata(dev); in test_rtc_alarm_irq_enable() local
85 rtd->alarm_en = enable; in test_rtc_alarm_irq_enable()
87 add_timer(&rtd->alarm); in test_rtc_alarm_irq_enable()
89 del_timer(&rtd->alarm); in test_rtc_alarm_irq_enable()
110 struct rtc_test_data *rtd = from_timer(rtd, t, alarm); in test_rtc_alarm_handler() local
112 rtc_update_irq(rtd->rtc, 1, RTC_AF | RTC_IRQF); in test_rtc_alarm_handler()
117 struct rtc_test_data *rtd; in test_probe() local
119 rtd = devm_kzalloc(&plat_dev->dev, sizeof(*rtd), GFP_KERNEL); in test_probe()
120 if (!rtd) in test_probe()
123 platform_set_drvdata(plat_dev, rtd); in test_probe()
125 rtd->rtc = devm_rtc_allocate_device(&plat_dev->dev); in test_probe()
126 if (IS_ERR(rtd->rtc)) in test_probe()
127 return PTR_ERR(rtd->rtc); in test_probe()
131 rtd->rtc->ops = &test_rtc_ops_noalm; in test_probe()
134 rtd->rtc->ops = &test_rtc_ops; in test_probe()
138 timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0); in test_probe()
139 rtd->alarm.expires = 0; in test_probe()
141 return devm_rtc_register_device(rtd->rtc); in test_probe()