drivers: Consistently name per-cg options 'devopts_cg_*'.

This commit is contained in:
Uwe Hermann 2017-07-19 22:40:47 +02:00
parent 4b25cbffa1
commit 6b82c3e57a
8 changed files with 24 additions and 24 deletions

View File

@ -492,7 +492,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
} else if (cg_type == CG_ANALOG) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
model->analog_devopts, model->num_analog_devopts,
model->devopts_cg_analog, model->num_devopts_cg_analog,
sizeof(uint32_t));
} else {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,

View File

@ -68,7 +68,7 @@ static const uint32_t devopts[] = {
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint32_t analog_devopts[] = {
static const uint32_t devopts_cg_analog[] = {
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
@ -259,8 +259,8 @@ static const struct scope_config scope_models[] = {
.devopts = &devopts,
.num_devopts = ARRAY_SIZE(devopts),
.analog_devopts = &analog_devopts,
.num_analog_devopts = ARRAY_SIZE(analog_devopts),
.devopts_cg_analog = &devopts_cg_analog,
.num_devopts_cg_analog = ARRAY_SIZE(devopts_cg_analog),
.coupling_options = &coupling_options,
.trigger_sources = &compact2_trigger_sources,
@ -289,8 +289,8 @@ static const struct scope_config scope_models[] = {
.devopts = &devopts,
.num_devopts = ARRAY_SIZE(devopts),
.analog_devopts = &analog_devopts,
.num_analog_devopts = ARRAY_SIZE(analog_devopts),
.devopts_cg_analog = &devopts_cg_analog,
.num_devopts_cg_analog = ARRAY_SIZE(devopts_cg_analog),
.coupling_options = &coupling_options,
.trigger_sources = &compact4_trigger_sources,
@ -319,8 +319,8 @@ static const struct scope_config scope_models[] = {
.devopts = &devopts,
.num_devopts = ARRAY_SIZE(devopts),
.analog_devopts = &analog_devopts,
.num_analog_devopts = ARRAY_SIZE(analog_devopts),
.devopts_cg_analog = &devopts_cg_analog,
.num_devopts_cg_analog = ARRAY_SIZE(devopts_cg_analog),
.coupling_options = &coupling_options,
.trigger_sources = &compact4_dig16_trigger_sources,

View File

@ -46,8 +46,8 @@ struct scope_config {
const uint32_t (*devopts)[];
const uint8_t num_devopts;
const uint32_t (*analog_devopts)[];
const uint8_t num_analog_devopts;
const uint32_t (*devopts_cg_analog)[];
const uint8_t num_devopts_cg_analog;
const char *(*coupling_options)[];
const uint8_t num_coupling_options;

View File

@ -39,7 +39,7 @@ static const uint32_t devopts[] = {
SR_CONF_BUFFERSIZE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint32_t cgopts[] = {
static const uint32_t devopts_cg[] = {
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_PROBE_FACTOR | SR_CONF_GET | SR_CONF_SET,
@ -596,7 +596,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
if (!cg)
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
cgopts, ARRAY_SIZE(cgopts), sizeof(uint32_t));
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
break;
case SR_CONF_SAMPLERATE:
g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));

View File

@ -46,7 +46,7 @@ static const uint32_t devopts[] = {
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint32_t analog_devopts[] = {
static const uint32_t devopts_cg_analog[] = {
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
@ -401,7 +401,7 @@ static int config_list(uint32_t key, GVariant **data,
if (!cg)
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
analog_devopts, ARRAY_SIZE(analog_devopts),
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog),
sizeof(uint32_t));
break;
case SR_CONF_COUPLING:

View File

@ -51,7 +51,7 @@ static const uint32_t devopts[] = {
};
/** Hardware capabilities channel 1, 2. */
static const uint32_t devopts_ch12[] = {
static const uint32_t devopts_cg_ch12[] = {
SR_CONF_VOLTAGE | SR_CONF_GET,
SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_CURRENT | SR_CONF_GET,
@ -60,7 +60,7 @@ static const uint32_t devopts_ch12[] = {
};
/** Hardware capabilities channel 3 (LPS-304/305 only). */
static const uint32_t devopts_ch3[] = {
static const uint32_t devopts_cg_ch3[] = {
SR_CONF_VOLTAGE | SR_CONF_GET,
SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET,
};
@ -685,10 +685,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
case SR_CONF_DEVICE_OPTIONS:
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts_ch12, ARRAY_SIZE(devopts_ch12), sizeof(uint32_t));
devopts_cg_ch12, ARRAY_SIZE(devopts_cg_ch12), sizeof(uint32_t));
else /* Must be CH3 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t));
devopts_cg_ch3, ARRAY_SIZE(devopts_cg_ch3), sizeof(uint32_t));
break;
case SR_CONF_VOLTAGE_TARGET:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);

View File

@ -53,7 +53,7 @@ static const uint32_t devopts[] = {
SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint32_t analog_devopts[] = {
static const uint32_t devopts_cg_analog[] = {
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
@ -860,7 +860,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
for (i = 0; i < devc->model->analog_channels; i++) {
if (cg == devc->analog_groups[i]) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
analog_devopts, ARRAY_SIZE(analog_devopts), sizeof(uint32_t));
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t));
return SR_OK;
}
}

View File

@ -47,13 +47,13 @@ static const uint32_t devopts[] = {
SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint32_t analog_devopts[] = {
static const uint32_t devopts_cg_analog[] = {
SR_CONF_NUM_VDIV | SR_CONF_GET,
SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
};
static const uint32_t digital_devopts[] = {
static const uint32_t devopts_cg_digital[] = {
};
enum {
@ -509,10 +509,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
case SR_CONF_DEVICE_OPTIONS:
if (cg_type == CG_ANALOG) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
analog_devopts, ARRAY_SIZE(analog_devopts), sizeof(uint32_t));
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t));
} else if (cg_type == CG_DIGITAL) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
digital_devopts, ARRAY_SIZE(digital_devopts), sizeof(uint32_t));
devopts_cg_digital, ARRAY_SIZE(devopts_cg_digital), sizeof(uint32_t));
} else {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
NULL, 0, sizeof(uint32_t));