]> sigrok.org Git - libsigrok.git/blob - hardware/zeroplus-logic-cube/zeroplus.c
85555d8582b5419eb977cc893229fc88e134efb5
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
1 /*
2  * This file is part of the sigrok project.
3  *
4  * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 #include <sys/time.h>
24 #include <inttypes.h>
25 #include <glib.h>
26 #include <libusb.h>
27 #include "config.h"
28 #include "libsigrok.h"
29 #include "libsigrok-internal.h"
30 #include "analyzer.h"
31
32 #define USB_VENDOR                      0x0c12
33
34 #define VENDOR_NAME                     "ZEROPLUS"
35 #define MODEL_NAME                      "Logic Cube LAP-C"
36 #define MODEL_VERSION                   NULL
37
38 #define NUM_PROBES                      16
39 #define USB_INTERFACE                   0
40 #define USB_CONFIGURATION               1
41 #define NUM_TRIGGER_STAGES              4
42 #define TRIGGER_TYPES                   "01"
43
44 #define PACKET_SIZE                     2048    /* ?? */
45
46 typedef struct {
47         unsigned short vid;
48         unsigned short pid;
49         char *model_name;
50         unsigned int channels;
51         unsigned int sample_depth;      /* In Ksamples/channel */
52         unsigned int max_sampling_freq;
53 } model_t;
54
55 /*
56  * Note -- 16032, 16064 and 16128 *usually* -- but not always -- have the
57  * same 128K sample depth.
58  */
59 static model_t zeroplus_models[] = {
60         {0x0c12, 0x7009, "LAP-C(16064)",  16, 64,   100},
61         {0x0c12, 0x700A, "LAP-C(16128)",  16, 128,  200},
62         /* TODO: we don't know anything about these
63         {0x0c12, 0x700B, "LAP-C(32128)",  32, 128,  200},
64         {0x0c12, 0x700C, "LAP-C(321000)", 32, 1024, 200},
65         {0x0c12, 0x700D, "LAP-C(322000)", 32, 2048, 200},
66         */
67         {0x0c12, 0x700E, "LAP-C(16032)",  16, 32,   100},
68         {0x0c12, 0x7016, "LAP-C(162000)", 16, 2048, 200},
69         { 0, 0, 0, 0, 0, 0 }
70 };
71
72 static const int hwcaps[] = {
73         SR_HWCAP_LOGIC_ANALYZER,
74         SR_HWCAP_SAMPLERATE,
75         SR_HWCAP_CAPTURE_RATIO,
76
77         /* These are really implemented in the driver, not the hardware. */
78         SR_HWCAP_LIMIT_SAMPLES,
79         0,
80 };
81
82 /*
83  * ZEROPLUS LAP-C (16032) numbers the 16 probes A0-A7 and B0-B7.
84  * We currently ignore other untested/unsupported devices here.
85  */
86 static const char *probe_names[NUM_PROBES + 1] = {
87         "A0",
88         "A1",
89         "A2",
90         "A3",
91         "A4",
92         "A5",
93         "A6",
94         "A7",
95         "B0",
96         "B1",
97         "B2",
98         "B3",
99         "B4",
100         "B5",
101         "B6",
102         "B7",
103         NULL,
104 };
105
106 /* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
107 SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info;
108 static struct sr_dev_driver *zdi = &zeroplus_logic_cube_driver_info;
109
110 static libusb_context *usb_context = NULL;
111
112 /*
113  * The hardware supports more samplerates than these, but these are the
114  * options hardcoded into the vendor's Windows GUI.
115  */
116
117 /*
118  * TODO: We shouldn't support 150MHz and 200MHz on devices that don't go up
119  * that high.
120  */
121 static const uint64_t supported_samplerates[] = {
122         SR_HZ(100),
123         SR_HZ(500),
124         SR_KHZ(1),
125         SR_KHZ(5),
126         SR_KHZ(25),
127         SR_KHZ(50),
128         SR_KHZ(100),
129         SR_KHZ(200),
130         SR_KHZ(400),
131         SR_KHZ(800),
132         SR_MHZ(1),
133         SR_MHZ(10),
134         SR_MHZ(25),
135         SR_MHZ(50),
136         SR_MHZ(80),
137         SR_MHZ(100),
138         SR_MHZ(150),
139         SR_MHZ(200),
140         0,
141 };
142
143 static const struct sr_samplerates samplerates = {
144         0,
145         0,
146         0,
147         supported_samplerates,
148 };
149
150 /* Private, per-device-instance driver context. */
151 struct dev_context {
152         uint64_t cur_samplerate;
153         uint64_t limit_samples;
154         int num_channels; /* TODO: This isn't initialized before it's needed :( */
155         uint64_t memory_size;
156         uint8_t probe_mask;
157         uint8_t trigger_mask[NUM_TRIGGER_STAGES];
158         uint8_t trigger_value[NUM_TRIGGER_STAGES];
159         // uint8_t trigger_buffer[NUM_TRIGGER_STAGES];
160
161         /* TODO: this belongs in the device instance */
162         struct sr_usb_dev_inst *usb;
163 };
164
165 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
166                 const void *value);
167 static int hw_dev_close(struct sr_dev_inst *sdi);
168
169 static unsigned int get_memory_size(int type)
170 {
171         if (type == MEMORY_SIZE_8K)
172                 return 8 * 1024;
173         else if (type == MEMORY_SIZE_64K)
174                 return 64 * 1024;
175         else if (type == MEMORY_SIZE_128K)
176                 return 128 * 1024;
177         else if (type == MEMORY_SIZE_512K)
178                 return 512 * 1024;
179         else
180                 return 0;
181 }
182
183 static int configure_probes(const struct sr_dev_inst *sdi)
184 {
185         struct dev_context *devc;
186         const struct sr_probe *probe;
187         const GSList *l;
188         int probe_bit, stage, i;
189         char *tc;
190
191         /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
192         devc = sdi->priv;
193
194         devc->probe_mask = 0;
195         for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
196                 devc->trigger_mask[i] = 0;
197                 devc->trigger_value[i] = 0;
198         }
199
200         stage = -1;
201         for (l = sdi->probes; l; l = l->next) {
202                 probe = (struct sr_probe *)l->data;
203                 if (probe->enabled == FALSE)
204                         continue;
205                 probe_bit = 1 << (probe->index);
206                 devc->probe_mask |= probe_bit;
207
208                 if (probe->trigger) {
209                         stage = 0;
210                         for (tc = probe->trigger; *tc; tc++) {
211                                 devc->trigger_mask[stage] |= probe_bit;
212                                 if (*tc == '1')
213                                         devc->trigger_value[stage] |= probe_bit;
214                                 stage++;
215                                 if (stage > NUM_TRIGGER_STAGES)
216                                         return SR_ERR;
217                         }
218                 }
219         }
220
221         return SR_OK;
222 }
223
224 static int clear_instances(void)
225 {
226         GSList *l;
227         struct sr_dev_inst *sdi;
228         struct drv_context *drvc;
229         struct dev_context *devc;
230
231         drvc = zdi->priv;
232         for (l = drvc->instances; l; l = l->next) {
233                 sdi = l->data;
234                 if (!(devc = sdi->priv)) {
235                         /* Log error, but continue cleaning up the rest. */
236                         sr_err("zeroplus: %s: sdi->priv was NULL, continuing", __func__);
237                         continue;
238                 }
239                 sr_usb_dev_inst_free(devc->usb);
240                 /* Properly close all devices... */
241                 hw_dev_close(sdi);
242                 /* ...and free all their memory. */
243                 sr_dev_inst_free(sdi);
244         }
245         g_slist_free(drvc->instances);
246         drvc->instances = NULL;
247
248         return SR_OK;
249 }
250
251 /*
252  * API callbacks
253  */
254
255 static int hw_init(void)
256 {
257         struct drv_context *drvc;
258
259         if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
260                 sr_err("zeroplus: driver context malloc failed.");
261                 return SR_ERR;
262         }
263         zdi->priv = drvc;
264
265         if (libusb_init(&usb_context) != 0) {
266                 sr_err("zp: Failed to initialize USB.");
267                 return 0;
268         }
269
270         return SR_OK;
271 }
272
273 static GSList *hw_scan(GSList *options)
274 {
275         struct sr_dev_inst *sdi;
276         struct sr_probe *probe;
277         struct drv_context *drvc;
278         struct dev_context *devc;
279         model_t *prof;
280         struct libusb_device_descriptor des;
281         libusb_device **devlist;
282         GSList *devices;
283         int ret, devcnt, i, j;
284
285         (void)options;
286         drvc = zdi->priv;
287         devices = NULL;
288
289         clear_instances();
290
291         /* Find all ZEROPLUS analyzers and add them to device list. */
292         devcnt = 0;
293         libusb_get_device_list(usb_context, &devlist); /* TODO: Errors. */
294
295         for (i = 0; devlist[i]; i++) {
296                 ret = libusb_get_device_descriptor(devlist[i], &des);
297                 if (ret != 0) {
298                         sr_err("zp: failed to get device descriptor: %d", ret);
299                         continue;
300                 }
301
302                 prof = NULL;
303                 for (j = 0; j < zeroplus_models[j].vid; j++) {
304                         if (des.idVendor == zeroplus_models[j].vid &&
305                                 des.idProduct == zeroplus_models[j].pid) {
306                                 prof = &zeroplus_models[j];
307                         }
308                 }
309                 /* Skip if the device was not found */
310                 if (!prof)
311                         continue;
312                 sr_info("zp: Found ZEROPLUS model %s", prof->model_name);
313
314                 /* Register the device with libsigrok. */
315                 if (!(sdi = sr_dev_inst_new(devcnt, SR_ST_INACTIVE,
316                                 VENDOR_NAME, prof->model_name, NULL))) {
317                         sr_err("zp: %s: sr_dev_inst_new failed", __func__);
318                         return NULL;
319                 }
320                 sdi->driver = zdi;
321
322                 /* Allocate memory for our private driver context. */
323                 if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
324                         sr_err("zp: %s: devc malloc failed", __func__);
325                         return 0;
326                 }
327                 sdi->priv = devc;
328                 devc->num_channels = prof->channels;
329                 devc->memory_size = prof->sample_depth * 1024;
330                 // memset(devc->trigger_buffer, 0, NUM_TRIGGER_STAGES);
331
332                 /* Fill in probelist according to this device's profile. */
333                 for (j = 0; j < devc->num_channels; j++) {
334                         if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
335                                         probe_names[j])))
336                                 return NULL;
337                         sdi->probes = g_slist_append(sdi->probes, probe);
338                 }
339
340                 devices = g_slist_append(devices, sdi);
341                 drvc->instances = g_slist_append(drvc->instances, sdi);
342                 devc->usb = sr_usb_dev_inst_new(
343                         libusb_get_bus_number(devlist[i]),
344                         libusb_get_device_address(devlist[i]), NULL);
345                 devcnt++;
346
347         }
348         libusb_free_device_list(devlist, 1);
349
350         return devices;
351 }
352
353 static GSList *hw_dev_list(void)
354 {
355         struct drv_context *drvc;
356
357         drvc = zdi->priv;
358
359         return drvc->instances;
360 }
361
362 static int hw_dev_open(struct sr_dev_inst *sdi)
363 {
364         struct dev_context *devc;
365         libusb_device **devlist, *dev;
366         struct libusb_device_descriptor des;
367         int device_count, ret, i;
368
369         if (!(devc = sdi->priv)) {
370                 sr_err("zp: %s: sdi->priv was NULL", __func__);
371                 return SR_ERR_ARG;
372         }
373
374         device_count = libusb_get_device_list(usb_context, &devlist);
375         if (device_count < 0) {
376                 sr_err("zp: Failed to retrieve device list");
377                 return SR_ERR;
378         }
379
380         dev = NULL;
381         for (i = 0; i < device_count; i++) {
382                 if ((ret = libusb_get_device_descriptor(devlist[i], &des))) {
383                         sr_err("fx2lafw: Failed to get device descriptor: %d.",
384                                ret);
385                         continue;
386                 }
387                 if (libusb_get_bus_number(devlist[i]) == devc->usb->bus
388                     && libusb_get_device_address(devlist[i]) == devc->usb->address) {
389                         dev = devlist[i];
390                         break;
391                 }
392         }
393         if (!dev) {
394                 sr_err("device on bus %d address %d disappeared!",
395                                 devc->usb->bus, devc->usb->address);
396                 return SR_ERR;
397         }
398
399         if (!(ret = libusb_open(dev, &(devc->usb->devhdl)))) {
400                 sdi->status = SR_ST_ACTIVE;
401                 sr_info("zp: opened device %d on %d.%d interface %d",
402                         sdi->index, devc->usb->bus,
403                         devc->usb->address, USB_INTERFACE);
404         } else {
405                 sr_err("zp: failed to open device: %d", ret);
406                 return SR_ERR;
407         }
408
409         ret = libusb_set_configuration(devc->usb->devhdl, USB_CONFIGURATION);
410         if (ret < 0) {
411                 sr_err("zp: Unable to set USB configuration %d: %d",
412                        USB_CONFIGURATION, ret);
413                 return SR_ERR;
414         }
415
416         ret = libusb_claim_interface(devc->usb->devhdl, USB_INTERFACE);
417         if (ret != 0) {
418                 sr_err("zp: Unable to claim interface: %d", ret);
419                 return SR_ERR;
420         }
421
422         analyzer_reset(devc->usb->devhdl);
423         analyzer_initialize(devc->usb->devhdl);
424
425         analyzer_set_memory_size(MEMORY_SIZE_512K);
426         // analyzer_set_freq(g_freq, g_freq_scale);
427         analyzer_set_trigger_count(1);
428         // analyzer_set_ramsize_trigger_address((((100 - g_pre_trigger)
429         // * get_memory_size(g_memory_size)) / 100) >> 2);
430         analyzer_set_ramsize_trigger_address(
431                 (100 * get_memory_size(MEMORY_SIZE_512K) / 100) >> 2);
432
433 #if 0
434         if (g_double_mode == 1)
435                 analyzer_set_compression(COMPRESSION_DOUBLE);
436         else if (g_compression == 1)
437                 analyzer_set_compression(COMPRESSION_ENABLE);
438         else
439 #endif
440         analyzer_set_compression(COMPRESSION_NONE);
441
442         if (devc->cur_samplerate == 0) {
443                 /* Samplerate hasn't been set. Default to the slowest one. */
444                 if (hw_dev_config_set(sdi, SR_HWCAP_SAMPLERATE,
445                      &samplerates.list[0]) == SR_ERR)
446                         return SR_ERR;
447         }
448
449         return SR_OK;
450 }
451
452 static int hw_dev_close(struct sr_dev_inst *sdi)
453 {
454         struct dev_context *devc;
455
456         if (!(devc = sdi->priv)) {
457                 sr_err("zp: %s: sdi->priv was NULL", __func__);
458                 return SR_ERR;
459         }
460
461         if (!devc->usb->devhdl)
462                 return SR_ERR;
463
464         sr_info("zp: closing device %d on %d.%d interface %d", sdi->index,
465                 devc->usb->bus, devc->usb->address, USB_INTERFACE);
466         libusb_release_interface(devc->usb->devhdl, USB_INTERFACE);
467         libusb_reset_device(devc->usb->devhdl);
468         libusb_close(devc->usb->devhdl);
469         devc->usb->devhdl = NULL;
470         sdi->status = SR_ST_INACTIVE;
471
472         return SR_OK;
473 }
474
475 static int hw_cleanup(void)
476 {
477         struct drv_context *drvc;
478
479         if (!(drvc = zdi->priv))
480                 return SR_OK;
481
482         clear_instances();
483
484         if (usb_context)
485                 libusb_exit(usb_context);
486         usb_context = NULL;
487
488         return SR_OK;
489 }
490
491 static int hw_info_get(int info_id, const void **data,
492        const struct sr_dev_inst *sdi)
493 {
494         struct dev_context *devc;
495
496         switch (info_id) {
497         case SR_DI_HWCAPS:
498                 *data = hwcaps;
499                 break;
500         case SR_DI_NUM_PROBES:
501                 if (sdi) {
502                         devc = sdi->priv;
503                         *data = GINT_TO_POINTER(devc->num_channels);
504                         sr_spew("zp: %s: Returning number of channels: %d.",
505                                         __func__, devc->num_channels);
506                 } else
507                         return SR_ERR;
508                 break;
509         case SR_DI_PROBE_NAMES:
510                 *data = probe_names;
511                 sr_spew("zp: %s: Returning probenames.", __func__);
512                 break;
513         case SR_DI_SAMPLERATES:
514                 *data = &samplerates;
515                 sr_spew("zp: %s: Returning samplerates.", __func__);
516                 break;
517         case SR_DI_TRIGGER_TYPES:
518                 *data = TRIGGER_TYPES;
519                 sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES);
520                 break;
521         case SR_DI_CUR_SAMPLERATE:
522                 if (sdi) {
523                         devc = sdi->priv;
524                         *data = &devc->cur_samplerate;
525                         sr_spew("zp: %s: Returning samplerate: %" PRIu64 "Hz.",
526                                 __func__, devc->cur_samplerate);
527                 } else
528                         return SR_ERR;
529                 break;
530         default:
531                 return SR_ERR_ARG;
532         }
533
534         return SR_OK;
535 }
536
537 static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
538 {
539         struct dev_context *devc;
540
541         if (!sdi) {
542                 sr_err("zp: %s: sdi was NULL", __func__);
543                 return SR_ERR_ARG;
544         }
545
546         if (!(devc = sdi->priv)) {
547                 sr_err("zp: %s: sdi->priv was NULL", __func__);
548                 return SR_ERR_ARG;
549         }
550
551         sr_info("zp: Setting samplerate to %" PRIu64 "Hz.", samplerate);
552
553         if (samplerate > SR_MHZ(1))
554                 analyzer_set_freq(samplerate / SR_MHZ(1), FREQ_SCALE_MHZ);
555         else if (samplerate > SR_KHZ(1))
556                 analyzer_set_freq(samplerate / SR_KHZ(1), FREQ_SCALE_KHZ);
557         else
558                 analyzer_set_freq(samplerate, FREQ_SCALE_HZ);
559
560         devc->cur_samplerate = samplerate;
561
562         return SR_OK;
563 }
564
565 static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
566                 const void *value)
567 {
568         struct dev_context *devc;
569
570         if (!(devc = sdi->priv)) {
571                 sr_err("zp: %s: sdi->priv was NULL", __func__);
572                 return SR_ERR_ARG;
573         }
574
575         switch (hwcap) {
576         case SR_HWCAP_SAMPLERATE:
577                 return set_samplerate(sdi, *(const uint64_t *)value);
578         case SR_HWCAP_LIMIT_SAMPLES:
579                 devc->limit_samples = *(const uint64_t *)value;
580                 return SR_OK;
581         default:
582                 return SR_ERR;
583         }
584 }
585
586 static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
587                 void *cb_data)
588 {
589         struct sr_datafeed_packet packet;
590         struct sr_datafeed_logic logic;
591         struct sr_datafeed_header header;
592         struct sr_datafeed_meta_logic meta;
593         uint64_t samples_read;
594         int res;
595         unsigned int packet_num;
596         unsigned char *buf;
597         struct dev_context *devc;
598
599         if (!(devc = sdi->priv)) {
600                 sr_err("zp: %s: sdi->priv was NULL", __func__);
601                 return SR_ERR_ARG;
602         }
603
604         if (configure_probes(sdi) != SR_OK) {
605                 sr_err("zp: failed to configured probes");
606                 return SR_ERR;
607         }
608
609         /* push configured settings to device */
610         analyzer_configure(devc->usb->devhdl);
611
612         analyzer_start(devc->usb->devhdl);
613         sr_info("zp: Waiting for data");
614         analyzer_wait_data(devc->usb->devhdl);
615
616         sr_info("zp: Stop address    = 0x%x",
617                 analyzer_get_stop_address(devc->usb->devhdl));
618         sr_info("zp: Now address     = 0x%x",
619                 analyzer_get_now_address(devc->usb->devhdl));
620         sr_info("zp: Trigger address = 0x%x",
621                 analyzer_get_trigger_address(devc->usb->devhdl));
622
623         packet.type = SR_DF_HEADER;
624         packet.payload = &header;
625         header.feed_version = 1;
626         gettimeofday(&header.starttime, NULL);
627         sr_session_send(cb_data, &packet);
628
629         /* Send metadata about the SR_DF_LOGIC packets to come. */
630         packet.type = SR_DF_META_LOGIC;
631         packet.payload = &meta;
632         meta.samplerate = devc->cur_samplerate;
633         meta.num_probes = devc->num_channels;
634         sr_session_send(cb_data, &packet);
635
636         if (!(buf = g_try_malloc(PACKET_SIZE))) {
637                 sr_err("zp: %s: buf malloc failed", __func__);
638                 return SR_ERR_MALLOC;
639         }
640
641         samples_read = 0;
642         analyzer_read_start(devc->usb->devhdl);
643         /* Send the incoming transfer to the session bus. */
644         for (packet_num = 0; packet_num < (devc->memory_size * 4 / PACKET_SIZE);
645              packet_num++) {
646                 res = analyzer_read_data(devc->usb->devhdl, buf, PACKET_SIZE);
647                 sr_info("zp: Tried to read %llx bytes, actually read %x bytes",
648                         PACKET_SIZE, res);
649
650                 packet.type = SR_DF_LOGIC;
651                 packet.payload = &logic;
652                 logic.length = PACKET_SIZE;
653                 logic.unitsize = 4;
654                 logic.data = buf;
655                 sr_session_send(cb_data, &packet);
656                 samples_read += res / 4;
657         }
658         analyzer_read_stop(devc->usb->devhdl);
659         g_free(buf);
660
661         packet.type = SR_DF_END;
662         sr_session_send(cb_data, &packet);
663
664         return SR_OK;
665 }
666
667 /* TODO: This stops acquisition on ALL devices, ignoring dev_index. */
668 static int hw_dev_acquisition_stop(const struct sr_dev_inst *sdi,
669                 void *cb_data)
670 {
671         struct sr_datafeed_packet packet;
672         struct dev_context *devc;
673
674         packet.type = SR_DF_END;
675         sr_session_send(cb_data, &packet);
676
677         if (!(devc = sdi->priv)) {
678                 sr_err("zp: %s: sdi->priv was NULL", __func__);
679                 return SR_ERR_BUG;
680         }
681
682         analyzer_reset(devc->usb->devhdl);
683         /* TODO: Need to cancel and free any queued up transfers. */
684
685         return SR_OK;
686 }
687
688 SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
689         .name = "zeroplus-logic-cube",
690         .longname = "ZEROPLUS Logic Cube LAP-C series",
691         .api_version = 1,
692         .init = hw_init,
693         .cleanup = hw_cleanup,
694         .scan = hw_scan,
695         .dev_list = hw_dev_list,
696         .dev_clear = hw_cleanup,
697         .dev_open = hw_dev_open,
698         .dev_close = hw_dev_close,
699         .info_get = hw_info_get,
700         .dev_config_set = hw_dev_config_set,
701         .dev_acquisition_start = hw_dev_acquisition_start,
702         .dev_acquisition_stop = hw_dev_acquisition_stop,
703         .priv = NULL,
704 };