]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
sr: remove obsolete SR_DI_INST
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index ea12da8b863caf82abdc872ecb0e9c8f42c24723..f801f5876a8ec6b965456b6a95d482296b359d8d 100644 (file)
@@ -443,12 +443,13 @@ static int hw_init(void)
 static GSList *hw_scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
+       struct sr_probe *probe;
        struct context *ctx;
        GSList *devices;
        struct ftdi_device_list *devlist;
        char serial_txt[10];
        uint32_t serial;
-       int ret;
+       int ret, i;
 
        (void)options;
        devices = NULL;
@@ -499,6 +500,14 @@ static GSList *hw_scan(GSList *options)
                goto free;
        }
        sdi->driver = adi;
+
+       for (i = 0; probe_names[i]; i++) {
+               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
+                               probe_names[i])))
+                       return NULL;
+               sdi->probes = g_slist_append(sdi->probes, probe);
+       }
+
        devices = g_slist_append(devices, sdi);
        adi->instances = g_slist_append(adi->instances, sdi);
        sdi->priv = ctx;
@@ -683,7 +692,7 @@ static int configure_probes(const struct sr_dev_inst *sdi, const GSList *probes)
 
        for (l = probes; l; l = l->next) {
                probe = (struct sr_probe *)l->data;
-               probebit = 1 << (probe->index - 1);
+               probebit = 1 << (probe->index);
 
                if (!probe->enabled || !probe->trigger)
                        continue;
@@ -777,9 +786,6 @@ static int hw_info_get(int info_id, const void **data,
        struct context *ctx;
 
        switch (info_id) {
-       case SR_DI_INST:
-               *data = sdi;
-               break;
        case SR_DI_HWCAPS:
                *data = hwcaps;
                break;