Lines Matching refs:rc

115 	int rc;  in si7210_sleep()  local
121 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_CTRL3, 0); in si7210_sleep()
122 if (rc < 0) { in si7210_sleep()
124 return rc; in si7210_sleep()
128 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_POWER_CTRL, in si7210_sleep()
130 if (rc < 0) { in si7210_sleep()
132 return rc; in si7210_sleep()
147 int rc; in si7210_wakeup() local
154 rc = i2c_read_dt(&config->bus, &val, 1); in si7210_wakeup()
155 if (rc < 0) { in si7210_wakeup()
157 return rc; in si7210_wakeup()
169 int rc; in si7210_reset() local
171 rc = si7210_sleep(dev); in si7210_reset()
172 if (rc < 0) { in si7210_reset()
173 return rc; in si7210_reset()
176 rc = si7210_wakeup(dev); in si7210_reset()
178 return rc; in si7210_reset()
185 int rc; in si7210_otp_reg_read_byte() local
187 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_OTP_ADDR, otp_reg_addr); in si7210_otp_reg_read_byte()
188 if (rc) { in si7210_otp_reg_read_byte()
190 return rc; in si7210_otp_reg_read_byte()
193 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_OTP_CTRL, SI7210_BIT_OTP_CTRL_READEN); in si7210_otp_reg_read_byte()
194 if (rc) { in si7210_otp_reg_read_byte()
196 return rc; in si7210_otp_reg_read_byte()
204 rc = i2c_reg_read_byte_dt(&config->bus, SI7210_REG_OTP_DATA, value); in si7210_otp_reg_read_byte()
205 if (rc) { in si7210_otp_reg_read_byte()
207 return rc; in si7210_otp_reg_read_byte()
219 int rc; in si7210_read_sn() local
221 rc = si7210_otp_reg_read_byte(dev, reg, &val8); in si7210_read_sn()
222 if (rc < 0) { in si7210_read_sn()
223 return rc; in si7210_read_sn()
239 int rc; in si7210_set_dspsigsel() local
245 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_DSPSIGSEL, value); in si7210_set_dspsigsel()
246 if (rc < 0) { in si7210_set_dspsigsel()
248 return rc; in si7210_set_dspsigsel()
261 int rc; in si7210_set_arautoinc() local
267 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_ARAUTOINC, value); in si7210_set_arautoinc()
268 if (rc < 0) { in si7210_set_arautoinc()
270 return rc; in si7210_set_arautoinc()
282 int rc; in si7210_sample_fetch_one() local
285 rc = si7210_set_dspsigsel(dev, channel); in si7210_sample_fetch_one()
286 if (rc < 0) { in si7210_sample_fetch_one()
287 return rc; in si7210_sample_fetch_one()
291 rc = si7210_set_arautoinc(dev, 1); in si7210_sample_fetch_one()
292 if (rc < 0) { in si7210_sample_fetch_one()
293 return rc; in si7210_sample_fetch_one()
297 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_POWER_CTRL, in si7210_sample_fetch_one()
299 if (rc < 0) { in si7210_sample_fetch_one()
301 return rc; in si7210_sample_fetch_one()
310 rc = i2c_burst_read_dt(&config->bus, SI7210_REG_DSPSIGM, (uint8_t *)&val, sizeof(val)); in si7210_sample_fetch_one()
311 if (rc < 0) { in si7210_sample_fetch_one()
313 return rc; in si7210_sample_fetch_one()
325 int rc; in si7210_sample_fetch() local
344 rc = si7210_sample_fetch_one(dev, SI7210_BIT_DSPSIGSEL_TEMP, &dspsig); in si7210_sample_fetch()
345 if (rc < 0) { in si7210_sample_fetch()
346 return rc; in si7210_sample_fetch()
354 rc = si7210_sample_fetch_one(dev, SI7210_BIT_DSPSIGSEL_MAG, &dspsig); in si7210_sample_fetch()
355 if (rc < 0) { in si7210_sample_fetch()
356 return rc; in si7210_sample_fetch()
433 int rc; in si7210_pm_action() local
438 rc = si7210_wakeup(dev); in si7210_pm_action()
442 rc = si7210_sleep(dev); in si7210_pm_action()
448 return rc; in si7210_pm_action()
459 int rc; in si7210_init() local
467 rc = si7210_wakeup(dev); in si7210_init()
468 if (rc < 0) { in si7210_init()
470 return rc; in si7210_init()
474 rc = i2c_reg_read_byte_dt(&config->bus, SI7210_REG_CHIPID, &chipid); in si7210_init()
475 if (rc < 0) { in si7210_init()
477 return rc; in si7210_init()
494 rc = si7210_otp_reg_read_byte(dev, SI7210_OTPREG_PART_BASE, &part_base); in si7210_init()
495 if (rc < 0) { in si7210_init()
496 return rc; in si7210_init()
498 rc = si7210_otp_reg_read_byte(dev, SI7210_OTPREG_PART_VARIANT, &part_variant); in si7210_init()
499 if (rc < 0) { in si7210_init()
500 return rc; in si7210_init()
504 rc = si7210_read_sn(dev, &sn); in si7210_init()
505 if (rc < 0) { in si7210_init()
506 return rc; in si7210_init()
517 rc = si7210_otp_reg_read_byte(dev, SI7210_OTPREG_TEMP_OFFSET, &data->otp_temp_offset); in si7210_init()
518 if (rc < 0) { in si7210_init()
519 return rc; in si7210_init()
521 rc = si7210_otp_reg_read_byte(dev, SI7210_OTPREG_TEMP_GAIN, &data->otp_temp_gain); in si7210_init()
522 if (rc < 0) { in si7210_init()
523 return rc; in si7210_init()
527 rc = si7210_reset(dev); in si7210_init()
528 if (rc < 0) { in si7210_init()
530 return rc; in si7210_init()