{
struct dev_context *devc;
int num_ols_changrp, i;
+ uint64_t samplerates_ovrd[3];
+
+ devc = (sdi) ? sdi->priv : NULL;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts,
devopts);
case SR_CONF_SAMPLERATE:
- *data = std_gvar_samplerates_steps(ARRAY_AND_SIZE(samplerates));
+ if (!devc)
+ return SR_ERR_ARG;
+ samplerates_ovrd[0] = samplerates[0];
+ samplerates_ovrd[1] = samplerates[1];
+ samplerates_ovrd[2] = samplerates[2];
+ if (devc->max_samplerate)
+ samplerates_ovrd[1] = devc->max_samplerate;
+ *data = std_gvar_samplerates_steps(ARRAY_AND_SIZE(samplerates_ovrd));
break;
case SR_CONF_TRIGGER_MATCH:
*data = std_gvar_array_i32(ARRAY_AND_SIZE(trigger_matches));