]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
fx2lafw: Add new VID:PID for usb-c-grok
[libsigrok.git] / src / hardware / fx2lafw / api.c
index abb867884ed0ba9ae8e10acf242487f829f45c41..d107191663a820af2f7ccdb3115bb08b507f428d 100644 (file)
@@ -105,6 +105,13 @@ static const struct fx2lafw_profile supported_fx2[] = {
                "fx2lafw-sigrok-fx2-16ch.fw",
                DEV_CAPS_16BIT, NULL, NULL },
 
+       /*
+        * usb-c-grok
+        */
+       { 0x1d50, 0x608f, "sigrok", "usb-c-grok", NULL,
+               "fx2lafw-usb-c-grok.fw",
+               0, NULL, NULL},
+
        ALL_ZERO
 };
 
@@ -265,7 +272,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                libusb_close(hdl);
 
-               usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
+               if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+                       continue;
 
                prof = NULL;
                for (j = 0; supported_fx2[j].vid; j++) {
@@ -337,14 +345,16 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                                        libusb_get_device_address(devlist[i]), NULL);
                } else {
                        if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
-                                       USB_CONFIGURATION, prof->firmware) == SR_OK)
+                                       USB_CONFIGURATION, prof->firmware) == SR_OK) {
                                /* Store when this device's FW was updated. */
                                devc->fw_updated = g_get_monotonic_time();
-                       else
+                       } else {
                                sr_err("Firmware upload failed for "
-                                      "device %d.%d (logical).",
+                                      "device %d.%d (logical), name %s.",
                                       libusb_get_bus_number(devlist[i]),
-                                      libusb_get_device_address(devlist[i]));
+                                      libusb_get_device_address(devlist[i]),
+                                      prof->firmware);
+                       }
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
                                        0xff, NULL);
@@ -538,6 +548,8 @@ static int config_list(uint32_t key, GVariant **data,
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
        case SR_CONF_DEVICE_OPTIONS:
+               if (cg)
+                       return SR_ERR_NA;
                return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
        case SR_CONF_SAMPLERATE:
                if (!devc)