Lines Matching refs:ret

71 	int ret;  in tps65910_rtc_read_time()  local
74 ret = regmap_update_bits(tps->regmap, TPS65910_RTC_CTRL, in tps65910_rtc_read_time()
76 if (ret < 0) { in tps65910_rtc_read_time()
77 dev_err(dev, "RTC CTRL reg update failed with err:%d\n", ret); in tps65910_rtc_read_time()
78 return ret; in tps65910_rtc_read_time()
81 ret = regmap_bulk_read(tps->regmap, TPS65910_SECONDS, rtc_data, in tps65910_rtc_read_time()
83 if (ret < 0) { in tps65910_rtc_read_time()
84 dev_err(dev, "reading from RTC failed with err:%d\n", ret); in tps65910_rtc_read_time()
85 return ret; in tps65910_rtc_read_time()
95 return ret; in tps65910_rtc_read_time()
102 int ret; in tps65910_rtc_set_time() local
112 ret = regmap_update_bits(tps->regmap, TPS65910_RTC_CTRL, in tps65910_rtc_set_time()
114 if (ret < 0) { in tps65910_rtc_set_time()
115 dev_err(dev, "RTC stop failed with err:%d\n", ret); in tps65910_rtc_set_time()
116 return ret; in tps65910_rtc_set_time()
120 ret = regmap_bulk_write(tps->regmap, TPS65910_SECONDS, rtc_data, in tps65910_rtc_set_time()
122 if (ret < 0) { in tps65910_rtc_set_time()
123 dev_err(dev, "rtc_set_time error %d\n", ret); in tps65910_rtc_set_time()
124 return ret; in tps65910_rtc_set_time()
128 ret = regmap_update_bits(tps->regmap, TPS65910_RTC_CTRL, in tps65910_rtc_set_time()
130 if (ret < 0) in tps65910_rtc_set_time()
131 dev_err(dev, "RTC start failed with err:%d\n", ret); in tps65910_rtc_set_time()
133 return ret; in tps65910_rtc_set_time()
144 int ret; in tps65910_rtc_read_alarm() local
146 ret = regmap_bulk_read(tps->regmap, TPS65910_ALARM_SECONDS, alarm_data, in tps65910_rtc_read_alarm()
148 if (ret < 0) { in tps65910_rtc_read_alarm()
149 dev_err(dev, "rtc_read_alarm error %d\n", ret); in tps65910_rtc_read_alarm()
150 return ret; in tps65910_rtc_read_alarm()
160 ret = regmap_read(tps->regmap, TPS65910_RTC_INTERRUPTS, &int_val); in tps65910_rtc_read_alarm()
161 if (ret < 0) in tps65910_rtc_read_alarm()
162 return ret; in tps65910_rtc_read_alarm()
167 return ret; in tps65910_rtc_read_alarm()
174 int ret; in tps65910_rtc_set_alarm() local
176 ret = tps65910_rtc_alarm_irq_enable(dev, 0); in tps65910_rtc_set_alarm()
177 if (ret) in tps65910_rtc_set_alarm()
178 return ret; in tps65910_rtc_set_alarm()
188 ret = regmap_bulk_write(tps->regmap, TPS65910_ALARM_SECONDS, in tps65910_rtc_set_alarm()
190 if (ret) { in tps65910_rtc_set_alarm()
191 dev_err(dev, "rtc_set_alarm error %d\n", ret); in tps65910_rtc_set_alarm()
192 return ret; in tps65910_rtc_set_alarm()
196 ret = tps65910_rtc_alarm_irq_enable(dev, 1); in tps65910_rtc_set_alarm()
198 return ret; in tps65910_rtc_set_alarm()
206 int ret; in tps65910_rtc_set_calibration() local
230 ret = regmap_bulk_write(tps->regmap, TPS65910_RTC_COMP_LSB, in tps65910_rtc_set_calibration()
232 if (ret < 0) { in tps65910_rtc_set_calibration()
233 dev_err(dev, "rtc_set_calibration error: %d\n", ret); in tps65910_rtc_set_calibration()
234 return ret; in tps65910_rtc_set_calibration()
238 ret = regmap_update_bits(tps->regmap, TPS65910_RTC_CTRL, in tps65910_rtc_set_calibration()
240 if (ret < 0) in tps65910_rtc_set_calibration()
241 dev_err(dev, "auto_comp enable failed with error: %d\n", ret); in tps65910_rtc_set_calibration()
243 return ret; in tps65910_rtc_set_calibration()
252 int ret; in tps65910_rtc_get_calibration() local
254 ret = regmap_read(tps->regmap, TPS65910_RTC_CTRL, &ctrl); in tps65910_rtc_get_calibration()
255 if (ret < 0) in tps65910_rtc_get_calibration()
256 return ret; in tps65910_rtc_get_calibration()
264 ret = regmap_bulk_read(tps->regmap, TPS65910_RTC_COMP_LSB, comp_data, in tps65910_rtc_get_calibration()
266 if (ret < 0) { in tps65910_rtc_get_calibration()
267 dev_err(dev, "rtc_get_calibration error: %d\n", ret); in tps65910_rtc_get_calibration()
268 return ret; in tps65910_rtc_get_calibration()
282 int ret; in tps65910_read_offset() local
284 ret = tps65910_rtc_get_calibration(dev, &calibration); in tps65910_read_offset()
285 if (ret < 0) in tps65910_read_offset()
286 return ret; in tps65910_read_offset()
306 int ret; in tps65910_set_offset() local
323 ret = tps65910_rtc_set_calibration(dev, calibration); in tps65910_set_offset()
325 return ret; in tps65910_set_offset()
334 int ret; in tps65910_rtc_interrupt() local
337 ret = regmap_read(tps->regmap, TPS65910_RTC_STATUS, &rtc_reg); in tps65910_rtc_interrupt()
338 if (ret) in tps65910_rtc_interrupt()
344 ret = regmap_write(tps->regmap, TPS65910_RTC_STATUS, rtc_reg); in tps65910_rtc_interrupt()
345 if (ret) in tps65910_rtc_interrupt()
375 int ret; in tps65910_rtc_probe() local
391 ret = regmap_read(tps65910->regmap, TPS65910_RTC_STATUS, &rtc_reg); in tps65910_rtc_probe()
392 if (ret < 0) in tps65910_rtc_probe()
393 return ret; in tps65910_rtc_probe()
395 ret = regmap_write(tps65910->regmap, TPS65910_RTC_STATUS, rtc_reg); in tps65910_rtc_probe()
396 if (ret < 0) in tps65910_rtc_probe()
397 return ret; in tps65910_rtc_probe()
402 ret = regmap_update_bits(tps65910->regmap, TPS65910_DEVCTRL, in tps65910_rtc_probe()
404 if (ret < 0) in tps65910_rtc_probe()
405 return ret; in tps65910_rtc_probe()
408 ret = regmap_write(tps65910->regmap, TPS65910_RTC_CTRL, rtc_reg); in tps65910_rtc_probe()
409 if (ret < 0) in tps65910_rtc_probe()
410 return ret; in tps65910_rtc_probe()
421 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, in tps65910_rtc_probe()
424 if (ret < 0) in tps65910_rtc_probe()