X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fkingst-la2016%2Fprotocol.c;h=9ecaa7180961d4c18299705a4916c7a8b23ba24a;hp=00cda3521eb0323770d89f16e1623c7530242f81;hb=6d53e9497892df15e13899465ce4c2962a70a782;hpb=64172b16d97a23a6c755f090401acb0f7c36ed86 diff --git a/src/hardware/kingst-la2016/protocol.c b/src/hardware/kingst-la2016/protocol.c index 00cda352..9ecaa718 100644 --- a/src/hardware/kingst-la2016/protocol.c +++ b/src/hardware/kingst-la2016/protocol.c @@ -1371,7 +1371,7 @@ SR_PRIV int la2016_identify_device(const struct sr_dev_inst *sdi, return SR_OK; } -SR_PRIV int la2016_init_device(const struct sr_dev_inst *sdi) +SR_PRIV int la2016_init_hardware(const struct sr_dev_inst *sdi) { struct dev_context *devc; const char *bitstream_fn; @@ -1400,13 +1400,21 @@ SR_PRIV int la2016_init_device(const struct sr_dev_inst *sdi) sr_warn("Unexpected run state, want 0x85e9, got 0x%04x.", state); } - if ((ret = ctrl_out(sdi, CMD_BULK_RESET, 0x00, 0, NULL, 0)) != SR_OK) { + ret = ctrl_out(sdi, CMD_BULK_RESET, 0x00, 0, NULL, 0); + if (ret != SR_OK) { sr_err("Cannot reset USB bulk transfer."); return ret; } sr_dbg("Device should be initialized."); + return SR_OK; +} + +SR_PRIV int la2016_init_params(const struct sr_dev_inst *sdi) +{ + int ret; + ret = set_defaults(sdi); if (ret != SR_OK) return ret; @@ -1414,11 +1422,12 @@ SR_PRIV int la2016_init_device(const struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV int la2016_deinit_device(const struct sr_dev_inst *sdi) +SR_PRIV int la2016_deinit_hardware(const struct sr_dev_inst *sdi) { int ret; - if ((ret = ctrl_out(sdi, CMD_FPGA_ENABLE, 0x00, 0, NULL, 0)) != SR_OK) { + ret = ctrl_out(sdi, CMD_FPGA_ENABLE, 0x00, 0, NULL, 0); + if (ret != SR_OK) { sr_err("Cannot deinitialize device's FPGA."); return ret; }