]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/api.c
sr: add new driver API call: scan()
[libsigrok.git] / hardware / chronovu-la8 / api.c
index 81466917f67c228e75d76883a5801437af9edf4b..08348e72b502929ca4f1d3f542279f2ef1023106 100644 (file)
@@ -39,16 +39,21 @@ static const uint16_t usb_pids[] = {
 /* Function prototypes. */
 static int hw_dev_acquisition_stop(int dev_index, void *cb_data);
 
-static int hw_init(const char *devinfo)
+static int hw_init(void)
+{
+
+       /* Nothing to do. */
+
+       return SR_OK;
+}
+
+static int hw_scan(void)
 {
        int ret;
        struct sr_dev_inst *sdi;
        struct context *ctx;
        unsigned int i;
 
-       /* Avoid compiler errors. */
-       (void)devinfo;
-
        /* Allocate memory for our private driver context. */
        if (!(ctx = g_try_malloc(sizeof(struct context)))) {
                sr_err("la8: %s: struct context malloc failed", __func__);
@@ -70,6 +75,7 @@ static int hw_init(const char *devinfo)
        ctx->done = 0;
        ctx->block_counter = 0;
        ctx->divcount = 0; /* 10ns sample period == 100MHz samplerate */
+       ctx->usb_pid = 0;
 
        /* Allocate memory where we'll store the de-mangled data. */
        if (!(ctx->final_buf = g_try_malloc(SDRAM_SIZE))) {
@@ -544,6 +550,7 @@ SR_PRIV struct sr_dev_driver chronovu_la8_driver_info = {
        .api_version = 1,
        .init = hw_init,
        .cleanup = hw_cleanup,
+       .scan = hw_scan,
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .dev_info_get = hw_dev_info_get,