Get rid of obsolete SR_DI_NUM_PROBES and SR_DI_PROBE_NAMES.

Frontends should use the probe list in the device's sr_dev_inst
to get this information.
This commit is contained in:
Bert Vermeulen 2013-01-15 17:20:57 +01:00
parent bd58d8f3ec
commit 6b8d6f93bb
19 changed files with 1 additions and 181 deletions

View File

@ -41,11 +41,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"Probe",
NULL,
};
extern const struct agdmm_job agdmm_jobs_u123x[];
extern const struct agdmm_recv agdmm_recvs_u123x[];
extern const struct agdmm_job agdmm_jobs_u125x[];
@ -265,12 +260,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
return SR_ERR_ARG;
}

View File

@ -34,11 +34,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"Channel 0", "Channel 1",
NULL,
};
SR_PRIV struct sr_dev_driver alsa_driver_info;
static struct sr_dev_driver *di = &alsa_driver_info;
@ -157,12 +152,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = &devc->num_probes;
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
case SR_DI_CUR_SAMPLERATE:
*data = &devc->cur_samplerate;
break;

View File

@ -796,12 +796,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(NUM_PROBES);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
break;

View File

@ -297,15 +297,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(NUM_PROBES);
sr_spew("%s: Returning number of probes: %d.", __func__,
NUM_PROBES);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
sr_spew("%s: Returning probenames.", __func__);
break;
case SR_DI_SAMPLERATES:
fill_supported_samplerates_if_needed();
*data = &samplerates;

View File

@ -44,11 +44,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"P1",
NULL,
};
SR_PRIV struct sr_dev_driver colead_slm_driver_info;
static struct sr_dev_driver *di = &colead_slm_driver_info;
@ -209,12 +204,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
return SR_ERR_ARG;
}

View File

@ -235,12 +235,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(NUM_PROBES);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
break;

View File

@ -41,11 +41,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"Probe",
NULL,
};
SR_PRIV struct sr_dev_driver flukedmm_driver_info;
static struct sr_dev_driver *di = &flukedmm_driver_info;
@ -299,12 +294,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
return SR_ERR_ARG;
}

View File

@ -612,18 +612,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
if (sdi) {
devc = sdi->priv;
*data = GINT_TO_POINTER(
(devc->profile->dev_caps & DEV_CAPS_16BIT) ?
16 : 8);
} else
return SR_ERR;
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
break;

View File

@ -428,12 +428,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(NUM_PROBES);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
case SR_DI_BUFFERSIZES:
*data = buffersizes;
break;

View File

@ -40,11 +40,6 @@ static const int hwcaps[] = {
0
};
static const char *probe_names[] = {
"P1",
NULL,
};
/* Properly close and free all devices. */
static int clear_instances(void)
{
@ -231,12 +226,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
sr_err("Unknown info_id: %d.", info_id);
return SR_ERR_ARG;

View File

@ -307,12 +307,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = mso19_probe_names;
break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
break;

View File

@ -262,12 +262,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = ols_probe_names;
break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
break;

View File

@ -40,11 +40,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"CH1", "CH2",
NULL,
};
static const struct sr_rational timebases[] = {
/* nanoseconds */
{ 2, 1000000000 },
@ -339,12 +334,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(NUM_PROBES);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
case SR_DI_TIMEBASES:
*data = timebases;
break;

View File

@ -43,11 +43,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"Probe",
NULL,
};
SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info;
SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info;
SR_PRIV struct sr_dev_driver metex_me31_driver_info;
@ -390,12 +385,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
return SR_ERR_ARG;
}

View File

@ -39,11 +39,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"P1",
NULL,
};
SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info;
static struct sr_dev_driver *di = &tondaj_sl_814_driver_info;
@ -144,7 +139,7 @@ static GSList *hw_scan(GSList *options)
sdi->priv = devc;
sdi->driver = di;
probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, probe_names[0]);
probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1");
if (!probe) {
sr_err("Failed to create probe.");
return NULL;
@ -212,12 +207,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
sr_err("Unknown info_id: %d.", info_id);
return SR_ERR_ARG;

View File

@ -32,11 +32,6 @@ static const int hwcaps[] = {
0,
};
static const char *probe_names[] = {
"Probe",
NULL,
};
SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info;
SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info;
@ -178,14 +173,6 @@ static int hw_info_get(int info_id, const void **data,
*data = hwcaps;
sr_spew("%s: Returning hwcaps.", __func__);
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
sr_spew("%s: Returning number of probes.", __func__);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
sr_spew("%s: Returning probe names.", __func__);
break;
case SR_DI_SAMPLERATES:
/* TODO: Get rid of this. */
*data = NULL;

View File

@ -44,11 +44,6 @@ static const int hwcaps[] = {
0
};
static const char *probe_names[] = {
"P1",
NULL,
};
/* Properly close and free all devices. */
static int clear_instances(void)
{
@ -258,12 +253,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
*data = GINT_TO_POINTER(1);
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
break;
default:
sr_err("Unknown info_id: %d.", info_id);
return SR_ERR_ARG;

View File

@ -538,19 +538,6 @@ static int hw_info_get(int info_id, const void **data,
case SR_DI_HWCAPS:
*data = hwcaps;
break;
case SR_DI_NUM_PROBES:
if (sdi) {
devc = sdi->priv;
*data = GINT_TO_POINTER(devc->num_channels);
sr_spew("zp: %s: Returning number of channels: %d.",
__func__, devc->num_channels);
} else
return SR_ERR;
break;
case SR_DI_PROBE_NAMES:
*data = probe_names;
sr_spew("zp: %s: Returning probenames.", __func__);
break;
case SR_DI_SAMPLERATES:
*data = &samplerates;
sr_spew("zp: %s: Returning samplerates.", __func__);

View File

@ -567,10 +567,6 @@ enum {
SR_DI_HWOPTS = 10000,
/** A list of capabilities supported by the device. */
SR_DI_HWCAPS,
/** The number of probes connected to this device. */
SR_DI_NUM_PROBES,
/** The probe names on this device. */
SR_DI_PROBE_NAMES,
/** Samplerates supported by this device (struct sr_samplerates). */
SR_DI_SAMPLERATES,
/** Types of logic trigger supported, out of "01crf" (char *). */