Lines Matching refs:retval

121 	int retval;  in tmag5273_check_device_status()  local
128 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_CONV_STATUS, device_status); in tmag5273_check_device_status()
129 if (retval < 0) { in tmag5273_check_device_status()
130 LOG_ERR("error reading CONV_STATUS %d", retval); in tmag5273_check_device_status()
131 return retval; in tmag5273_check_device_status()
140 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_DEVICE_STATUS, device_status); in tmag5273_check_device_status()
141 if (retval < 0) { in tmag5273_check_device_status()
142 LOG_ERR("error reading DEVICE_STATUS %d", retval); in tmag5273_check_device_status()
143 return retval; in tmag5273_check_device_status()
176 int retval; in tmag5273_dev_int_trigger() local
178 retval = gpio_pin_configure_dt(&drv_cfg->int_gpio, GPIO_OUTPUT); in tmag5273_dev_int_trigger()
179 if (retval < 0) { in tmag5273_dev_int_trigger()
180 return retval; in tmag5273_dev_int_trigger()
183 retval = gpio_pin_set_dt(&drv_cfg->int_gpio, 1); in tmag5273_dev_int_trigger()
184 if (retval < 0) { in tmag5273_dev_int_trigger()
185 return retval; in tmag5273_dev_int_trigger()
188 retval = gpio_pin_set_dt(&drv_cfg->int_gpio, 0); in tmag5273_dev_int_trigger()
189 if (retval < 0) { in tmag5273_dev_int_trigger()
190 return retval; in tmag5273_dev_int_trigger()
193 retval = gpio_pin_configure_dt(&drv_cfg->int_gpio, GPIO_INPUT); in tmag5273_dev_int_trigger()
194 if (retval < 0) { in tmag5273_dev_int_trigger()
195 return retval; in tmag5273_dev_int_trigger()
252 int retval; in tmag5273_attr_set_xyz_meas_range() local
264 retval = i2c_reg_update_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_2, in tmag5273_attr_set_xyz_meas_range()
266 if (retval < 0) { in tmag5273_attr_set_xyz_meas_range()
267 return retval; in tmag5273_attr_set_xyz_meas_range()
291 int retval; in tmag5273_attr_get_xyz_meas_range() local
293 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_2, &regdata); in tmag5273_attr_get_xyz_meas_range()
294 if (retval < 0) { in tmag5273_attr_get_xyz_meas_range()
295 return retval; in tmag5273_attr_get_xyz_meas_range()
323 int retval; in tmag5273_attr_set_xyz_calc() local
355 retval = i2c_reg_update_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_2, in tmag5273_attr_set_xyz_calc()
357 if (retval < 0) { in tmag5273_attr_set_xyz_calc()
358 return retval; in tmag5273_attr_set_xyz_calc()
378 int retval; in tmag5273_attr_get_xyz_calc() local
380 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_2, &regdata); in tmag5273_attr_get_xyz_calc()
381 if (retval < 0) { in tmag5273_attr_get_xyz_calc()
382 return retval; in tmag5273_attr_get_xyz_calc()
450 int retval; in tmag5273_attr_set() local
458 retval = tmag5273_attr_set_xyz_meas_range(dev, val); in tmag5273_attr_set()
459 if (retval < 0) { in tmag5273_attr_set()
460 return retval; in tmag5273_attr_set()
468 retval = tmag5273_attr_set_xyz_calc(dev, val); in tmag5273_attr_set()
469 if (retval < 0) { in tmag5273_attr_set()
470 return retval; in tmag5273_attr_set()
500 int retval; in tmag5273_attr_get() local
508 retval = tmag5273_attr_get_xyz_meas_range(dev, val); in tmag5273_attr_get()
509 if (retval < 0) { in tmag5273_attr_get()
510 return retval; in tmag5273_attr_get()
518 retval = tmag5273_attr_get_xyz_calc(dev, val); in tmag5273_attr_get()
519 if (retval < 0) { in tmag5273_attr_get()
520 return retval; in tmag5273_attr_get()
536 int retval; in tmag5273_sample_fetch() local
543 retval = tmag5273_dev_int_trigger(drv_cfg); in tmag5273_sample_fetch()
544 if (retval < 0) { in tmag5273_sample_fetch()
545 return retval; in tmag5273_sample_fetch()
553 retval = i2c_reg_read_byte_dt( in tmag5273_sample_fetch()
556 if (retval < 0) { in tmag5273_sample_fetch()
557 LOG_ERR("error reading conversion state %d", retval); in tmag5273_sample_fetch()
558 return retval; in tmag5273_sample_fetch()
677 retval = i2c_burst_read_dt(&drv_cfg->i2c, start_address, &i2c_buffer[offset], in tmag5273_sample_fetch()
680 if (retval < 0) { in tmag5273_sample_fetch()
681 LOG_ERR("could not read result data %d", retval); in tmag5273_sample_fetch()
706 retval = tmag5273_check_device_status( in tmag5273_sample_fetch()
708 if (retval < 0) { in tmag5273_sample_fetch()
709 return retval; in tmag5273_sample_fetch()
906 int retval; in tmag5273_init_device_config() local
966 retval = i2c_reg_write_byte_dt(&drv_cfg->i2c, TMAG5273_REG_DEVICE_CONFIG_1, regdata); in tmag5273_init_device_config()
967 if (retval < 0) { in tmag5273_init_device_config()
968 LOG_ERR("error setting DEVICE_CONFIG_1 %d", retval); in tmag5273_init_device_config()
989 retval = i2c_reg_write_byte_dt(&drv_cfg->i2c, TMAG5273_REG_DEVICE_CONFIG_2, regdata); in tmag5273_init_device_config()
990 if (retval < 0) { in tmag5273_init_device_config()
991 LOG_ERR("error setting DEVICE_CONFIG_2 %d", retval); in tmag5273_init_device_config()
1009 int retval; in tmag5273_init_sensor_settings() local
1015 retval = i2c_reg_write_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_1, regdata); in tmag5273_init_sensor_settings()
1016 if (retval < 0) { in tmag5273_init_sensor_settings()
1017 LOG_ERR("error setting SENSOR_CONFIG_1 %d", retval); in tmag5273_init_sensor_settings()
1052 retval = i2c_reg_write_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_2, regdata); in tmag5273_init_sensor_settings()
1053 if (retval < 0) { in tmag5273_init_sensor_settings()
1054 LOG_ERR("error setting SENSOR_CONFIG_2 %d", retval); in tmag5273_init_sensor_settings()
1069 retval = i2c_reg_write_byte_dt(&drv_cfg->i2c, TMAG5273_REG_T_CONFIG, regdata); in tmag5273_init_sensor_settings()
1070 if (retval < 0) { in tmag5273_init_sensor_settings()
1071 LOG_ERR("error setting SENSOR_CONFIG_2 %d", retval); in tmag5273_init_sensor_settings()
1091 int retval; in tmag5273_init() local
1105 retval = gpio_pin_configure_dt(&drv_cfg->int_gpio, GPIO_INPUT); in tmag5273_init()
1106 if (retval < 0) { in tmag5273_init()
1107 LOG_ERR("cannot configure GPIO %d", retval); in tmag5273_init()
1112 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_DEVICE_CONFIG_2, &regdata); in tmag5273_init()
1113 if (retval < 0) { in tmag5273_init()
1114 LOG_ERR("could not read device config 2 register %d", retval); in tmag5273_init()
1120 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_MANUFACTURER_ID_LSB, &regdata); in tmag5273_init()
1121 if (retval < 0) { in tmag5273_init()
1130 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_MANUFACTURER_ID_MSB, &regdata); in tmag5273_init()
1131 if (retval < 0) { in tmag5273_init()
1132 LOG_ERR("could not read MSB of manufacturer id %d", retval); in tmag5273_init()
1143 retval = tmag5273_reset_device_status(dev); in tmag5273_init()
1144 if (retval < 0) { in tmag5273_init()
1145 LOG_ERR("could not reset DEVICE_STATUS register %d", retval); in tmag5273_init()
1149 retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_DEVICE_ID, &regdata); in tmag5273_init()
1150 if (retval < 0) { in tmag5273_init()
1151 LOG_ERR("could not read DEVICE_ID register %d", retval); in tmag5273_init()
1170 retval = i2c_reg_write_byte_dt(&drv_cfg->i2c, TMAG5273_REG_INT_CONFIG_1, regdata); in tmag5273_init()
1171 if (retval < 0) { in tmag5273_init()
1172 LOG_ERR("error deactivating interrupts %d", retval); in tmag5273_init()
1177 retval = tmag5273_init_sensor_settings(drv_cfg, drv_data->version); in tmag5273_init()
1178 if (retval < 0) { in tmag5273_init()
1179 LOG_ERR("error setting sensor configuration %d", retval); in tmag5273_init()
1180 return retval; in tmag5273_init()
1183 retval = tmag5273_init_device_config(dev); in tmag5273_init()
1184 if (retval < 0) { in tmag5273_init()
1185 LOG_ERR("error setting device configuration %d", retval); in tmag5273_init()
1186 return retval; in tmag5273_init()