Lines Matching full:rc

63 #define DPS310_POLL_TIMEOUT_US(rc)	((rc) <= 0 ? 1000000 : 1000000 / (rc))  argument
113 int rc; in dps310_get_coefs() local
119 rc = regmap_bulk_read(data->regmap, DPS310_COEF_BASE, coef, in dps310_get_coefs()
121 if (rc < 0) in dps310_get_coefs()
122 return rc; in dps310_get_coefs()
170 int rc; in dps310_temp_workaround() local
173 rc = regmap_read(data->regmap, 0x32, &reg); in dps310_temp_workaround()
174 if (rc < 0) in dps310_temp_workaround()
175 return rc; in dps310_temp_workaround()
184 rc = regmap_write(data->regmap, 0x0e, 0xA5); in dps310_temp_workaround()
185 if (rc) in dps310_temp_workaround()
186 return rc; in dps310_temp_workaround()
188 rc = regmap_write(data->regmap, 0x0f, 0x96); in dps310_temp_workaround()
189 if (rc) in dps310_temp_workaround()
190 return rc; in dps310_temp_workaround()
192 rc = regmap_write(data->regmap, 0x62, 0x02); in dps310_temp_workaround()
193 if (rc) in dps310_temp_workaround()
194 return rc; in dps310_temp_workaround()
196 rc = regmap_write(data->regmap, 0x0e, 0x00); in dps310_temp_workaround()
197 if (rc) in dps310_temp_workaround()
198 return rc; in dps310_temp_workaround()
205 int rc; in dps310_startup() local
212 rc = regmap_write(data->regmap, DPS310_PRS_CFG, 0); in dps310_startup()
213 if (rc) in dps310_startup()
214 return rc; in dps310_startup()
220 rc = regmap_write(data->regmap, DPS310_TMP_CFG, DPS310_TMP_EXT); in dps310_startup()
221 if (rc) in dps310_startup()
222 return rc; in dps310_startup()
225 rc = regmap_write_bits(data->regmap, DPS310_CFG_REG, in dps310_startup()
227 if (rc) in dps310_startup()
228 return rc; in dps310_startup()
231 rc = regmap_write_bits(data->regmap, DPS310_MEAS_CFG, in dps310_startup()
233 if (rc) in dps310_startup()
234 return rc; in dps310_startup()
237 rc = regmap_write_bits(data->regmap, DPS310_MEAS_CFG, in dps310_startup()
240 if (rc) in dps310_startup()
241 return rc; in dps310_startup()
247 rc = regmap_read_poll_timeout(data->regmap, DPS310_MEAS_CFG, ready, in dps310_startup()
249 if (rc) in dps310_startup()
250 return rc; in dps310_startup()
252 rc = dps310_get_coefs(data); in dps310_startup()
253 if (rc) in dps310_startup()
254 return rc; in dps310_startup()
261 int reg_val, rc; in dps310_get_pres_precision() local
263 rc = regmap_read(data->regmap, DPS310_PRS_CFG, &reg_val); in dps310_get_pres_precision()
264 if (rc < 0) in dps310_get_pres_precision()
265 return rc; in dps310_get_pres_precision()
274 int reg_val, rc; in dps310_get_temp_precision() local
276 rc = regmap_read(data->regmap, DPS310_TMP_CFG, &reg_val); in dps310_get_temp_precision()
277 if (rc < 0) in dps310_get_temp_precision()
278 return rc; in dps310_get_temp_precision()
292 int rc; in dps310_set_pres_precision() local
299 rc = regmap_write_bits(data->regmap, DPS310_CFG_REG, in dps310_set_pres_precision()
301 if (rc) in dps310_set_pres_precision()
302 return rc; in dps310_set_pres_precision()
311 int rc; in dps310_set_temp_precision() local
318 rc = regmap_write_bits(data->regmap, DPS310_CFG_REG, in dps310_set_temp_precision()
320 if (rc) in dps310_set_temp_precision()
321 return rc; in dps310_set_temp_precision()
357 int reg_val, rc; in dps310_get_pres_samp_freq() local
359 rc = regmap_read(data->regmap, DPS310_PRS_CFG, &reg_val); in dps310_get_pres_samp_freq()
360 if (rc < 0) in dps310_get_pres_samp_freq()
361 return rc; in dps310_get_pres_samp_freq()
370 int reg_val, rc; in dps310_get_temp_samp_freq() local
372 rc = regmap_read(data->regmap, DPS310_TMP_CFG, &reg_val); in dps310_get_temp_samp_freq()
373 if (rc < 0) in dps310_get_temp_samp_freq()
374 return rc; in dps310_get_temp_samp_freq()
383 int reg_val, rc; in dps310_get_pres_k() local
385 rc = regmap_read(data->regmap, DPS310_PRS_CFG, &reg_val); in dps310_get_pres_k()
386 if (rc < 0) in dps310_get_pres_k()
387 return rc; in dps310_get_pres_k()
396 int reg_val, rc; in dps310_get_temp_k() local
398 rc = regmap_read(data->regmap, DPS310_TMP_CFG, &reg_val); in dps310_get_temp_k()
399 if (rc < 0) in dps310_get_temp_k()
400 return rc; in dps310_get_temp_k()
409 int rc; in dps310_reset_wait() local
411 rc = regmap_write(data->regmap, DPS310_RESET, DPS310_RESET_MAGIC); in dps310_reset_wait()
412 if (rc) in dps310_reset_wait()
413 return rc; in dps310_reset_wait()
422 int rc; in dps310_reset_reinit() local
424 rc = dps310_reset_wait(data); in dps310_reset_reinit()
425 if (rc) in dps310_reset_reinit()
426 return rc; in dps310_reset_reinit()
442 int rc; in dps310_ready() local
444 rc = dps310_ready_status(data, ready_bit, timeout); in dps310_ready()
445 if (rc) { in dps310_ready()
446 if (rc == -ETIMEDOUT && !data->timeout_recovery_failed) { in dps310_ready()
459 return rc; in dps310_ready()
468 int rc; in dps310_read_pres_raw() local
477 rc = dps310_get_pres_samp_freq(data, &rate); in dps310_read_pres_raw()
478 if (rc) in dps310_read_pres_raw()
484 rc = dps310_ready(data, DPS310_PRS_RDY, timeout); in dps310_read_pres_raw()
485 if (rc) in dps310_read_pres_raw()
488 rc = regmap_bulk_read(data->regmap, DPS310_PRS_BASE, val, sizeof(val)); in dps310_read_pres_raw()
489 if (rc < 0) in dps310_read_pres_raw()
497 return rc; in dps310_read_pres_raw()
503 int rc; in dps310_read_temp_ready() local
507 rc = regmap_bulk_read(data->regmap, DPS310_TMP_BASE, val, sizeof(val)); in dps310_read_temp_ready()
508 if (rc < 0) in dps310_read_temp_ready()
509 return rc; in dps310_read_temp_ready()
519 int rc; in dps310_read_temp_raw() local
526 rc = dps310_get_temp_samp_freq(data, &rate); in dps310_read_temp_raw()
527 if (rc) in dps310_read_temp_raw()
533 rc = dps310_ready(data, DPS310_TMP_RDY, timeout); in dps310_read_temp_raw()
534 if (rc) in dps310_read_temp_raw()
537 rc = dps310_read_temp_ready(data); in dps310_read_temp_raw()
541 return rc; in dps310_read_temp_raw()
583 int rc; in dps310_write_raw() local
593 rc = dps310_set_pres_samp_freq(data, val); in dps310_write_raw()
597 rc = dps310_set_temp_samp_freq(data, val); in dps310_write_raw()
601 rc = -EINVAL; in dps310_write_raw()
609 rc = dps310_set_pres_precision(data, val); in dps310_write_raw()
613 rc = dps310_set_temp_precision(data, val); in dps310_write_raw()
617 rc = -EINVAL; in dps310_write_raw()
623 rc = -EINVAL; in dps310_write_raw()
628 return rc; in dps310_write_raw()
634 int rc; in dps310_calculate_pressure() local
648 rc = dps310_get_pres_k(data, &kpi); in dps310_calculate_pressure()
649 if (rc) in dps310_calculate_pressure()
650 return rc; in dps310_calculate_pressure()
652 rc = dps310_get_temp_k(data, &kti); in dps310_calculate_pressure()
653 if (rc) in dps310_calculate_pressure()
654 return rc; in dps310_calculate_pressure()
661 rc = regmap_read(data->regmap, DPS310_MEAS_CFG, &t_ready); in dps310_calculate_pressure()
662 if (rc >= 0 && t_ready & DPS310_TMP_RDY) in dps310_calculate_pressure()
716 int rc; in dps310_read_pressure() local
720 rc = dps310_get_pres_samp_freq(data, val); in dps310_read_pressure()
721 if (rc) in dps310_read_pressure()
722 return rc; in dps310_read_pressure()
727 rc = dps310_read_pres_raw(data); in dps310_read_pressure()
728 if (rc) in dps310_read_pressure()
729 return rc; in dps310_read_pressure()
731 rc = dps310_calculate_pressure(data, val); in dps310_read_pressure()
732 if (rc) in dps310_read_pressure()
733 return rc; in dps310_read_pressure()
739 rc = dps310_get_pres_precision(data, val); in dps310_read_pressure()
740 if (rc) in dps310_read_pressure()
741 return rc; in dps310_read_pressure()
753 int kt, rc; in dps310_calculate_temp() local
755 rc = dps310_get_temp_k(data, &kt); in dps310_calculate_temp()
756 if (rc) in dps310_calculate_temp()
757 return rc; in dps310_calculate_temp()
774 int rc; in dps310_read_temp() local
778 rc = dps310_get_temp_samp_freq(data, val); in dps310_read_temp()
779 if (rc) in dps310_read_temp()
780 return rc; in dps310_read_temp()
785 rc = dps310_read_temp_raw(data); in dps310_read_temp()
786 if (rc) in dps310_read_temp()
787 return rc; in dps310_read_temp()
789 rc = dps310_calculate_temp(data, val); in dps310_read_temp()
790 if (rc) in dps310_read_temp()
791 return rc; in dps310_read_temp()
796 rc = dps310_get_temp_precision(data, val); in dps310_read_temp()
797 if (rc) in dps310_read_temp()
798 return rc; in dps310_read_temp()
851 int rc; in dps310_probe() local
872 rc = devm_add_action_or_reset(&client->dev, dps310_reset, data); in dps310_probe()
873 if (rc) in dps310_probe()
874 return rc; in dps310_probe()
876 rc = dps310_startup(data); in dps310_probe()
877 if (rc) in dps310_probe()
878 return rc; in dps310_probe()
880 rc = devm_iio_device_register(&client->dev, iio); in dps310_probe()
881 if (rc) in dps310_probe()
882 return rc; in dps310_probe()