Lines Matching refs:wm8350

33 	struct wm8350 *wm8350 = dev_get_drvdata(dev);  in wm8350_rtc_readtime()  local
42 ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES, in wm8350_rtc_readtime()
46 ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES, in wm8350_rtc_readtime()
92 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_settime() local
110 ret = wm8350_set_bits(wm8350, WM8350_RTC_TIME_CONTROL, WM8350_RTC_SET); in wm8350_rtc_settime()
116 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_settime()
126 ret = wm8350_block_write(wm8350, WM8350_RTC_SECONDS_MINUTES, 4, time); in wm8350_rtc_settime()
131 ret = wm8350_clear_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_settime()
141 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_readalarm() local
146 ret = wm8350_block_read(wm8350, WM8350_ALARM_SECONDS_MINUTES, 4, time); in wm8350_rtc_readalarm()
185 static int wm8350_rtc_stop_alarm(struct wm8350 *wm8350) in wm8350_rtc_stop_alarm() argument
192 ret = wm8350_set_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_stop_alarm()
199 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_stop_alarm()
209 static int wm8350_rtc_start_alarm(struct wm8350 *wm8350) in wm8350_rtc_start_alarm() argument
215 ret = wm8350_clear_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_start_alarm()
222 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_start_alarm()
235 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_alarm_irq_enable() local
238 return wm8350_rtc_start_alarm(wm8350); in wm8350_rtc_alarm_irq_enable()
240 return wm8350_rtc_stop_alarm(wm8350); in wm8350_rtc_alarm_irq_enable()
245 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_setalarm() local
282 ret = wm8350_rtc_stop_alarm(wm8350); in wm8350_rtc_setalarm()
287 ret = wm8350_block_write(wm8350, WM8350_ALARM_SECONDS_MINUTES, in wm8350_rtc_setalarm()
293 ret = wm8350_rtc_start_alarm(wm8350); in wm8350_rtc_setalarm()
300 struct wm8350 *wm8350 = data; in wm8350_rtc_alarm_handler() local
301 struct rtc_device *rtc = wm8350->rtc.rtc; in wm8350_rtc_alarm_handler()
307 ret = wm8350_set_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_alarm_handler()
310 dev_err(&(wm8350->rtc.pdev->dev), in wm8350_rtc_alarm_handler()
319 struct wm8350 *wm8350 = data; in wm8350_rtc_update_handler() local
320 struct rtc_device *rtc = wm8350->rtc.rtc; in wm8350_rtc_update_handler()
338 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_suspend() local
342 reg = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_suspend()
344 if (device_may_wakeup(&wm8350->rtc.pdev->dev) && in wm8350_rtc_suspend()
346 ret = wm8350_rtc_stop_alarm(wm8350); in wm8350_rtc_suspend()
356 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_resume() local
359 if (wm8350->rtc.alarm_enabled) { in wm8350_rtc_resume()
360 ret = wm8350_rtc_start_alarm(wm8350); in wm8350_rtc_resume()
371 struct wm8350 *wm8350 = platform_get_drvdata(pdev); in wm8350_rtc_probe() local
372 struct wm8350_rtc *wm_rtc = &wm8350->rtc; in wm8350_rtc_probe()
376 timectl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_probe()
387 power5 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_5); in wm8350_rtc_probe()
389 dev_info(wm8350->dev, "Starting RTC\n"); in wm8350_rtc_probe()
391 wm8350_reg_unlock(wm8350); in wm8350_rtc_probe()
393 ret = wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, in wm8350_rtc_probe()
400 wm8350_reg_lock(wm8350); in wm8350_rtc_probe()
406 ret = wm8350_clear_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_probe()
415 timectl = wm8350_reg_read(wm8350, in wm8350_rtc_probe()
435 wm8350_register_irq(wm8350, WM8350_IRQ_RTC_SEC, in wm8350_rtc_probe()
437 "RTC Seconds", wm8350); in wm8350_rtc_probe()
438 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC); in wm8350_rtc_probe()
440 wm8350_register_irq(wm8350, WM8350_IRQ_RTC_ALM, in wm8350_rtc_probe()
442 "RTC Alarm", wm8350); in wm8350_rtc_probe()
449 struct wm8350 *wm8350 = platform_get_drvdata(pdev); in wm8350_rtc_remove() local
451 wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC, wm8350); in wm8350_rtc_remove()
452 wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM, wm8350); in wm8350_rtc_remove()