Lines Matching refs:cros_ec_rtc
25 struct cros_ec_rtc { struct
87 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(dev); in cros_ec_rtc_read_time() local
88 struct cros_ec_device *cros_ec = cros_ec_rtc->cros_ec; in cros_ec_rtc_read_time()
106 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(dev); in cros_ec_rtc_set_time() local
107 struct cros_ec_device *cros_ec = cros_ec_rtc->cros_ec; in cros_ec_rtc_set_time()
127 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(dev); in cros_ec_rtc_read_alarm() local
128 struct cros_ec_device *cros_ec = cros_ec_rtc->cros_ec; in cros_ec_rtc_read_alarm()
157 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(dev); in cros_ec_rtc_set_alarm() local
158 struct cros_ec_device *cros_ec = cros_ec_rtc->cros_ec; in cros_ec_rtc_set_alarm()
186 cros_ec_rtc->saved_alarm = (u32)alarm_time; in cros_ec_rtc_set_alarm()
207 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(dev); in cros_ec_rtc_alarm_irq_enable() local
208 struct cros_ec_device *cros_ec = cros_ec_rtc->cros_ec; in cros_ec_rtc_alarm_irq_enable()
220 if (cros_ec_rtc->saved_alarm < current_time) in cros_ec_rtc_alarm_irq_enable()
223 alarm_offset = cros_ec_rtc->saved_alarm - current_time; in cros_ec_rtc_alarm_irq_enable()
248 cros_ec_rtc->saved_alarm = EC_RTC_ALARM_CLEAR; in cros_ec_rtc_alarm_irq_enable()
250 cros_ec_rtc->saved_alarm = alarm_value; in cros_ec_rtc_alarm_irq_enable()
268 struct cros_ec_rtc *cros_ec_rtc; in cros_ec_rtc_event() local
273 cros_ec_rtc = container_of(nb, struct cros_ec_rtc, notifier); in cros_ec_rtc_event()
274 rtc = cros_ec_rtc->rtc; in cros_ec_rtc_event()
275 cros_ec = cros_ec_rtc->cros_ec; in cros_ec_rtc_event()
298 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(&pdev->dev); in cros_ec_rtc_suspend() local
301 return enable_irq_wake(cros_ec_rtc->cros_ec->irq); in cros_ec_rtc_suspend()
309 struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(&pdev->dev); in cros_ec_rtc_resume() local
312 return disable_irq_wake(cros_ec_rtc->cros_ec->irq); in cros_ec_rtc_resume()
325 struct cros_ec_rtc *cros_ec_rtc; in cros_ec_rtc_probe() local
329 cros_ec_rtc = devm_kzalloc(&pdev->dev, sizeof(*cros_ec_rtc), in cros_ec_rtc_probe()
331 if (!cros_ec_rtc) in cros_ec_rtc_probe()
334 platform_set_drvdata(pdev, cros_ec_rtc); in cros_ec_rtc_probe()
335 cros_ec_rtc->cros_ec = cros_ec; in cros_ec_rtc_probe()
350 cros_ec_rtc->rtc = devm_rtc_device_register(&pdev->dev, DRV_NAME, in cros_ec_rtc_probe()
353 if (IS_ERR(cros_ec_rtc->rtc)) { in cros_ec_rtc_probe()
354 ret = PTR_ERR(cros_ec_rtc->rtc); in cros_ec_rtc_probe()
360 cros_ec_rtc->notifier.notifier_call = cros_ec_rtc_event; in cros_ec_rtc_probe()
362 &cros_ec_rtc->notifier); in cros_ec_rtc_probe()
373 struct cros_ec_rtc *cros_ec_rtc = platform_get_drvdata(pdev); in cros_ec_rtc_remove() local
378 &cros_ec_rtc->cros_ec->event_notifier, in cros_ec_rtc_remove()
379 &cros_ec_rtc->notifier); in cros_ec_rtc_remove()