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