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: case SR_DI_HWCAPS:
*data = hwcaps; *data = hwcaps;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = &devc->cur_samplerate; *data = &devc->cur_samplerate;
break; break;
default: 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: case SR_DI_TRIGGER_TYPES:
*data = (char *)TRIGGER_TYPES; *data = (char *)TRIGGER_TYPES;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; devc = sdi->priv;
*data = &devc->cur_samplerate; *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__, sr_spew("%s: Returning trigger types: %s.", __func__,
TRIGGER_TYPES); TRIGGER_TYPES);
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; devc = sdi->priv;
*data = &devc->cur_samplerate; *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: case SR_DI_HWCAPS:
*data = hwcaps; *data = hwcaps;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = &cur_samplerate; *data = &cur_samplerate;
break; break;
case SR_DI_PATTERNS: 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: case SR_DI_TRIGGER_TYPES:
*data = TRIGGER_TYPES; *data = TRIGGER_TYPES;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; devc = sdi->priv;
*data = &devc->cur_samplerate; *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; *data = coupling;
break; break;
/* TODO remove this */ /* TODO remove this */
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
*data = &tmp; *data = &tmp;
break; break;
default: 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: case SR_DI_TRIGGER_TYPES:
*data = (char *)TRIGGER_TYPES; *data = (char *)TRIGGER_TYPES;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; devc = sdi->priv;
*data = &devc->cur_rate; *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: case SR_DI_TRIGGER_TYPES:
*data = (char *)TRIGGER_TYPES; *data = (char *)TRIGGER_TYPES;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; devc = sdi->priv;
*data = &devc->cur_samplerate; *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; *data = hwcaps;
sr_spew("%s: Returning hwcaps.", __func__); sr_spew("%s: Returning hwcaps.", __func__);
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
/* TODO: Get rid of this. */ /* TODO: Get rid of this. */
*data = NULL; *data = NULL;
sr_spew("%s: Returning current samplerate.", __func__); 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; *data = TRIGGER_TYPES;
sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES); sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES);
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
devc = sdi->priv; devc = sdi->priv;
*data = &devc->cur_samplerate; *data = &devc->cur_samplerate;

View File

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

View File

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

View File

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

View File

@ -110,7 +110,7 @@ static int init(struct sr_output *o)
num_probes = g_slist_length(o->sdi->probes); num_probes = g_slist_length(o->sdi->probes);
comment[0] = '\0'; comment[0] = '\0';
if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { 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); (const void **)&samplerate, o->sdi);
if (!(frequency_s = sr_samplerate_string(*samplerate))) { if (!(frequency_s = sr_samplerate_string(*samplerate))) {
sr_err("%s: sr_samplerate_string failed", __func__); 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; ctx->unitsize = (num_enabled_probes + 7) / 8;
if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) 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); (const void **)&samplerate, o->sdi);
else { else {
tmp = 0; 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); snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
num_probes = g_slist_length(o->sdi->probes); num_probes = g_slist_length(o->sdi->probes);
if (o->sdi->driver || sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { 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); (const void **)&samplerate, o->sdi);
if (ret != SR_OK) if (ret != SR_OK)
goto err; goto err;

View File

@ -95,7 +95,7 @@ static int init(struct sr_output *o)
PACKAGE, PACKAGE_VERSION); PACKAGE, PACKAGE_VERSION);
if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { 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); (const void **)&samplerate, o->sdi);
ctx->samplerate = *samplerate; ctx->samplerate = *samplerate;
if (!((samplerate_s = sr_samplerate_string(ctx->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: case SR_DI_HWCAPS:
*data = hwcaps; *data = hwcaps;
break; break;
case SR_DI_CUR_SAMPLERATE: case SR_CONF_SAMPLERATE:
if (sdi) { if (sdi) {
vdev = sdi->priv; vdev = sdi->priv;
*data = &vdev->samplerate; *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, "unitsize = %d\n", unitsize);
fprintf(meta, "total probes = %d\n", g_slist_length(sdi->probes)); fprintf(meta, "total probes = %d\n", g_slist_length(sdi->probes));
if (sr_dev_has_hwcap(sdi, SR_CONF_SAMPLERATE)) { 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) { (const void **)&samplerate, sdi) == SR_OK) {
s = sr_samplerate_string(*samplerate); s = sr_samplerate_string(*samplerate);
fprintf(meta, "samplerate = %s\n", s); fprintf(meta, "samplerate = %s\n", s);