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