Lines Matching refs:da9055
20 struct da9055 *da9055; member
28 ret = da9055_reg_update(rtc->da9055, DA9055_REG_ALARM_Y, in da9055_rtc_enable_alarm()
32 dev_err(rtc->da9055->dev, "Failed to enable ALM: %d\n", in da9055_rtc_enable_alarm()
36 ret = da9055_reg_update(rtc->da9055, DA9055_REG_ALARM_Y, in da9055_rtc_enable_alarm()
39 dev_err(rtc->da9055->dev, in da9055_rtc_enable_alarm()
56 static int da9055_read_alarm(struct da9055 *da9055, struct rtc_time *rtc_tm) in da9055_read_alarm() argument
61 ret = da9055_group_read(da9055, DA9055_REG_ALARM_MI, 5, v); in da9055_read_alarm()
63 dev_err(da9055->dev, "Failed to group read ALM: %d\n", ret); in da9055_read_alarm()
77 static int da9055_set_alarm(struct da9055 *da9055, struct rtc_time *rtc_tm) in da9055_set_alarm() argument
85 ret = da9055_reg_update(da9055, DA9055_REG_ALARM_MI, in da9055_set_alarm()
88 dev_err(da9055->dev, "Failed to write ALRM MIN: %d\n", ret); in da9055_set_alarm()
95 ret = da9055_group_write(da9055, DA9055_REG_ALARM_H, 2, v); in da9055_set_alarm()
99 ret = da9055_reg_update(da9055, DA9055_REG_ALARM_MO, in da9055_set_alarm()
102 dev_err(da9055->dev, "Failed to write ALM Month:%d\n", ret); in da9055_set_alarm()
104 ret = da9055_reg_update(da9055, DA9055_REG_ALARM_Y, in da9055_set_alarm()
107 dev_err(da9055->dev, "Failed to write ALM Year:%d\n", ret); in da9055_set_alarm()
112 static int da9055_rtc_get_alarm_status(struct da9055 *da9055) in da9055_rtc_get_alarm_status() argument
116 ret = da9055_reg_read(da9055, DA9055_REG_ALARM_Y); in da9055_rtc_get_alarm_status()
118 dev_err(da9055->dev, "Failed to read ALM: %d\n", ret); in da9055_rtc_get_alarm_status()
131 ret = da9055_reg_read(rtc->da9055, DA9055_REG_COUNT_S); in da9055_rtc_read_time()
142 ret = da9055_group_read(rtc->da9055, DA9055_REG_COUNT_S, 6, v); in da9055_rtc_read_time()
144 dev_err(rtc->da9055->dev, "Failed to read RTC time : %d\n", in da9055_rtc_read_time()
173 return da9055_group_write(rtc->da9055, DA9055_REG_COUNT_S, 6, v); in da9055_rtc_set_time()
182 ret = da9055_read_alarm(rtc->da9055, tm); in da9055_rtc_read_alarm()
187 alrm->enabled = da9055_rtc_get_alarm_status(rtc->da9055); in da9055_rtc_read_alarm()
202 ret = da9055_set_alarm(rtc->da9055, tm); in da9055_rtc_set_alarm()
226 static int da9055_rtc_device_init(struct da9055 *da9055, in da9055_rtc_device_init() argument
232 ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B, in da9055_rtc_device_init()
236 ret = da9055_reg_update(da9055, DA9055_REG_EN_32K, in da9055_rtc_device_init()
242 ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B, in da9055_rtc_device_init()
249 ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B, in da9055_rtc_device_init()
258 ret = da9055_reg_update(da9055, DA9055_REG_ALARM_MO, in da9055_rtc_device_init()
276 rtc->da9055 = dev_get_drvdata(pdev->dev.parent); in da9055_rtc_probe()
277 pdata = dev_get_platdata(rtc->da9055->dev); in da9055_rtc_probe()
280 ret = da9055_rtc_device_init(rtc->da9055, pdata); in da9055_rtc_probe()
284 ret = da9055_reg_read(rtc->da9055, DA9055_REG_ALARM_Y); in da9055_rtc_probe()
309 dev_err(rtc->da9055->dev, "irq registration failed: %d\n", ret); in da9055_rtc_probe()