Beispiel #1
0
	return info->adc_feature.conv_mode;
}

static const char * const vf610_conv_modes[] = { "normal", "high-speed",
						 "low-power" };

static const struct iio_enum vf610_conversion_mode = {
	.items = vf610_conv_modes,
	.num_items = ARRAY_SIZE(vf610_conv_modes),
	.get = vf610_get_conversion_mode,
	.set = vf610_set_conversion_mode,
};

static const struct iio_chan_spec_ext_info vf610_ext_info[] = {
	IIO_ENUM("conversion_mode", IIO_SHARED_BY_DIR, &vf610_conversion_mode),
	{},
};

#define VF610_ADC_CHAN(_idx, _chan_type) {			\
	.type = (_chan_type),					\
	.indexed = 1,						\
	.channel = (_idx),					\
	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),		\
	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |	\
				BIT(IIO_CHAN_INFO_SAMP_FREQ),	\
	.ext_info = vf610_ext_info,				\
	.scan_index = (_idx),			\
	.scan_type = {					\
		.sign = 'u',				\
		.realbits = 12,				\
Beispiel #2
0
					  unsigned int meas_conf)
{
	struct hmc5843_data *data = iio_priv(indio_dev);

	return hmc5843_set_meas_conf(data, meas_conf);
}

static const struct iio_enum hmc5843_meas_conf_enum = {
	.items = hmc5843_meas_conf_modes,
	.num_items = ARRAY_SIZE(hmc5843_meas_conf_modes),
	.get = hmc5843_show_measurement_configuration,
	.set = hmc5843_set_measurement_configuration,
};

static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
	IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
	IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
	{ },
};

static const struct iio_enum hmc5983_meas_conf_enum = {
	.items = hmc5983_meas_conf_modes,
	.num_items = ARRAY_SIZE(hmc5983_meas_conf_modes),
	.get = hmc5843_show_measurement_configuration,
	.set = hmc5843_set_measurement_configuration,
};

static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
	IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
	IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
	{ },