Lines Matching refs:err
77 int err; in idtfc3_set_lpf_mode() local
85 err = regmap_bulk_write(idtfc3->regmap, LPF_MODE_CNFG, &mode, sizeof(mode)); in idtfc3_set_lpf_mode()
86 if (err) in idtfc3_set_lpf_mode()
87 return err; in idtfc3_set_lpf_mode()
97 int err; in idtfc3_enable_lpf() local
99 err = regmap_bulk_read(idtfc3->regmap, LPF_CTRL, &val, sizeof(val)); in idtfc3_enable_lpf()
100 if (err) in idtfc3_enable_lpf()
101 return err; in idtfc3_enable_lpf()
113 int err; in idtfc3_get_time_ref_freq() local
118 err = regmap_bulk_read(idtfc3->regmap, TIME_CLOCK_MEAS_DIV_CNFG, buf, sizeof(buf)); in idtfc3_get_time_ref_freq()
119 if (err) in idtfc3_get_time_ref_freq()
120 return err; in idtfc3_get_time_ref_freq()
123 err = regmap_bulk_read(idtfc3->regmap, TIME_CLOCK_COUNT, buf, 1); in idtfc3_get_time_ref_freq()
124 if (err) in idtfc3_get_time_ref_freq()
125 return err; in idtfc3_get_time_ref_freq()
135 int err; in idtfc3_get_tdc_offset_sign() local
140 err = regmap_bulk_read(idtfc3->regmap, TIME_CLOCK_TDC_FANOUT_CNFG, buf, sizeof(buf)); in idtfc3_get_tdc_offset_sign()
141 if (err) in idtfc3_get_tdc_offset_sign()
142 return err; in idtfc3_get_tdc_offset_sign()
174 int err; in idtfc3_enable_tdc() local
178 err = regmap_bulk_write(idtfc3->regmap, TIME_CLOCK_MEAS_CTRL, &val, sizeof(val)); in idtfc3_enable_tdc()
179 if (err) in idtfc3_enable_tdc()
180 return err; in idtfc3_enable_tdc()
189 err = regmap_bulk_write(idtfc3->regmap, TIME_CLOCK_MEAS_CNFG, in idtfc3_enable_tdc()
191 if (err) in idtfc3_enable_tdc()
192 return err; in idtfc3_enable_tdc()
198 err = regmap_bulk_write(idtfc3->regmap, TIME_CLOCK_MEAS_CTRL, &val, sizeof(val)); in idtfc3_enable_tdc()
199 if (err) in idtfc3_enable_tdc()
200 return err; in idtfc3_enable_tdc()
210 int err; in get_tdc_meas() local
213 err = regmap_bulk_read(idtfc3->regmap, TDC_FIFO_STS, in get_tdc_meas()
215 if (err) in get_tdc_meas()
221 err = regmap_bulk_read(idtfc3->regmap, TDC_FIFO_READ_REQ, in get_tdc_meas()
223 if (err) in get_tdc_meas()
238 int err; in check_tdc_fifo_overrun() local
241 err = regmap_bulk_read(idtfc3->regmap, TDC_FIFO_STS, &val, sizeof(val)); in check_tdc_fifo_overrun()
242 if (err) in check_tdc_fifo_overrun()
243 return err; in check_tdc_fifo_overrun()
250 err = idtfc3_enable_tdc(idtfc3, true, CONTINUOUS); in check_tdc_fifo_overrun()
251 if (err) in check_tdc_fifo_overrun()
252 return err; in check_tdc_fifo_overrun()
259 int err; in get_tdc_meas_continuous() local
263 err = check_tdc_fifo_overrun(idtfc3); in get_tdc_meas_continuous()
264 if (err) in get_tdc_meas_continuous()
265 return err; in get_tdc_meas_continuous()
280 int err; in idtfc3_read_subcounter() local
282 err = regmap_bulk_read(idtfc3->regmap, TOD_COUNTER_READ_REQ, in idtfc3_read_subcounter()
284 if (err) in idtfc3_read_subcounter()
285 return err; in idtfc3_read_subcounter()
293 int err; in idtfc3_tod_update_is_done() local
296 err = read_poll_timeout_atomic(regmap_bulk_read, err, !req, USEC_PER_MSEC, in idtfc3_tod_update_is_done()
299 if (err) in idtfc3_tod_update_is_done()
302 return err; in idtfc3_tod_update_is_done()
308 int err; in idtfc3_write_subcounter() local
316 err = regmap_bulk_write(idtfc3->regmap, TOD_SYNC_LOAD_VAL_CTRL, in idtfc3_write_subcounter()
318 if (err) in idtfc3_write_subcounter()
319 return err; in idtfc3_write_subcounter()
326 int err; in idtfc3_timecounter_update() local
328 err = idtfc3_write_subcounter(idtfc3, counter); in idtfc3_timecounter_update()
329 if (err) in idtfc3_timecounter_update()
330 return err; in idtfc3_timecounter_update()
362 int err; in _idtfc3_gettime() local
364 err = idtfc3_timecounter_read(idtfc3); in _idtfc3_gettime()
365 if (err) in _idtfc3_gettime()
366 return err; in _idtfc3_gettime()
376 int err; in idtfc3_gettime() local
379 err = _idtfc3_gettime(idtfc3, ts); in idtfc3_gettime()
382 return err; in idtfc3_gettime()
411 int err; in idtfc3_settime() local
414 err = _idtfc3_settime(idtfc3, ts); in idtfc3_settime()
417 return err; in idtfc3_settime()
445 int err; in idtfc3_adjtime() local
448 err = _idtfc3_adjtime(idtfc3, delta); in idtfc3_adjtime()
451 return err; in idtfc3_adjtime()
457 int err; in _idtfc3_adjphase() local
460 err = idtfc3_set_lpf_mode(idtfc3, LPF_WP); in _idtfc3_adjphase()
461 if (err) in _idtfc3_adjphase()
462 return err; in _idtfc3_adjphase()
482 int err; in idtfc3_adjphase() local
485 err = _idtfc3_adjphase(idtfc3, delta); in idtfc3_adjphase()
488 return err; in idtfc3_adjphase()
494 int err; in _idtfc3_adjfine() local
497 err = idtfc3_set_lpf_mode(idtfc3, LPF_WF); in _idtfc3_adjfine()
498 if (err) in _idtfc3_adjfine()
499 return err; in _idtfc3_adjfine()
525 int err; in idtfc3_adjfine() local
528 err = _idtfc3_adjfine(idtfc3, scaled_ppm); in idtfc3_adjfine()
531 return err; in idtfc3_adjfine()
538 int err = -EOPNOTSUPP; in idtfc3_enable() local
544 err = 0; in idtfc3_enable()
548 err = -ERANGE; in idtfc3_enable()
550 err = 0; in idtfc3_enable()
556 err = -EOPNOTSUPP; in idtfc3_enable()
558 err = idtfc3_enable_tdc(idtfc3, true, CONTINUOUS); in idtfc3_enable()
560 err = idtfc3_enable_tdc(idtfc3, false, MEAS_MODE_INVALID); in idtfc3_enable()
568 if (err) in idtfc3_enable()
569 dev_err(idtfc3->dev, "Failed in %s with err %d!", __func__, err); in idtfc3_enable()
571 return err; in idtfc3_enable()
606 int err = 0; in idtfc3_hw_calibrate() local
617 err = regmap_bulk_write(idtfc3->regmap, TDC_CTRL, in idtfc3_hw_calibrate()
619 if (err) in idtfc3_hw_calibrate()
620 return err; in idtfc3_hw_calibrate()
622 err = regmap_bulk_write(idtfc3->regmap, TDC_CTRL, in idtfc3_hw_calibrate()
624 if (err) in idtfc3_hw_calibrate()
625 return err; in idtfc3_hw_calibrate()
634 err = regmap_bulk_write(idtfc3->regmap, SOFT_RESET_CTRL, in idtfc3_hw_calibrate()
636 if (err) in idtfc3_hw_calibrate()
637 return err; in idtfc3_hw_calibrate()
639 err = regmap_bulk_write(idtfc3->regmap, SOFT_RESET_CTRL, in idtfc3_hw_calibrate()
641 if (err) in idtfc3_hw_calibrate()
642 return err; in idtfc3_hw_calibrate()
645 return err; in idtfc3_hw_calibrate()
650 int err; in idtfc3_init_timecounter() local
659 err = idtfc3_timecounter_update(idtfc3, 0, 0); in idtfc3_init_timecounter()
660 if (err) in idtfc3_init_timecounter()
661 return err; in idtfc3_init_timecounter()
663 err = idtfc3_timecounter_read(idtfc3); in idtfc3_init_timecounter()
664 if (err) in idtfc3_init_timecounter()
665 return err; in idtfc3_init_timecounter()
674 int err; in idtfc3_get_tdc_apll_freq() local
679 err = regmap_bulk_read(idtfc3->regmap, TDC_REF_DIV_CNFG, in idtfc3_get_tdc_apll_freq()
681 if (err) in idtfc3_get_tdc_apll_freq()
682 return err; in idtfc3_get_tdc_apll_freq()
684 err = regmap_bulk_read(idtfc3->regmap, TDC_FB_DIV_INT_CNFG, in idtfc3_get_tdc_apll_freq()
686 if (err) in idtfc3_get_tdc_apll_freq()
687 return err; in idtfc3_get_tdc_apll_freq()
700 int err; in idtfc3_get_fod() local
703 err = regmap_bulk_read(idtfc3->regmap, TIME_CLOCK_SRC, &fod, sizeof(fod)); in idtfc3_get_fod()
704 if (err) in idtfc3_get_fod()
705 return err; in idtfc3_get_fod()
726 int err; in idtfc3_get_sync_count() local
729 err = regmap_bulk_read(idtfc3->regmap, SUB_SYNC_GEN_CNFG, buf, sizeof(buf)); in idtfc3_get_sync_count()
730 if (err) in idtfc3_get_sync_count()
731 return err; in idtfc3_get_sync_count()
742 int err; in idtfc3_setup_hw_param() local
744 err = idtfc3_get_fod(idtfc3); in idtfc3_setup_hw_param()
745 if (err) in idtfc3_setup_hw_param()
746 return err; in idtfc3_setup_hw_param()
748 err = idtfc3_get_sync_count(idtfc3); in idtfc3_setup_hw_param()
749 if (err) in idtfc3_setup_hw_param()
750 return err; in idtfc3_setup_hw_param()
752 err = idtfc3_get_time_ref_freq(idtfc3); in idtfc3_setup_hw_param()
753 if (err) in idtfc3_setup_hw_param()
754 return err; in idtfc3_setup_hw_param()
761 int err = 0; in idtfc3_configure_hw() local
763 err = idtfc3_hw_calibrate(idtfc3); in idtfc3_configure_hw()
764 if (err) in idtfc3_configure_hw()
765 return err; in idtfc3_configure_hw()
767 err = idtfc3_enable_lpf(idtfc3, true); in idtfc3_configure_hw()
768 if (err) in idtfc3_configure_hw()
769 return err; in idtfc3_configure_hw()
771 err = idtfc3_enable_tdc(idtfc3, false, MEAS_MODE_INVALID); in idtfc3_configure_hw()
772 if (err) in idtfc3_configure_hw()
773 return err; in idtfc3_configure_hw()
775 err = idtfc3_get_tdc_offset_sign(idtfc3); in idtfc3_configure_hw()
776 if (err) in idtfc3_configure_hw()
777 return err; in idtfc3_configure_hw()
786 int err; in idtfc3_set_overhead() local
797 err = regmap_bulk_write(idtfc3->regmap, TOD_SYNC_LOAD_VAL_CTRL, in idtfc3_set_overhead()
799 if (err) in idtfc3_set_overhead()
800 return err; in idtfc3_set_overhead()
818 return err; in idtfc3_set_overhead()
823 int err; in idtfc3_enable_ptp() local
830 err = PTR_ERR(idtfc3->ptp_clock); in idtfc3_enable_ptp()
832 return err; in idtfc3_enable_ptp()
835 err = idtfc3_set_overhead(idtfc3); in idtfc3_enable_ptp()
836 if (err) in idtfc3_enable_ptp()
837 return err; in idtfc3_enable_ptp()
839 err = idtfc3_init_timecounter(idtfc3); in idtfc3_enable_ptp()
840 if (err) in idtfc3_enable_ptp()
841 return err; in idtfc3_enable_ptp()
856 int err; in idtfc3_load_firmware() local
866 err = request_firmware(&fw, fname, idtfc3->dev); in idtfc3_load_firmware()
868 if (err) { in idtfc3_load_firmware()
870 "requesting firmware failed with err %d!\n", err); in idtfc3_load_firmware()
871 return err; in idtfc3_load_firmware()
882 err = -EINVAL; in idtfc3_load_firmware()
889 err = idtfc3_set_hw_param(&idtfc3->hw_param, addr, val); in idtfc3_load_firmware()
892 if (err != -EINVAL) { in idtfc3_load_firmware()
893 err = 0; in idtfc3_load_firmware()
899 err = regmap_bulk_write(idtfc3->regmap, addr, in idtfc3_load_firmware()
903 if (err) in idtfc3_load_firmware()
907 err = idtfc3_configure_hw(idtfc3); in idtfc3_load_firmware()
910 return err; in idtfc3_load_firmware()
915 int err; in idtfc3_read_device_id() local
918 err = regmap_bulk_read(idtfc3->regmap, DEVICE_ID, in idtfc3_read_device_id()
920 if (err) { in idtfc3_read_device_id()
921 dev_err(idtfc3->dev, "%s failed with %d", __func__, err); in idtfc3_read_device_id()
922 return err; in idtfc3_read_device_id()
932 int err; in idtfc3_check_device_compatibility() local
935 err = idtfc3_read_device_id(idtfc3, &device_id); in idtfc3_check_device_compatibility()
936 if (err) in idtfc3_check_device_compatibility()
937 return err; in idtfc3_check_device_compatibility()
951 int err; in idtfc3_probe() local
965 err = idtfc3_check_device_compatibility(idtfc3); in idtfc3_probe()
966 if (err) { in idtfc3_probe()
968 return err; in idtfc3_probe()
971 err = idtfc3_load_firmware(idtfc3); in idtfc3_probe()
972 if (err) { in idtfc3_probe()
973 if (err == -ENOENT) { in idtfc3_probe()
977 dev_warn(idtfc3->dev, "loading firmware failed with %d", err); in idtfc3_probe()
980 err = idtfc3_enable_ptp(idtfc3); in idtfc3_probe()
981 if (err) { in idtfc3_probe()
982 dev_err(idtfc3->dev, "idtfc3_enable_ptp failed with %d", err); in idtfc3_probe()
984 return err; in idtfc3_probe()
989 if (err) { in idtfc3_probe()
991 return err; in idtfc3_probe()