Lines Matching refs:vrtc

32 static void meson_vrtc_set_wakeup_time(struct meson_vrtc_data *vrtc,  in meson_vrtc_set_wakeup_time()  argument
35 writel_relaxed(time, vrtc->io_alarm); in meson_vrtc_set_wakeup_time()
40 struct meson_vrtc_data *vrtc = dev_get_drvdata(dev); in meson_vrtc_set_alarm() local
44 vrtc->alarm_time = rtc_tm_to_time64(&alarm->time); in meson_vrtc_set_alarm()
46 vrtc->alarm_time = 0; in meson_vrtc_set_alarm()
53 struct meson_vrtc_data *vrtc = dev_get_drvdata(dev); in meson_vrtc_alarm_irq_enable() local
55 vrtc->enabled = enabled; in meson_vrtc_alarm_irq_enable()
67 struct meson_vrtc_data *vrtc; in meson_vrtc_probe() local
69 vrtc = devm_kzalloc(&pdev->dev, sizeof(*vrtc), GFP_KERNEL); in meson_vrtc_probe()
70 if (!vrtc) in meson_vrtc_probe()
73 vrtc->io_alarm = devm_platform_ioremap_resource(pdev, 0); in meson_vrtc_probe()
74 if (IS_ERR(vrtc->io_alarm)) in meson_vrtc_probe()
75 return PTR_ERR(vrtc->io_alarm); in meson_vrtc_probe()
79 platform_set_drvdata(pdev, vrtc); in meson_vrtc_probe()
81 vrtc->rtc = devm_rtc_allocate_device(&pdev->dev); in meson_vrtc_probe()
82 if (IS_ERR(vrtc->rtc)) in meson_vrtc_probe()
83 return PTR_ERR(vrtc->rtc); in meson_vrtc_probe()
85 vrtc->rtc->ops = &meson_vrtc_ops; in meson_vrtc_probe()
86 return devm_rtc_register_device(vrtc->rtc); in meson_vrtc_probe()
91 struct meson_vrtc_data *vrtc = dev_get_drvdata(dev); in meson_vrtc_suspend() local
94 if (vrtc->alarm_time) { in meson_vrtc_suspend()
103 vrtc->alarm_time, local_time); in meson_vrtc_suspend()
104 alarm_secs = vrtc->alarm_time - local_time; in meson_vrtc_suspend()
106 meson_vrtc_set_wakeup_time(vrtc, alarm_secs); in meson_vrtc_suspend()
120 struct meson_vrtc_data *vrtc = dev_get_drvdata(dev); in meson_vrtc_resume() local
124 vrtc->alarm_time = 0; in meson_vrtc_resume()
125 meson_vrtc_set_wakeup_time(vrtc, 0); in meson_vrtc_resume()