]> sigrok.org Git - libsigrok.git/blame - src/hardware/yokogawa-dlm/api.c
yokogawa-dlm: Populate sdi->serial_num and sdi->version
[libsigrok.git] / src / hardware / yokogawa-dlm / api.c
CommitLineData
10763937
SA
1/*
2 * This file is part of the libsigrok project.
3 *
4 * Copyright (C) 2014 abraxa (Soeren Apel) <soeren@apelpie.net>
5 * Based on the Hameg HMO driver by poljar (Damir Jelić) <poljarinho@gmail.com>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <stdlib.h>
22#include "protocol.h"
23
8ab929d6
SA
24SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info;
25static struct sr_dev_driver *di = &yokogawa_dlm_driver_info;
26
27static char *MANUFACTURER_ID = "YOKOGAWA";
28static char *MANUFACTURER_NAME = "Yokogawa";
29
30enum {
31 CG_INVALID = -1,
32 CG_NONE,
33 CG_ANALOG,
34 CG_DIGITAL,
35};
36
37static int init(struct sr_context *sr_ctx)
38{
39 return std_init(sr_ctx, di, LOG_PREFIX);
40}
41
42static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi)
43{
44 struct sr_dev_inst *sdi;
45 struct dev_context *devc;
46 struct sr_scpi_hw_info *hw_info;
47 char *model_name;
48 int model_index;
49
50 sdi = NULL;
51 devc = NULL;
52 hw_info = NULL;
53
54 if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
55 sr_info("Couldn't get IDN response.");
56 goto fail;
57 }
58
59 if (strcmp(hw_info->manufacturer, MANUFACTURER_ID) != 0)
60 goto fail;
61
62 if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK)
63 goto fail;
64
aed4ad0b 65 if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, MANUFACTURER_NAME,
d1314831 66 model_name, hw_info->firmware_version)))
8ab929d6
SA
67 goto fail;
68
d1314831
SA
69 sdi->serial_num = g_strdup(hw_info->serial_number);
70
8ab929d6
SA
71 sr_scpi_hw_info_free(hw_info);
72 hw_info = NULL;
73
ac10a927 74 devc = g_malloc0(sizeof(struct dev_context));
8ab929d6
SA
75
76 sdi->driver = di;
77 sdi->priv = devc;
78 sdi->inst_type = SR_INST_SCPI;
79 sdi->conn = scpi;
80
81 if (dlm_device_init(sdi, model_index) != SR_OK)
82 goto fail;
83
84 sr_scpi_close(sdi->conn);
85
86 sdi->status = SR_ST_INACTIVE;
87 return sdi;
88
89fail:
90 if (hw_info)
91 sr_scpi_hw_info_free(hw_info);
92 if (sdi)
93 sr_dev_inst_free(sdi);
94 if (devc)
95 g_free(devc);
96
97 return NULL;
98}
99
100static GSList *scan(GSList *options)
101{
102 return sr_scpi_scan(di->priv, options, probe_usbtmc_device);
103}
104
105static GSList *dev_list(void)
106{
107 return ((struct drv_context *)(di->priv))->instances;
108}
109
110static void clear_helper(void *priv)
111{
112 struct dev_context *devc;
113
114 devc = priv;
115
116 dlm_scope_state_destroy(devc->model_state);
117
118 g_free(devc->analog_groups);
119 g_free(devc->digital_groups);
120 g_free(devc);
121}
122
123static int dev_clear(void)
124{
125 return std_dev_clear(di, clear_helper);
126}
127
128static int dev_open(struct sr_dev_inst *sdi)
129{
130 if (sdi->status != SR_ST_ACTIVE && sr_scpi_open(sdi->conn) != SR_OK)
131 return SR_ERR;
132
133 if (dlm_scope_state_query(sdi) != SR_OK)
134 return SR_ERR;
135
136 sdi->status = SR_ST_ACTIVE;
137
138 return SR_OK;
139}
140
141static int dev_close(struct sr_dev_inst *sdi)
142{
143 if (sdi->status == SR_ST_INACTIVE)
144 return SR_OK;
145
146 sr_scpi_close(sdi->conn);
147
148 sdi->status = SR_ST_INACTIVE;
149
150 return SR_OK;
151}
152
153static int cleanup(void)
154{
155 dev_clear();
156
157 return SR_OK;
158}
159
160/**
161 * Check which category a given channel group belongs to.
162 *
163 * @param devc Our internal device context.
164 * @param cg The channel group to check.
165 *
166 * @retval CG_NONE cg is NULL
167 * @retval CG_ANALOG cg is an analog group
168 * @retval CG_DIGITAL cg is a digital group
169 * @retval CG_INVALID cg is something else
170 */
171static int check_channel_group(struct dev_context *devc,
ac10a927 172 const struct sr_channel_group *cg)
8ab929d6
SA
173{
174 unsigned int i;
175 struct scope_config *model;
176
177 model = devc->model_config;
178
179 if (!cg)
180 return CG_NONE;
181
182 for (i = 0; i < model->analog_channels; ++i)
183 if (cg == devc->analog_groups[i])
184 return CG_ANALOG;
185
186 for (i = 0; i < model->pods; ++i)
187 if (cg == devc->digital_groups[i])
188 return CG_DIGITAL;
189
190 sr_err("Invalid channel group specified.");
191 return CG_INVALID;
192}
193
584560f1 194static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
ac10a927 195 const struct sr_channel_group *cg)
8ab929d6
SA
196{
197 int ret, cg_type;
198 unsigned int i;
199 struct dev_context *devc;
200 struct scope_config *model;
201 struct scope_state *state;
202
203 if (!sdi || !(devc = sdi->priv))
204 return SR_ERR_ARG;
205
206 if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID)
207 return SR_ERR;
208
209 ret = SR_ERR_NA;
210 model = devc->model_config;
211 state = devc->model_state;
212
213 switch (key) {
214 case SR_CONF_NUM_TIMEBASE:
215 *data = g_variant_new_int32(model->num_xdivs);
216 ret = SR_OK;
217 break;
218 case SR_CONF_TIMEBASE:
219 *data = g_variant_new("(tt)",
ac10a927
SA
220 (*model->timebases)[state->timebase][0],
221 (*model->timebases)[state->timebase][1]);
8ab929d6
SA
222 ret = SR_OK;
223 break;
224 case SR_CONF_NUM_VDIV:
225 if (cg_type == CG_NONE) {
226 sr_err("No channel group specified.");
227 return SR_ERR_CHANNEL_GROUP;
228 } else if (cg_type == CG_ANALOG) {
229 *data = g_variant_new_int32(model->num_ydivs);
230 ret = SR_OK;
231 break;
232 } else {
233 ret = SR_ERR_NA;
234 }
235 break;
236 case SR_CONF_VDIV:
237 ret = SR_ERR_NA;
238 if (cg_type == CG_NONE) {
239 sr_err("No channel group specified.");
240 return SR_ERR_CHANNEL_GROUP;
241 } else if (cg_type != CG_ANALOG)
242 break;
243
244 for (i = 0; i < model->analog_channels; ++i) {
245 if (cg != devc->analog_groups[i])
246 continue;
247 *data = g_variant_new("(tt)",
ac10a927
SA
248 (*model->vdivs)[state->analog_states[i].vdiv][0],
249 (*model->vdivs)[state->analog_states[i].vdiv][1]);
8ab929d6
SA
250 ret = SR_OK;
251 break;
252 }
253 break;
254 case SR_CONF_TRIGGER_SOURCE:
255 *data = g_variant_new_string((*model->trigger_sources)[state->trigger_source]);
256 ret = SR_OK;
257 break;
258 case SR_CONF_TRIGGER_SLOPE:
259 *data = g_variant_new_string((*model->trigger_slopes)[state->trigger_slope]);
260 ret = SR_OK;
261 break;
262 case SR_CONF_HORIZ_TRIGGERPOS:
263 *data = g_variant_new_double(state->horiz_triggerpos);
264 ret = SR_OK;
265 break;
266 case SR_CONF_COUPLING:
267 ret = SR_ERR_NA;
268 if (cg_type == CG_NONE) {
269 sr_err("No channel group specified.");
270 return SR_ERR_CHANNEL_GROUP;
271 } else if (cg_type != CG_ANALOG)
272 break;
273
274 for (i = 0; i < model->analog_channels; ++i) {
275 if (cg != devc->analog_groups[i])
276 continue;
277 *data = g_variant_new_string((*model->coupling_options)[state->analog_states[i].coupling]);
278 ret = SR_OK;
279 break;
280 }
281 break;
282 case SR_CONF_SAMPLERATE:
283 *data = g_variant_new_uint64(state->sample_rate);
284 ret = SR_OK;
285 break;
286 default:
287 ret = SR_ERR_NA;
288 }
289
290 return ret;
291}
292
293static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n)
294{
295 unsigned int i;
296 GVariant *rational[2];
297 GVariantBuilder gvb;
298
299 g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
300
301 for (i = 0; i < n; i++) {
302 rational[0] = g_variant_new_uint64((*array)[i][0]);
303 rational[1] = g_variant_new_uint64((*array)[i][1]);
304
305 /* FIXME: Valgrind reports a memory leak here. */
306 g_variant_builder_add_value(&gvb, g_variant_new_tuple(rational, 2));
307 }
308
309 return g_variant_builder_end(&gvb);
310}
311
584560f1 312static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
ac10a927 313 const struct sr_channel_group *cg)
8ab929d6
SA
314{
315 int ret, cg_type;
316 unsigned int i, j;
317 char float_str[30];
318 struct dev_context *devc;
319 struct scope_config *model;
320 struct scope_state *state;
321 const char *tmp;
322 uint64_t p, q;
323 double tmp_d;
324 gboolean update_sample_rate;
325
326 if (!sdi || !(devc = sdi->priv))
327 return SR_ERR_ARG;
328
329 if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID)
330 return SR_ERR;
331
332 model = devc->model_config;
333 state = devc->model_state;
334 update_sample_rate = FALSE;
335
336 ret = SR_ERR_NA;
337
338 switch (key) {
339 case SR_CONF_LIMIT_FRAMES:
340 devc->frame_limit = g_variant_get_uint64(data);
341 ret = SR_OK;
342 break;
343 case SR_CONF_TRIGGER_SOURCE:
344 tmp = g_variant_get_string(data, NULL);
345 for (i = 0; (*model->trigger_sources)[i]; i++) {
346 if (g_strcmp0(tmp, (*model->trigger_sources)[i]) != 0)
347 continue;
348 state->trigger_source = i;
349 /* TODO: A and B trigger support possible? */
350 ret = dlm_trigger_source_set(sdi->conn, (*model->trigger_sources)[i]);
351 break;
352 }
353 break;
354 case SR_CONF_VDIV:
355 if (cg_type == CG_NONE) {
356 sr_err("No channel group specified.");
357 return SR_ERR_CHANNEL_GROUP;
358 }
359
360 g_variant_get(data, "(tt)", &p, &q);
361
362 for (i = 0; i < model->num_vdivs; i++) {
363 if (p != (*model->vdivs)[i][0] ||
ac10a927 364 q != (*model->vdivs)[i][1])
8ab929d6
SA
365 continue;
366 for (j = 1; j <= model->analog_channels; ++j) {
367 if (cg != devc->analog_groups[j - 1])
368 continue;
369 state->analog_states[j - 1].vdiv = i;
370 g_ascii_formatd(float_str, sizeof(float_str),
371 "%E", (float) p / q);
372 if (dlm_analog_chan_vdiv_set(sdi->conn, j, float_str) != SR_OK ||
ac10a927 373 sr_scpi_get_opc(sdi->conn) != SR_OK)
8ab929d6
SA
374 return SR_ERR;
375
376 break;
377 }
378
379 ret = SR_OK;
380 break;
381 }
382 break;
383 case SR_CONF_TIMEBASE:
384 g_variant_get(data, "(tt)", &p, &q);
385
386 for (i = 0; i < model->num_timebases; i++) {
387 if (p != (*model->timebases)[i][0] ||
ac10a927 388 q != (*model->timebases)[i][1])
8ab929d6
SA
389 continue;
390 state->timebase = i;
391 g_ascii_formatd(float_str, sizeof(float_str),
392 "%E", (float) p / q);
393 ret = dlm_timebase_set(sdi->conn, float_str);
394 update_sample_rate = TRUE;
395 break;
396 }
397 break;
398 case SR_CONF_HORIZ_TRIGGERPOS:
399 tmp_d = g_variant_get_double(data);
400
401 /* TODO: Check if the calculation makes sense for the DLM. */
402 if (tmp_d < 0.0 || tmp_d > 1.0)
403 return SR_ERR;
404
405 state->horiz_triggerpos = tmp_d;
406 tmp_d = -(tmp_d - 0.5) *
ac10a927
SA
407 ((double) (*model->timebases)[state->timebase][0] /
408 (*model->timebases)[state->timebase][1])
409 * model->num_xdivs;
8ab929d6
SA
410
411 g_ascii_formatd(float_str, sizeof(float_str), "%E", tmp_d);
412 ret = dlm_horiz_trigger_pos_set(sdi->conn, float_str);
413 break;
414 case SR_CONF_TRIGGER_SLOPE:
415 tmp = g_variant_get_string(data, NULL);
416
417 if (!tmp || !(tmp[0] == 'f' || tmp[0] == 'r'))
418 return SR_ERR_ARG;
419
420 /* Note: See dlm_trigger_slopes[] in protocol.c. */
421 state->trigger_slope = (tmp[0] == 'r') ?
422 SLOPE_POSITIVE : SLOPE_NEGATIVE;
423
424 ret = dlm_trigger_slope_set(sdi->conn, state->trigger_slope);
425 break;
426 case SR_CONF_COUPLING:
427 if (cg_type == CG_NONE) {
428 sr_err("No channel group specified.");
429 return SR_ERR_CHANNEL_GROUP;
430 }
431
432 tmp = g_variant_get_string(data, NULL);
433
434 for (i = 0; (*model->coupling_options)[i]; i++) {
435 if (strcmp(tmp, (*model->coupling_options)[i]) != 0)
436 continue;
437 for (j = 1; j <= model->analog_channels; ++j) {
438 if (cg != devc->analog_groups[j - 1])
439 continue;
440 state->analog_states[j-1].coupling = i;
441
442 if (dlm_analog_chan_coupl_set(sdi->conn, j, tmp) != SR_OK ||
ac10a927 443 sr_scpi_get_opc(sdi->conn) != SR_OK)
8ab929d6
SA
444 return SR_ERR;
445 break;
446 }
447
448 ret = SR_OK;
449 break;
450 }
451 break;
452 default:
453 ret = SR_ERR_NA;
454 break;
455 }
456
457 if (ret == SR_OK)
458 ret = sr_scpi_get_opc(sdi->conn);
459
460 if (ret == SR_OK && update_sample_rate)
461 ret = dlm_sample_rate_query(sdi);
462
463 return ret;
464}
465
584560f1 466static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
ac10a927 467 const struct sr_channel_group *cg)
8ab929d6
SA
468{
469 int cg_type;
470 struct dev_context *devc;
471 struct scope_config *model;
472
473 if (!sdi || !(devc = sdi->priv))
474 return SR_ERR_ARG;
475
476 if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID)
477 return SR_ERR;
478
479 model = devc->model_config;
480
481 switch (key) {
8ab929d6
SA
482 case SR_CONF_DEVICE_OPTIONS:
483 if (cg_type == CG_NONE) {
584560f1 484 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
f254bc4b 485 model->devopts, model->num_devopts, sizeof(uint32_t));
8ab929d6 486 } else if (cg_type == CG_ANALOG) {
584560f1 487 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
af945a66 488 model->analog_devopts, model->num_analog_devopts, sizeof(uint32_t));
8ab929d6 489 } else {
584560f1
BV
490 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
491 NULL, 0, sizeof(uint32_t));
8ab929d6
SA
492 }
493 break;
494 case SR_CONF_COUPLING:
495 if (cg_type == CG_NONE)
496 return SR_ERR_CHANNEL_GROUP;
497 *data = g_variant_new_strv(*model->coupling_options,
ac10a927 498 g_strv_length((char **)*model->coupling_options));
8ab929d6
SA
499 break;
500 case SR_CONF_TRIGGER_SOURCE:
501 *data = g_variant_new_strv(*model->trigger_sources,
ac10a927 502 g_strv_length((char **)*model->trigger_sources));
8ab929d6
SA
503 break;
504 case SR_CONF_TRIGGER_SLOPE:
505 *data = g_variant_new_strv(*model->trigger_slopes,
ac10a927 506 g_strv_length((char **)*model->trigger_slopes));
8ab929d6
SA
507 break;
508 case SR_CONF_TIMEBASE:
509 *data = build_tuples(model->timebases, model->num_timebases);
510 break;
511 case SR_CONF_VDIV:
512 if (cg_type == CG_NONE)
513 return SR_ERR_CHANNEL_GROUP;
514 *data = build_tuples(model->vdivs, model->num_vdivs);
515 break;
516 default:
517 return SR_ERR_NA;
518 }
519
520 return SR_OK;
521}
522
523static int dlm_check_channels(GSList *channels)
524{
525 GSList *l;
526 struct sr_channel *ch;
527 gboolean enabled_pod1, enabled_chan4;
528
529 enabled_pod1 = enabled_chan4 = FALSE;
530
531 /* Note: On the DLM2000, CH4 and Logic are shared. */
532 /* TODO Handle non-DLM2000 models. */
533 for (l = channels; l; l = l->next) {
534 ch = l->data;
535 switch (ch->type) {
536 case SR_CHANNEL_ANALOG:
537 if (ch->index == 3)
538 enabled_chan4 = TRUE;
539 break;
540 case SR_CHANNEL_LOGIC:
541 enabled_pod1 = TRUE;
542 break;
543 default:
544 return SR_ERR;
545 }
546 }
547
548 if (enabled_pod1 && enabled_chan4)
549 return SR_ERR;
550
551 return SR_OK;
552}
553
554static int dlm_setup_channels(const struct sr_dev_inst *sdi)
555{
556 GSList *l;
557 unsigned int i;
558 gboolean *pod_enabled, setup_changed;
559 struct scope_state *state;
560 struct scope_config *model;
561 struct sr_channel *ch;
562 struct dev_context *devc;
563 struct sr_scpi_dev_inst *scpi;
564
565 devc = sdi->priv;
566 scpi = sdi->conn;
567 state = devc->model_state;
568 model = devc->model_config;
569 setup_changed = FALSE;
570
ac10a927 571 pod_enabled = g_malloc0(sizeof(gboolean) * model->pods);
8ab929d6
SA
572
573 for (l = sdi->channels; l; l = l->next) {
574 ch = l->data;
575 switch (ch->type) {
576 case SR_CHANNEL_ANALOG:
577 if (ch->enabled == state->analog_states[ch->index].state)
578 break;
579
580 if (dlm_analog_chan_state_set(scpi, ch->index + 1,
ac10a927 581 ch->enabled) != SR_OK)
8ab929d6
SA
582 return SR_ERR;
583
584 state->analog_states[ch->index].state = ch->enabled;
585 setup_changed = TRUE;
586 break;
587 case SR_CHANNEL_LOGIC:
588 if (ch->enabled)
589 pod_enabled[ch->index / 8] = TRUE;
590
591 if (ch->enabled == state->digital_states[ch->index])
592 break;
593
594 if (dlm_digital_chan_state_set(scpi, ch->index + 1,
ac10a927 595 ch->enabled) != SR_OK)
8ab929d6
SA
596 return SR_ERR;
597
598 state->digital_states[ch->index] = ch->enabled;
599 setup_changed = TRUE;
600 break;
601 default:
602 return SR_ERR;
603 }
604 }
605
606 for (i = 1; i <= model->pods; ++i) {
607 if (state->pod_states[i - 1] == pod_enabled[i - 1])
608 continue;
609
610 if (dlm_digital_pod_state_set(scpi, i,
ac10a927 611 pod_enabled[i - 1]) != SR_OK)
8ab929d6
SA
612 return SR_ERR;
613
614 state->pod_states[i - 1] = pod_enabled[i - 1];
615 setup_changed = TRUE;
616 }
617
618 g_free(pod_enabled);
619
620 if (setup_changed && dlm_sample_rate_query(sdi) != SR_OK)
621 return SR_ERR;
622
623 return SR_OK;
624}
625
626static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
627{
628 GSList *l;
629 gboolean digital_added;
630 struct sr_channel *ch;
631 struct dev_context *devc;
632 struct sr_scpi_dev_inst *scpi;
633
634 (void)cb_data;
635
ac10a927
SA
636 if (sdi->status != SR_ST_ACTIVE)
637 return SR_ERR_DEV_CLOSED;
8ab929d6
SA
638
639 scpi = sdi->conn;
640 devc = sdi->priv;
641 digital_added = FALSE;
642
643 g_slist_free(devc->enabled_channels);
644 devc->enabled_channels = NULL;
645
646 for (l = sdi->channels; l; l = l->next) {
647 ch = l->data;
648 if (!ch->enabled)
649 continue;
650 /* Only add a single digital channel. */
651 if (ch->type != SR_CHANNEL_LOGIC || !digital_added) {
652 devc->enabled_channels = g_slist_append(
ac10a927
SA
653 devc->enabled_channels, ch);
654 if (ch->type == SR_CHANNEL_LOGIC)
655 digital_added = TRUE;
8ab929d6
SA
656 }
657 }
658
659 if (!devc->enabled_channels)
660 return SR_ERR;
661
662 if (dlm_check_channels(devc->enabled_channels) != SR_OK) {
663 sr_err("Invalid channel configuration specified!");
664 return SR_ERR_NA;
665 }
666
667 if (dlm_setup_channels(sdi) != SR_OK) {
668 sr_err("Failed to setup channel configuration!");
669 return SR_ERR;
670 }
671
af3487ec
SA
672 /* Request data for the first enabled channel. */
673 devc->current_channel = devc->enabled_channels;
674 dlm_channel_data_request(sdi);
675
0028d5a1
SA
676 /* Call our callback when data comes in or after 5ms. */
677 sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 5,
8ab929d6
SA
678 dlm_data_receive, (void *)sdi);
679
680 return SR_OK;
681}
682
683static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
684{
685 struct dev_context *devc;
8ab929d6
SA
686 struct sr_datafeed_packet packet;
687
688 (void)cb_data;
689
690 packet.type = SR_DF_END;
691 packet.payload = NULL;
692 sr_session_send(sdi, &packet);
693
694 if (sdi->status != SR_ST_ACTIVE)
695 return SR_ERR_DEV_CLOSED;
696
697 devc = sdi->priv;
698
699 devc->num_frames = 0;
700 g_slist_free(devc->enabled_channels);
701 devc->enabled_channels = NULL;
af3487ec
SA
702
703 sr_scpi_source_remove(sdi->session, sdi->conn);
8ab929d6
SA
704
705 return SR_OK;
706}
10763937
SA
707
708SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info = {
709 .name = "yokogawa-dlm",
ac10a927 710 .longname = "Yokogawa DL/DLM",
10763937 711 .api_version = 1,
8ab929d6
SA
712 .init = init,
713 .cleanup = cleanup,
714 .scan = scan,
715 .dev_list = dev_list,
716 .dev_clear = dev_clear,
717 .config_get = config_get,
718 .config_set = config_set,
719 .config_list = config_list,
720 .dev_open = dev_open,
721 .dev_close = dev_close,
722 .dev_acquisition_start = dev_acquisition_start,
723 .dev_acquisition_stop = dev_acquisition_stop,
10763937
SA
724 .priv = NULL,
725};