Lines Matching full:result

483 	int result = spi_transceive_dt(&config->bus, &tx, &rx);  in ads114s0x_read_register()  local
485 if (result != 0) { in ads114s0x_read_register()
486 LOG_ERR("%s: spi_transceive failed with error %i", dev->name, result); in ads114s0x_read_register()
487 return result; in ads114s0x_read_register()
516 int result = spi_write_dt(&config->bus, &tx); in ads114s0x_write_register() local
518 if (result != 0) { in ads114s0x_write_register()
519 LOG_ERR("%s: spi_write failed with error %i", dev->name, result); in ads114s0x_write_register()
520 return result; in ads114s0x_write_register()
564 int result = spi_write_dt(&config->bus, &tx); in ads114s0x_write_multiple_registers() local
566 if (result != 0) { in ads114s0x_write_multiple_registers()
567 LOG_ERR("%s: spi_write failed with error %i", dev->name, result); in ads114s0x_write_multiple_registers()
568 return result; in ads114s0x_write_multiple_registers()
590 int result = spi_write_dt(&config->bus, &tx); in ads114s0x_send_command() local
592 if (result != 0) { in ads114s0x_send_command()
593 LOG_ERR("%s: spi_write failed with error %i", dev->name, result); in ads114s0x_send_command()
594 return result; in ads114s0x_send_command()
613 int result; in ads114s0x_channel_setup() local
863 result = ads114s0x_write_multiple_registers(dev, register_addresses, values, in ads114s0x_channel_setup()
866 if (result != 0) { in ads114s0x_channel_setup()
868 return result; in ads114s0x_channel_setup()
930 int result; in ads114s0x_adc_start_read() local
933 result = ads114s0x_validate_sequence(dev, sequence); in ads114s0x_adc_start_read()
935 if (result != 0) { in ads114s0x_adc_start_read()
937 return result; in ads114s0x_adc_start_read()
945 result = adc_context_wait_for_completion(&data->ctx); in ads114s0x_adc_start_read()
948 return result; in ads114s0x_adc_start_read()
954 int result; in ads114s0x_send_start_read() local
957 result = ads114s0x_send_command(dev, ADS114S0X_COMMAND_START); in ads114s0x_send_start_read()
958 if (result != 0) { in ads114s0x_send_start_read()
960 return result; in ads114s0x_send_start_read()
963 result = gpio_pin_set_dt(&config->gpio_start_sync, 1); in ads114s0x_send_start_read()
965 if (result != 0) { in ads114s0x_send_start_read()
967 return result; in ads114s0x_send_start_read()
973 result = gpio_pin_set_dt(&config->gpio_start_sync, 0); in ads114s0x_send_start_read()
975 if (result != 0) { in ads114s0x_send_start_read()
977 return result; in ads114s0x_send_start_read()
1015 int result = spi_transceive_dt(&config->bus, &tx, &rx); in ads114s0x_read_sample() local
1017 if (result != 0) { in ads114s0x_read_sample()
1018 LOG_ERR("%s: spi_transceive failed with error %i", dev->name, result); in ads114s0x_read_sample()
1019 return result; in ads114s0x_read_sample()
1030 int result; in ads114s0x_adc_perform_read() local
1036 result = ads114s0x_send_start_read(dev); in ads114s0x_adc_perform_read()
1037 if (result != 0) { in ads114s0x_adc_perform_read()
1039 adc_context_complete(&data->ctx, result); in ads114s0x_adc_perform_read()
1040 return result; in ads114s0x_adc_perform_read()
1043 result = ads114s0x_wait_data_ready(dev); in ads114s0x_adc_perform_read()
1044 if (result != 0) { in ads114s0x_adc_perform_read()
1046 adc_context_complete(&data->ctx, result); in ads114s0x_adc_perform_read()
1047 return result; in ads114s0x_adc_perform_read()
1050 result = ads114s0x_read_sample(dev, data->buffer); in ads114s0x_adc_perform_read()
1051 if (result != 0) { in ads114s0x_adc_perform_read()
1053 adc_context_complete(&data->ctx, result); in ads114s0x_adc_perform_read()
1054 return result; in ads114s0x_adc_perform_read()
1061 return result; in ads114s0x_adc_perform_read()
1068 int result; in ads114s0x_adc_read_async() local
1072 result = ads114s0x_adc_start_read(dev, sequence, true); in ads114s0x_adc_read_async()
1073 adc_context_release(&data->ctx, result); in ads114s0x_adc_read_async()
1075 return result; in ads114s0x_adc_read_async()
1080 int result; in ads114s0x_read() local
1084 result = ads114s0x_adc_start_read(dev, sequence, true); in ads114s0x_read()
1085 adc_context_release(&data->ctx, result); in ads114s0x_read()
1087 return result; in ads114s0x_read()
1093 int result; in ads114s0x_read() local
1097 result = ads114s0x_adc_start_read(dev, sequence, false); in ads114s0x_read()
1099 while (result == 0 && k_sem_take(&data->ctx.sync, K_NO_WAIT) != 0) { in ads114s0x_read()
1100 result = ads114s0x_adc_perform_read(dev); in ads114s0x_read()
1103 adc_context_release(&data->ctx, result); in ads114s0x_read()
1104 return result; in ads114s0x_read()
1156 int result = 0; in ads114s0x_gpio_set_output() local
1174 result = ads114s0x_gpio_write_config(dev); in ads114s0x_gpio_set_output()
1178 return result; in ads114s0x_gpio_set_output()
1184 int result = 0; in ads114s0x_gpio_set_input() local
1197 result = ads114s0x_gpio_write_config(dev); in ads114s0x_gpio_set_input()
1201 return result; in ads114s0x_gpio_set_input()
1207 int result = 0; in ads114s0x_gpio_deconfigure() local
1220 result = ads114s0x_gpio_write_config(dev); in ads114s0x_gpio_deconfigure()
1224 return result; in ads114s0x_gpio_deconfigure()
1230 int result = 0; in ads114s0x_gpio_set_pin_value() local
1241 result = -EINVAL; in ads114s0x_gpio_set_pin_value()
1244 result = -EINVAL; in ads114s0x_gpio_set_pin_value()
1248 result = ads114s0x_gpio_write_value(dev); in ads114s0x_gpio_set_pin_value()
1253 return result; in ads114s0x_gpio_set_pin_value()
1259 int result = 0; in ads114s0x_gpio_get_pin_value() local
1271 result = -EINVAL; in ads114s0x_gpio_get_pin_value()
1274 result = -EINVAL; in ads114s0x_gpio_get_pin_value()
1276 result = ads114s0x_read_register(dev, ADS114S0X_REGISTER_GPIODAT, &gpio_dat); in ads114s0x_gpio_get_pin_value()
1283 return result; in ads114s0x_gpio_get_pin_value()
1289 int result = 0; in ads114s0x_gpio_port_get_raw() local
1294 result = ads114s0x_read_register(dev, ADS114S0X_REGISTER_GPIODAT, &gpio_dat); in ads114s0x_gpio_port_get_raw()
1300 return result; in ads114s0x_gpio_port_get_raw()
1307 int result = 0; in ads114s0x_gpio_port_set_masked_raw() local
1313 result = ads114s0x_gpio_write_value(dev); in ads114s0x_gpio_port_set_masked_raw()
1317 return result; in ads114s0x_gpio_port_set_masked_raw()
1323 int result = 0; in ads114s0x_gpio_port_toggle_bits() local
1328 result = ads114s0x_gpio_write_value(dev); in ads114s0x_gpio_port_toggle_bits()
1332 return result; in ads114s0x_gpio_port_toggle_bits()
1342 int result; in ads114s0x_init() local
1361 result = gpio_pin_configure_dt(&config->gpio_reset, GPIO_OUTPUT_ACTIVE); in ads114s0x_init()
1362 if (result != 0) { in ads114s0x_init()
1364 return result; in ads114s0x_init()
1369 result = gpio_pin_configure_dt(&config->gpio_start_sync, GPIO_OUTPUT_INACTIVE); in ads114s0x_init()
1370 if (result != 0) { in ads114s0x_init()
1372 return result; in ads114s0x_init()
1376 result = gpio_pin_configure_dt(&config->gpio_data_ready, GPIO_INPUT); in ads114s0x_init()
1377 if (result != 0) { in ads114s0x_init()
1379 return result; in ads114s0x_init()
1382 result = gpio_pin_interrupt_configure_dt(&config->gpio_data_ready, GPIO_INT_EDGE_TO_ACTIVE); in ads114s0x_init()
1383 if (result != 0) { in ads114s0x_init()
1390 result = gpio_add_callback(config->gpio_data_ready.port, &data->callback_data_ready); in ads114s0x_init()
1391 if (result != 0) { in ads114s0x_init()
1407 result = ads114s0x_send_command(dev, ADS114S0X_COMMAND_RESET); in ads114s0x_init()
1408 if (result != 0) { in ads114s0x_init()
1410 return result; in ads114s0x_init()
1419 result = ads114s0x_read_register(dev, ADS114S0X_REGISTER_STATUS, &status); in ads114s0x_init()
1420 if (result != 0) { in ads114s0x_init()
1422 return result; in ads114s0x_init()
1436 result = ads114s0x_write_register(dev, ADS114S0X_REGISTER_REF, reference_control); in ads114s0x_init()
1437 if (result != 0) { in ads114s0x_init()
1439 return result; in ads114s0x_init()
1445 result = ads114s0x_read_register(dev, ADS114S0X_REGISTER_REF, &reference_control_read); in ads114s0x_init()
1446 if (result != 0) { in ads114s0x_init()
1448 return result; in ads114s0x_init()
1462 result = ads114s0x_gpio_write_config(dev); in ads114s0x_init()
1464 if (result != 0) { in ads114s0x_init()
1466 return result; in ads114s0x_init()
1472 return result; in ads114s0x_init()