-#include <sigrok.h>
-#include <sigrok-internal.h>
-
-#define USB_VENDOR 0x0925
-#define USB_PRODUCT 0x3881
-#define USB_VENDOR_NAME "Saleae"
-#define USB_MODEL_NAME "Logic"
-#define USB_MODEL_VERSION ""
-
-#define USB_INTERFACE 0
-#define USB_CONFIGURATION 1
-#define NUM_PROBES 8
-#define NUM_TRIGGER_STAGES 4
-#define TRIGGER_TYPES "01"
-#define FIRMWARE FIRMWARE_DIR "/saleae-logic.fw"
-
-/* delay in ms */
-#define FIRMWARE_RENUM_DELAY 2000
-#define NUM_SIMUL_TRANSFERS 10
-#define MAX_EMPTY_TRANSFERS (NUM_SIMUL_TRANSFERS * 2)
-
-/* Software trigger implementation: positive values indicate trigger stage. */
-#define TRIGGER_FIRED -1
-
-/* There is only one model Saleae Logic, and this is what it supports: */
-static int capabilities[] = {
+#include "config.h"
+#include "sigrok.h"
+#include "sigrok-internal.h"
+#include "saleae-logic.h"
+
+static struct fx2_profile supported_fx2[] = {
+ /* Saleae Logic */
+ { 0x0925, 0x3881, 0x0925, 0x3881, "Saleae", "Logic", NULL, 8 },
+ /* default Cypress FX2 without EEPROM */
+ { 0x04b4, 0x8613, 0x0925, 0x3881, "Cypress", "FX2", NULL, 16 },
+ { 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+static int hwcaps[] = {