Lines Matching refs:sr

189 static int isl1208_set_xtoscb(struct i2c_client *client, int sr, int xtosb_val)  in isl1208_set_xtoscb()  argument
192 if (!!(sr & ISL1208_REG_SR_XTOSCB) == xtosb_val) in isl1208_set_xtoscb()
196 sr |= ISL1208_REG_SR_XTOSCB; in isl1208_set_xtoscb()
198 sr &= ~ISL1208_REG_SR_XTOSCB; in isl1208_set_xtoscb()
200 return i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr); in isl1208_set_xtoscb()
302 int sr, dtr, atr, usr; in isl1208_rtc_proc() local
304 sr = isl1208_i2c_get_sr(client); in isl1208_rtc_proc()
305 if (sr < 0) { in isl1208_rtc_proc()
307 return sr; in isl1208_rtc_proc()
311 (sr & ISL1208_REG_SR_RTCF) ? " RTCF" : "", in isl1208_rtc_proc()
312 (sr & ISL1208_REG_SR_BAT) ? " BAT" : "", in isl1208_rtc_proc()
313 (sr & ISL1208_REG_SR_ALM) ? " ALM" : "", in isl1208_rtc_proc()
314 (sr & ISL1208_REG_SR_WRTC) ? " WRTC" : "", in isl1208_rtc_proc()
315 (sr & ISL1208_REG_SR_XTOSCB) ? " XTOSCB" : "", in isl1208_rtc_proc()
316 (sr & ISL1208_REG_SR_ARST) ? " ARST" : "", sr); in isl1208_rtc_proc()
319 (sr & ISL1208_REG_SR_RTCF) ? "bad" : "okay"); in isl1208_rtc_proc()
340 int sr; in isl1208_i2c_read_time() local
343 sr = isl1208_i2c_get_sr(client); in isl1208_i2c_read_time()
344 if (sr < 0) { in isl1208_i2c_read_time()
349 sr = isl1208_i2c_read_regs(client, 0, regs, ISL1208_RTC_SECTION_LEN); in isl1208_i2c_read_time()
350 if (sr < 0) { in isl1208_i2c_read_time()
353 return sr; in isl1208_i2c_read_time()
385 int icr, yr, sr = isl1208_i2c_get_sr(client); in isl1208_i2c_read_alarm() local
387 if (sr < 0) { in isl1208_i2c_read_alarm()
389 return sr; in isl1208_i2c_read_alarm()
392 sr = isl1208_i2c_read_regs(client, ISL1208_REG_SCA, regs, in isl1208_i2c_read_alarm()
394 if (sr < 0) { in isl1208_i2c_read_alarm()
397 return sr; in isl1208_i2c_read_alarm()
481 int sr; in isl1208_i2c_set_time() local
501 sr = isl1208_i2c_get_sr(client); in isl1208_i2c_set_time()
502 if (sr < 0) { in isl1208_i2c_set_time()
504 return sr; in isl1208_i2c_set_time()
508 sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, in isl1208_i2c_set_time()
509 sr | ISL1208_REG_SR_WRTC); in isl1208_i2c_set_time()
510 if (sr < 0) { in isl1208_i2c_set_time()
512 return sr; in isl1208_i2c_set_time()
516 sr = isl1208_i2c_set_regs(client, 0, regs, ISL1208_RTC_SECTION_LEN); in isl1208_i2c_set_time()
517 if (sr < 0) { in isl1208_i2c_set_time()
520 return sr; in isl1208_i2c_set_time()
524 sr = isl1208_i2c_get_sr(client); in isl1208_i2c_set_time()
525 if (sr < 0) { in isl1208_i2c_set_time()
527 return sr; in isl1208_i2c_set_time()
529 sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, in isl1208_i2c_set_time()
530 sr & ~ISL1208_REG_SR_WRTC); in isl1208_i2c_set_time()
531 if (sr < 0) { in isl1208_i2c_set_time()
533 return sr; in isl1208_i2c_set_time()
562 int sr; in timestamp0_store() local
564 sr = isl1208_i2c_get_sr(client); in timestamp0_store()
565 if (sr < 0) { in timestamp0_store()
567 return sr; in timestamp0_store()
570 sr &= ~ISL1208_REG_SR_EVT; in timestamp0_store()
572 sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr); in timestamp0_store()
573 if (sr < 0) in timestamp0_store()
586 int sr; in timestamp0_show() local
588 sr = isl1208_i2c_get_sr(client); in timestamp0_show()
589 if (sr < 0) { in timestamp0_show()
591 return sr; in timestamp0_show()
594 if (!(sr & ISL1208_REG_SR_EVT)) in timestamp0_show()
597 sr = isl1208_i2c_read_regs(client, ISL1219_REG_SCT, regs, in timestamp0_show()
599 if (sr < 0) { in timestamp0_show()
614 sr = rtc_valid_tm(&tm); in timestamp0_show()
615 if (sr) in timestamp0_show()
616 return sr; in timestamp0_show()
630 int handled = 0, sr, err; in isl1208_rtc_interrupt() local
650 sr = isl1208_i2c_get_sr(client); in isl1208_rtc_interrupt()
651 if (sr >= 0) in isl1208_rtc_interrupt()
657 return sr; in isl1208_rtc_interrupt()
661 if (sr & ISL1208_REG_SR_ALM) { in isl1208_rtc_interrupt()
674 sr &= ~ISL1208_REG_SR_ALM; in isl1208_rtc_interrupt()
675 sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr); in isl1208_rtc_interrupt()
676 if (sr < 0) in isl1208_rtc_interrupt()
683 if (isl1208->config->has_tamper && (sr & ISL1208_REG_SR_EVT)) { in isl1208_rtc_interrupt()
862 int sr; in isl1208_probe() local
905 sr = isl1208_i2c_get_sr(client); in isl1208_probe()
906 if (sr < 0) { in isl1208_probe()
908 return sr; in isl1208_probe()
914 rc = isl1208_set_xtoscb(client, sr, xtosb_val); in isl1208_probe()
918 if (sr & ISL1208_REG_SR_RTCF) in isl1208_probe()