]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
deprecate SR_DI_SAMPLERATES
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index fcd8c064af213070ecc4140efd6e7ee87e9ca93b..b8f9fb1a7a8d1ca98c7144218e732d91a8f64b0c 100644 (file)
@@ -529,19 +529,14 @@ static int hw_cleanup(void)
        return SR_OK;
 }
 
-static int hw_info_get(int info_id, const void **data,
-       const struct sr_dev_inst *sdi)
+static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 
-       switch (info_id) {
+       switch (id) {
        case SR_DI_HWCAPS:
                *data = hwcaps;
                break;
-       case SR_DI_SAMPLERATES:
-               *data = &samplerates;
-               sr_spew("zp: %s: Returning samplerates.", __func__);
-               break;
        case SR_DI_TRIGGER_TYPES:
                *data = TRIGGER_TYPES;
                sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES);
@@ -624,8 +619,7 @@ static int set_capture_ratio(struct dev_context *devc, uint64_t ratio)
        return SR_OK;
 }
 
-static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
-                            const void *value)
+static int config_set(int id, const void *value, const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 
@@ -639,7 +633,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                return SR_ERR_ARG;
        }
 
-       switch (hwcap) {
+       switch (id) {
        case SR_CONF_SAMPLERATE:
                return set_samplerate(devc, *(const uint64_t *)value);
        case SR_CONF_LIMIT_SAMPLES:
@@ -651,6 +645,22 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 }
 
+static int config_list(int key, const void **data, const struct sr_dev_inst *sdi)
+{
+
+       (void)sdi;
+
+       switch (key) {
+       case SR_CONF_SAMPLERATE:
+               *data = &samplerates;
+               break;
+       default:
+               return SR_ERR_ARG;
+       }
+
+       return SR_OK;
+}
+
 static void set_triggerbar(struct dev_context *devc)
 {
        unsigned int ramsize;
@@ -787,10 +797,11 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
        .scan = hw_scan,
        .dev_list = hw_dev_list,
        .dev_clear = hw_cleanup,
+       .config_get = config_get,
+       .config_set = config_set,
+       .config_list = config_list,
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
-       .info_get = hw_info_get,
-       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
        .priv = NULL,