Lines Matching refs:wm831x_rtc
89 struct wm831x_rtc { struct
120 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_readtime() local
121 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_readtime()
170 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_settime() local
171 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_settime()
232 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_readalarm() local
237 ret = wm831x_bulk_read(wm831x_rtc->wm831x, WM831X_RTC_ALARM_1, in wm831x_rtc_readalarm()
248 ret = wm831x_reg_read(wm831x_rtc->wm831x, WM831X_RTC_CONTROL); in wm831x_rtc_readalarm()
262 static int wm831x_rtc_stop_alarm(struct wm831x_rtc *wm831x_rtc) in wm831x_rtc_stop_alarm() argument
264 wm831x_rtc->alarm_enabled = 0; in wm831x_rtc_stop_alarm()
266 return wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_stop_alarm()
270 static int wm831x_rtc_start_alarm(struct wm831x_rtc *wm831x_rtc) in wm831x_rtc_start_alarm() argument
272 wm831x_rtc->alarm_enabled = 1; in wm831x_rtc_start_alarm()
274 return wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_start_alarm()
280 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_setalarm() local
281 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_setalarm()
287 ret = wm831x_rtc_stop_alarm(wm831x_rtc); in wm831x_rtc_setalarm()
307 ret = wm831x_rtc_start_alarm(wm831x_rtc); in wm831x_rtc_setalarm()
320 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_alarm_irq_enable() local
323 return wm831x_rtc_start_alarm(wm831x_rtc); in wm831x_rtc_alarm_irq_enable()
325 return wm831x_rtc_stop_alarm(wm831x_rtc); in wm831x_rtc_alarm_irq_enable()
330 struct wm831x_rtc *wm831x_rtc = data; in wm831x_alm_irq() local
332 rtc_update_irq(wm831x_rtc->rtc, 1, RTC_IRQF | RTC_AF); in wm831x_alm_irq()
349 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_suspend() local
352 if (wm831x_rtc->alarm_enabled && device_may_wakeup(dev)) in wm831x_rtc_suspend()
357 ret = wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_suspend()
370 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_resume() local
373 if (wm831x_rtc->alarm_enabled) { in wm831x_rtc_resume()
374 ret = wm831x_rtc_start_alarm(wm831x_rtc); in wm831x_rtc_resume()
385 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_freeze() local
388 ret = wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_freeze()
404 struct wm831x_rtc *wm831x_rtc; in wm831x_rtc_probe() local
408 wm831x_rtc = devm_kzalloc(&pdev->dev, sizeof(*wm831x_rtc), GFP_KERNEL); in wm831x_rtc_probe()
409 if (wm831x_rtc == NULL) in wm831x_rtc_probe()
412 platform_set_drvdata(pdev, wm831x_rtc); in wm831x_rtc_probe()
413 wm831x_rtc->wm831x = wm831x; in wm831x_rtc_probe()
421 wm831x_rtc->alarm_enabled = 1; in wm831x_rtc_probe()
425 wm831x_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); in wm831x_rtc_probe()
426 if (IS_ERR(wm831x_rtc->rtc)) in wm831x_rtc_probe()
427 return PTR_ERR(wm831x_rtc->rtc); in wm831x_rtc_probe()
429 wm831x_rtc->rtc->ops = &wm831x_rtc_ops; in wm831x_rtc_probe()
430 wm831x_rtc->rtc->range_max = U32_MAX; in wm831x_rtc_probe()
432 ret = devm_rtc_register_device(wm831x_rtc->rtc); in wm831x_rtc_probe()
440 wm831x_rtc); in wm831x_rtc_probe()