+ struct dev_context *devc;
+ const struct sr_probe *probe;
+ const GSList *node;
+ uint64_t probe_bit;
+
+ devc = sdi->priv;
+
+ devc->channel_mask = 0;
+ devc->trigger_mask = 0;
+ devc->trigger_edge_mask = 0;
+ devc->trigger_values = 0;
+
+ for (node = sdi->probes, probe_bit = 1;
+ node != NULL;
+ node = node->next, probe_bit <<= 1) {
+
+ if (probe_bit >= ((uint64_t)1 << NUM_PROBES)) {
+ sr_err("Channels over the limit of %d.", NUM_PROBES);
+ return SR_ERR;
+ }
+ probe = node->data;
+ if (!probe || !probe->enabled)
+ continue;
+
+ /* Enable input channel for this probe. */
+ devc->channel_mask |= probe_bit;
+
+ if (!probe->trigger || probe->trigger[0] == '\0')
+ continue;
+
+ if (probe->trigger[1] != '\0') {
+ sr_err("Only one trigger stage is supported.");
+ return SR_ERR;
+ }
+ /* Enable trigger for this probe. */
+ devc->trigger_mask |= probe_bit;
+
+ /* Configure edge mask and trigger value. */
+ switch (probe->trigger[0]) {
+ case '1': devc->trigger_values |= probe_bit;
+ case '0': break;
+
+ case 'r': devc->trigger_values |= probe_bit;
+ case 'f': devc->trigger_edge_mask |= probe_bit;
+ break;
+ default:
+ sr_err("Trigger type '%c' is not supported.",
+ probe->trigger[0]);
+ return SR_ERR;
+ }
+ }
+ return SR_OK;
+}
+
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
+{
+ struct drv_context *drvc;
+ struct dev_context *devc;
+ struct acquisition_state *acq;
+ int ret;
+