Lines Matching refs:wm831x_rtc
93 struct wm831x_rtc { struct
104 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_readtime() local
105 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_readtime()
154 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_set_mmss() local
155 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_set_mmss()
218 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_readalarm() local
223 ret = wm831x_bulk_read(wm831x_rtc->wm831x, WM831X_RTC_ALARM_1, in wm831x_rtc_readalarm()
234 ret = wm831x_reg_read(wm831x_rtc->wm831x, WM831X_RTC_CONTROL); in wm831x_rtc_readalarm()
248 static int wm831x_rtc_stop_alarm(struct wm831x_rtc *wm831x_rtc) in wm831x_rtc_stop_alarm() argument
250 wm831x_rtc->alarm_enabled = 0; in wm831x_rtc_stop_alarm()
252 return wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_stop_alarm()
256 static int wm831x_rtc_start_alarm(struct wm831x_rtc *wm831x_rtc) in wm831x_rtc_start_alarm() argument
258 wm831x_rtc->alarm_enabled = 1; in wm831x_rtc_start_alarm()
260 return wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_start_alarm()
266 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_setalarm() local
267 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_setalarm()
277 ret = wm831x_rtc_stop_alarm(wm831x_rtc); in wm831x_rtc_setalarm()
297 ret = wm831x_rtc_start_alarm(wm831x_rtc); in wm831x_rtc_setalarm()
310 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev); in wm831x_rtc_alarm_irq_enable() local
313 return wm831x_rtc_start_alarm(wm831x_rtc); in wm831x_rtc_alarm_irq_enable()
315 return wm831x_rtc_stop_alarm(wm831x_rtc); in wm831x_rtc_alarm_irq_enable()
320 struct wm831x_rtc *wm831x_rtc = data; in wm831x_alm_irq() local
322 rtc_update_irq(wm831x_rtc->rtc, 1, RTC_IRQF | RTC_AF); in wm831x_alm_irq()
329 struct wm831x_rtc *wm831x_rtc = data; in wm831x_per_irq() local
331 rtc_update_irq(wm831x_rtc->rtc, 1, RTC_IRQF | RTC_UF); in wm831x_per_irq()
349 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(&pdev->dev); in wm831x_rtc_suspend() local
352 if (wm831x_rtc->alarm_enabled && device_may_wakeup(&pdev->dev)) in wm831x_rtc_suspend()
357 ret = wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_suspend()
371 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(&pdev->dev); in wm831x_rtc_resume() local
374 if (wm831x_rtc->alarm_enabled) { in wm831x_rtc_resume()
375 ret = wm831x_rtc_start_alarm(wm831x_rtc); in wm831x_rtc_resume()
388 struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(&pdev->dev); in wm831x_rtc_freeze() local
391 ret = wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL, in wm831x_rtc_freeze()
407 struct wm831x_rtc *wm831x_rtc; in wm831x_rtc_probe() local
412 wm831x_rtc = kzalloc(sizeof(*wm831x_rtc), GFP_KERNEL); in wm831x_rtc_probe()
413 if (wm831x_rtc == NULL) in wm831x_rtc_probe()
416 platform_set_drvdata(pdev, wm831x_rtc); in wm831x_rtc_probe()
417 wm831x_rtc->wm831x = wm831x; in wm831x_rtc_probe()
425 wm831x_rtc->alarm_enabled = 1; in wm831x_rtc_probe()
429 wm831x_rtc->rtc = rtc_device_register("wm831x", &pdev->dev, in wm831x_rtc_probe()
431 if (IS_ERR(wm831x_rtc->rtc)) { in wm831x_rtc_probe()
432 ret = PTR_ERR(wm831x_rtc->rtc); in wm831x_rtc_probe()
438 wm831x_rtc); in wm831x_rtc_probe()
446 wm831x_rtc); in wm831x_rtc_probe()
455 kfree(wm831x_rtc); in wm831x_rtc_probe()
461 struct wm831x_rtc *wm831x_rtc = platform_get_drvdata(pdev); in wm831x_rtc_remove() local
465 free_irq(alm_irq, wm831x_rtc); in wm831x_rtc_remove()
466 free_irq(per_irq, wm831x_rtc); in wm831x_rtc_remove()
467 rtc_device_unregister(wm831x_rtc->rtc); in wm831x_rtc_remove()
468 kfree(wm831x_rtc); in wm831x_rtc_remove()