Lines Matching refs:ret
99 int ret; in ak8963_execute_rw() local
106 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_execute_rw()
109 if (ret < 0) { in ak8963_execute_rw()
111 return ret; in ak8963_execute_rw()
115 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_execute_rw()
118 if (ret < 0) { in ak8963_execute_rw()
120 return ret; in ak8963_execute_rw()
124 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_execute_rw()
127 if (ret < 0) { in ak8963_execute_rw()
129 return ret; in ak8963_execute_rw()
134 ret = i2c_reg_read_byte_dt(&cfg->i2c, in ak8963_execute_rw()
136 if (ret < 0) { in ak8963_execute_rw()
138 return ret; in ak8963_execute_rw()
148 int ret; in ak8963_read_reg() local
151 ret = ak8963_execute_rw(dev, reg, false); in ak8963_read_reg()
152 if (ret < 0) { in ak8963_read_reg()
154 return ret; in ak8963_read_reg()
158 ret = i2c_reg_read_byte_dt(&cfg->i2c, in ak8963_read_reg()
160 if (ret < 0) { in ak8963_read_reg()
162 return ret; in ak8963_read_reg()
171 int ret; in ak8963_write_reg() local
174 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_write_reg()
176 if (ret < 0) { in ak8963_write_reg()
178 return ret; in ak8963_write_reg()
182 ret = ak8963_execute_rw(dev, reg, true); in ak8963_write_reg()
183 if (ret < 0) { in ak8963_write_reg()
185 return ret; in ak8963_write_reg()
194 int ret; in ak8963_set_mode() local
196 ret = ak8963_write_reg(dev, AK8963_REG_CNTL1, mode); in ak8963_set_mode()
197 if (ret < 0) { in ak8963_set_mode()
199 return ret; in ak8963_set_mode()
229 int ret; in ak8963_fetch_adj() local
232 ret = ak8963_set_mode(dev, AK8963_REG_CNTL1_FUSE_ROM_VAL); in ak8963_fetch_adj()
233 if (ret < 0) { in ak8963_fetch_adj()
235 return ret; in ak8963_fetch_adj()
238 ret = ak8963_read_reg(dev, AK8963_REG_ADJ_DATA_X, &buf); in ak8963_fetch_adj()
239 if (ret < 0) { in ak8963_fetch_adj()
241 return ret; in ak8963_fetch_adj()
245 ret = ak8963_read_reg(dev, AK8963_REG_ADJ_DATA_Y, &buf); in ak8963_fetch_adj()
246 if (ret < 0) { in ak8963_fetch_adj()
248 return ret; in ak8963_fetch_adj()
252 ret = ak8963_read_reg(dev, AK8963_REG_ADJ_DATA_Z, &buf); in ak8963_fetch_adj()
253 if (ret < 0) { in ak8963_fetch_adj()
255 return ret; in ak8963_fetch_adj()
260 ret = ak8963_set_mode(dev, AK8963_REG_CNTL1_POWERDOWN_VAL); in ak8963_fetch_adj()
261 if (ret < 0) { in ak8963_fetch_adj()
263 return ret; in ak8963_fetch_adj()
274 int ret; in ak8963_reset() local
277 ret = ak8963_write_reg(dev, AK8963_REG_CNTL2, in ak8963_reset()
279 if (ret < 0) { in ak8963_reset()
281 return ret; in ak8963_reset()
293 int ret; in ak8963_init_master() local
296 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_master()
299 if (ret < 0) { in ak8963_init_master()
301 return ret; in ak8963_init_master()
305 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_master()
308 if (ret < 0) { in ak8963_init_master()
310 return ret; in ak8963_init_master()
319 int ret; in ak8963_init_readout() local
322 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_readout()
325 if (ret < 0) { in ak8963_init_readout()
327 return ret; in ak8963_init_readout()
331 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_readout()
333 if (ret < 0) { in ak8963_init_readout()
335 return ret; in ak8963_init_readout()
339 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_readout()
342 if (ret < 0) { in ak8963_init_readout()
344 return ret; in ak8963_init_readout()
353 int ret; in ak8963_init() local
355 ret = ak8963_init_master(dev); in ak8963_init()
356 if (ret < 0) { in ak8963_init()
358 return ret; in ak8963_init()
361 ret = ak8963_reset(dev); in ak8963_init()
362 if (ret < 0) { in ak8963_init()
364 return ret; in ak8963_init()
368 ret = ak8963_read_reg(dev, AK8963_REG_ID, &buf); in ak8963_init()
369 if (ret < 0) { in ak8963_init()
371 return ret; in ak8963_init()
380 ret = ak8963_fetch_adj(dev); in ak8963_init()
381 if (ret < 0) { in ak8963_init()
383 return ret; in ak8963_init()
387 ret = ak8963_set_mode(dev, AK8963_REG_CNTL1_16BIT_100HZ_VAL); in ak8963_init()
388 if (ret < 0) { in ak8963_init()
390 return ret; in ak8963_init()
394 ret = ak8963_init_readout(dev); in ak8963_init()
395 if (ret < 0) { in ak8963_init()
397 return ret; in ak8963_init()