Deprecate SR_DI_CUR_SAMPLERATE.

This is replaced by SR_CONF_SAMPLERATE.
This commit is contained in:
Bert Vermeulen 2013-01-25 03:17:36 +01:00
parent fbec8bd2f3
commit 123e131383
19 changed files with 18 additions and 20 deletions

View File

@ -151,7 +151,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
*data = &devc->cur_samplerate;
break;
default:

View File

@ -798,7 +798,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_TRIGGER_TYPES:
*data = (char *)TRIGGER_TYPES;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
*data = &devc->cur_samplerate;

View File

@ -301,7 +301,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
sr_spew("%s: Returning trigger types: %s.", __func__,
TRIGGER_TYPES);
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
*data = &devc->cur_samplerate;

View File

@ -234,7 +234,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
*data = &cur_samplerate;
break;
case SR_DI_PATTERNS:

View File

@ -613,7 +613,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_TRIGGER_TYPES:
*data = TRIGGER_TYPES;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
*data = &devc->cur_samplerate;

View File

@ -451,7 +451,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
*data = coupling;
break;
/* TODO remove this */
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
*data = &tmp;
break;
default:

View File

@ -309,7 +309,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_TRIGGER_TYPES:
*data = (char *)TRIGGER_TYPES;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
*data = &devc->cur_rate;

View File

@ -264,7 +264,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_TRIGGER_TYPES:
*data = (char *)TRIGGER_TYPES;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
*data = &devc->cur_samplerate;

View File

@ -200,7 +200,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
*data = hwcaps;
sr_spew("%s: Returning hwcaps.", __func__);
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
/* TODO: Get rid of this. */
*data = NULL;
sr_spew("%s: Returning current samplerate.", __func__);

View File

@ -541,7 +541,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
*data = TRIGGER_TYPES;
sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES);
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
devc = sdi->priv;
*data = &devc->cur_samplerate;

View File

@ -553,8 +553,6 @@ enum {
SR_DI_HWCAPS,
/** Types of logic trigger supported, out of "01crf" (char *). */
SR_DI_TRIGGER_TYPES,
/** The currently set samplerate in Hz (uint64_t). */
SR_DI_CUR_SAMPLERATE,
/** Supported patterns (in pattern generator mode). */
SR_DI_PATTERNS,
/** Supported buffer sizes. */

View File

@ -129,7 +129,7 @@ static int init(struct sr_output *o)
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE,
o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
(const void **)&samplerate, o->sdi);
ctx->samplerate = *samplerate;
} else

View File

@ -100,7 +100,7 @@ static int init(struct sr_output *o)
num_probes = g_slist_length(o->sdi->probes);
if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE,
o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
(const void **)&samplerate, o->sdi);
ctx->samplerate = *samplerate;
} else

View File

@ -110,7 +110,7 @@ static int init(struct sr_output *o)
num_probes = g_slist_length(o->sdi->probes);
comment[0] = '\0';
if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE,
o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
(const void **)&samplerate, o->sdi);
if (!(frequency_s = sr_samplerate_string(*samplerate))) {
sr_err("%s: sr_samplerate_string failed", __func__);

View File

@ -70,7 +70,7 @@ static int init(struct sr_output *o)
ctx->unitsize = (num_enabled_probes + 7) / 8;
if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE))
o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE,
o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
(const void **)&samplerate, o->sdi);
else {
tmp = 0;

View File

@ -124,7 +124,7 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
num_probes = g_slist_length(o->sdi->probes);
if (o->sdi->driver || sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
ret = o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE,
ret = o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
(const void **)&samplerate, o->sdi);
if (ret != SR_OK)
goto err;

View File

@ -95,7 +95,7 @@ static int init(struct sr_output *o)
PACKAGE, PACKAGE_VERSION);
if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE,
o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
(const void **)&samplerate, o->sdi);
ctx->samplerate = *samplerate;
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {

View File

@ -156,7 +156,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_CUR_SAMPLERATE:
case SR_CONF_SAMPLERATE:
if (sdi) {
vdev = sdi->priv;
*data = &vdev->samplerate;

View File

@ -254,7 +254,7 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
fprintf(meta, "unitsize = %d\n", unitsize);
fprintf(meta, "total probes = %d\n", g_slist_length(sdi->probes));
if (sr_dev_has_hwcap(sdi, SR_CONF_SAMPLERATE)) {
if (sr_info_get(sdi->driver, SR_DI_CUR_SAMPLERATE,
if (sr_info_get(sdi->driver, SR_CONF_SAMPLERATE,
(const void **)&samplerate, sdi) == SR_OK) {
s = sr_samplerate_string(*samplerate);
fprintf(meta, "samplerate = %s\n", s);