iio: frequency: Update DDS drivers to use new channel naming convention

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Michael Hennerich 2012-04-27 10:58:35 +02:00 committed by Greg Kroah-Hartman
parent a6b12855b5
commit 73e016ef94
4 changed files with 109 additions and 106 deletions

View file

@ -1,83 +1,86 @@
What: /sys/bus/iio/devices/.../ddsX_freqY
What: /sys/bus/iio/devices/.../out_altvoltageX_frequencyY
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
Stores frequency into tuning word Y.
There will be more than one ddsX_freqY file, which allows for
pin controlled FSK Frequency Shift Keying
(ddsX_pincontrol_freq_en is active) or the user can control
the desired active tuning word by writing Y to the
ddsX_freqsymbol file.
There will be more than one out_altvoltageX_frequencyY file,
which allows for pin controlled FSK Frequency Shift Keying
(out_altvoltageX_pincontrol_frequency_en is active) or the user
can control the desired active tuning word by writing Y to the
out_altvoltageX_frequencysymbol file.
What: /sys/bus/iio/devices/.../ddsX_freqY_scale
What: /sys/bus/iio/devices/.../out_altvoltageX_frequencyY_scale
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
Scale to be applied to ddsX_freqY in order to obtain the
desired value in Hz. If shared across all frequency registers
Y is not present. It is also possible X is not present if
shared across all channels.
Scale to be applied to out_altvoltageX_frequencyY in order to
obtain the desired value in Hz. If shared across all frequency
registers Y is not present. It is also possible X is not present
if shared across all channels.
What: /sys/bus/iio/devices/.../ddsX_freqsymbol
What: /sys/bus/iio/devices/.../out_altvoltageX_frequencysymbol
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
Specifies the active output frequency tuning word. The value
corresponds to the Y in ddsX_freqY. To exit this mode the user
can write ddsX_pincontrol_freq_en or ddsX_out_enable file.
corresponds to the Y in out_altvoltageX_frequencyY.
To exit this mode the user can write
out_altvoltageX_pincontrol_frequency_en or
out_altvoltageX_out_enable file.
What: /sys/bus/iio/devices/.../ddsX_phaseY
What: /sys/bus/iio/devices/.../out_altvoltageX_phaseY
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
Stores phase into Y.
There will be more than one ddsX_phaseY file, which allows for
pin controlled PSK Phase Shift Keying
(ddsX_pincontrol_phase_en is active) or the user can
There will be more than one out_altvoltageX_phaseY file, which
allows for pin controlled PSK Phase Shift Keying
(out_altvoltageX_pincontrol_phase_en is active) or the user can
control the desired phase Y which is added to the phase
accumulator output by writing Y to the en_phase file.
accumulator output by writing Y to the phase_en file.
What: /sys/bus/iio/devices/.../ddsX_phaseY_scale
What: /sys/bus/iio/devices/.../out_altvoltageX_phaseY_scale
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
Scale to be applied to ddsX_phaseY in order to obtain the
desired value in rad. If shared across all phase registers
Scale to be applied to out_altvoltageX_phaseY in order to obtain
the desired value in rad. If shared across all phase registers
Y is not present. It is also possible X is not present if
shared across all channels.
What: /sys/bus/iio/devices/.../ddsX_phasesymbol
What: /sys/bus/iio/devices/.../out_altvoltageX_phasesymbol
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
Specifies the active phase Y which is added to the phase
accumulator output. The value corresponds to the Y in
ddsX_phaseY. To exit this mode the user can write
ddsX_pincontrol_phase_en or disable file.
out_altvoltageX_phaseY. To exit this mode the user can write
out_altvoltageX_pincontrol_phase_en or disable file.
What: /sys/bus/iio/devices/.../ddsX_pincontrol_en
What: /sys/bus/iio/devices/.../ddsX_pincontrol_freq_en
What: /sys/bus/iio/devices/.../ddsX_pincontrol_phase_en
What: /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_en
What: /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_frequency_en
What: /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_phase_en
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
ddsX_pincontrol_en: Both, the active frequency and phase is
controlled by the respective phase and frequency control inputs.
In case the device in question allows to independent controls,
then there are dedicated files (ddsX_pincontrol_freq_en,
ddsX_pincontrol_phase_en).
out_altvoltageX_pincontrol_en: Both, the active frequency and
phase is controlled by the respective phase and frequency
control inputs. In case the device in features independent
controls, then there are dedicated files
(out_altvoltageX_pincontrol_frequency_en,
out_altvoltageX_pincontrol_phase_en).
What: /sys/bus/iio/devices/.../ddsX_out_enable
What: /sys/bus/iio/devices/.../ddsX_outY_enable
What: /sys/bus/iio/devices/.../out_altvoltageX_out_enable
What: /sys/bus/iio/devices/.../out_altvoltageX_outY_enable
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
ddsX_outY_enable controls signal generation on output Y of
channel X. Y may be suppressed if all channels are
out_altvoltageX_outY_enable controls signal generation on
output Y of channel X. Y may be suppressed if all channels are
controlled together.
What: /sys/bus/iio/devices/.../ddsX_outY_wavetype
What: /sys/bus/iio/devices/.../out_altvoltageX_outY_wavetype
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:
@ -86,7 +89,7 @@ Description:
For a list of available output waveform options read
available_output_modes.
What: /sys/bus/iio/devices/.../ddsX_outY_wavetype_available
What: /sys/bus/iio/devices/.../out_altvoltageX_outY_wavetype_available
KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org
Description:

View file

@ -177,18 +177,18 @@ static IIO_DEV_ATTR_OUT_ENABLE(0, S_IWUSR, NULL,
ad9832_write, AD9832_OUTPUT_EN);
static struct attribute *ad9832_attributes[] = {
&iio_dev_attr_dds0_freq0.dev_attr.attr,
&iio_dev_attr_dds0_freq1.dev_attr.attr,
&iio_const_attr_dds0_freq_scale.dev_attr.attr,
&iio_dev_attr_dds0_phase0.dev_attr.attr,
&iio_dev_attr_dds0_phase1.dev_attr.attr,
&iio_dev_attr_dds0_phase2.dev_attr.attr,
&iio_dev_attr_dds0_phase3.dev_attr.attr,
&iio_const_attr_dds0_phase_scale.dev_attr.attr,
&iio_dev_attr_dds0_pincontrol_en.dev_attr.attr,
&iio_dev_attr_dds0_freqsymbol.dev_attr.attr,
&iio_dev_attr_dds0_phasesymbol.dev_attr.attr,
&iio_dev_attr_dds0_out_enable.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequency0.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequency1.dev_attr.attr,
&iio_const_attr_out_altvoltage0_frequency_scale.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase0.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase1.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase2.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase3.dev_attr.attr,
&iio_const_attr_out_altvoltage0_phase_scale.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_pincontrol_en.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequencysymbol.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phasesymbol.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out_enable.dev_attr.attr,
NULL,
};

View file

@ -218,7 +218,7 @@ static ssize_t ad9834_show_out0_wavetype_available(struct device *dev,
}
static IIO_DEVICE_ATTR(dds0_out0_wavetype_available, S_IRUGO,
static IIO_DEVICE_ATTR(out_altvoltage0_out0_wavetype_available, S_IRUGO,
ad9834_show_out0_wavetype_available, NULL, 0);
static ssize_t ad9834_show_out1_wavetype_available(struct device *dev,
@ -237,7 +237,7 @@ static ssize_t ad9834_show_out1_wavetype_available(struct device *dev,
return sprintf(buf, "%s\n", str);
}
static IIO_DEVICE_ATTR(dds0_out1_wavetype_available, S_IRUGO,
static IIO_DEVICE_ATTR(out_altvoltage0_out1_wavetype_available, S_IRUGO,
ad9834_show_out1_wavetype_available, NULL, 0);
/**
@ -263,36 +263,36 @@ static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 0);
static IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1);
static struct attribute *ad9834_attributes[] = {
&iio_dev_attr_dds0_freq0.dev_attr.attr,
&iio_dev_attr_dds0_freq1.dev_attr.attr,
&iio_const_attr_dds0_freq_scale.dev_attr.attr,
&iio_dev_attr_dds0_phase0.dev_attr.attr,
&iio_dev_attr_dds0_phase1.dev_attr.attr,
&iio_const_attr_dds0_phase_scale.dev_attr.attr,
&iio_dev_attr_dds0_pincontrol_en.dev_attr.attr,
&iio_dev_attr_dds0_freqsymbol.dev_attr.attr,
&iio_dev_attr_dds0_phasesymbol.dev_attr.attr,
&iio_dev_attr_dds0_out_enable.dev_attr.attr,
&iio_dev_attr_dds0_out1_enable.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype.dev_attr.attr,
&iio_dev_attr_dds0_out1_wavetype.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype_available.dev_attr.attr,
&iio_dev_attr_dds0_out1_wavetype_available.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequency0.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequency1.dev_attr.attr,
&iio_const_attr_out_altvoltage0_frequency_scale.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase0.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase1.dev_attr.attr,
&iio_const_attr_out_altvoltage0_phase_scale.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_pincontrol_en.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequencysymbol.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phasesymbol.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out_enable.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out1_enable.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out0_wavetype.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out1_wavetype.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out0_wavetype_available.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out1_wavetype_available.dev_attr.attr,
NULL,
};
static struct attribute *ad9833_attributes[] = {
&iio_dev_attr_dds0_freq0.dev_attr.attr,
&iio_dev_attr_dds0_freq1.dev_attr.attr,
&iio_const_attr_dds0_freq_scale.dev_attr.attr,
&iio_dev_attr_dds0_phase0.dev_attr.attr,
&iio_dev_attr_dds0_phase1.dev_attr.attr,
&iio_const_attr_dds0_phase_scale.dev_attr.attr,
&iio_dev_attr_dds0_freqsymbol.dev_attr.attr,
&iio_dev_attr_dds0_phasesymbol.dev_attr.attr,
&iio_dev_attr_dds0_out_enable.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype_available.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequency0.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequency1.dev_attr.attr,
&iio_const_attr_out_altvoltage0_frequency_scale.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase0.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phase1.dev_attr.attr,
&iio_const_attr_out_altvoltage0_phase_scale.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_frequencysymbol.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_phasesymbol.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out_enable.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out0_wavetype.dev_attr.attr,
&iio_dev_attr_out_altvoltage0_out0_wavetype_available.dev_attr.attr,
NULL,
};

View file

@ -7,104 +7,104 @@
*/
/**
* /sys/bus/iio/devices/.../ddsX_freqY
* /sys/bus/iio/devices/.../out_altvoltageX_frequencyY
*/
#define IIO_DEV_ATTR_FREQ(_channel, _num, _mode, _show, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_freq##_num, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_frequency##_num, \
_mode, _show, _store, _addr)
/**
* /sys/bus/iio/devices/.../ddsX_freqY_scale
* /sys/bus/iio/devices/.../out_altvoltageX_frequencyY_scale
*/
#define IIO_CONST_ATTR_FREQ_SCALE(_channel, _string) \
IIO_CONST_ATTR(dds##_channel##_freq_scale, _string)
IIO_CONST_ATTR(out_altvoltage##_channel##_frequency_scale, _string)
/**
* /sys/bus/iio/devices/.../ddsX_freqsymbol
* /sys/bus/iio/devices/.../out_altvoltageX_frequencysymbol
*/
#define IIO_DEV_ATTR_FREQSYMBOL(_channel, _mode, _show, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_freqsymbol, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_frequencysymbol, \
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_phaseY
* /sys/bus/iio/devices/.../out_altvoltageX_phaseY
*/
#define IIO_DEV_ATTR_PHASE(_channel, _num, _mode, _show, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_phase##_num, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_phase##_num, \
_mode, _show, _store, _addr)
/**
* /sys/bus/iio/devices/.../ddsX_phaseY_scale
* /sys/bus/iio/devices/.../out_altvoltageX_phaseY_scale
*/
#define IIO_CONST_ATTR_PHASE_SCALE(_channel, _string) \
IIO_CONST_ATTR(dds##_channel##_phase_scale, _string)
IIO_CONST_ATTR(out_altvoltage##_channel##_phase_scale, _string)
/**
* /sys/bus/iio/devices/.../ddsX_phasesymbol
* /sys/bus/iio/devices/.../out_altvoltageX_phasesymbol
*/
#define IIO_DEV_ATTR_PHASESYMBOL(_channel, _mode, _show, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_phasesymbol, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_phasesymbol, \
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_pincontrol_en
* /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_en
*/
#define IIO_DEV_ATTR_PINCONTROL_EN(_channel, _mode, _show, _store, _addr)\
IIO_DEVICE_ATTR(dds##_channel##_pincontrol_en, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_pincontrol_en, \
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_pincontrol_freq_en
* /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_frequency_en
*/
#define IIO_DEV_ATTR_PINCONTROL_FREQ_EN(_channel, _mode, _show, _store, _addr)\
IIO_DEVICE_ATTR(dds##_channel##_pincontrol_freq_en, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_pincontrol_frequency_en,\
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_pincontrol_phase_en
* /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_phase_en
*/
#define IIO_DEV_ATTR_PINCONTROL_PHASE_EN(_channel, _mode, _show, _store, _addr)\
IIO_DEVICE_ATTR(dds##_channel##_pincontrol_phase_en, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_pincontrol_phase_en, \
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_out_enable
* /sys/bus/iio/devices/.../out_altvoltageX_out_enable
*/
#define IIO_DEV_ATTR_OUT_ENABLE(_channel, _mode, _show, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_out_enable, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_out_enable, \
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_outY_enable
* /sys/bus/iio/devices/.../out_altvoltageX_outY_enable
*/
#define IIO_DEV_ATTR_OUTY_ENABLE(_channel, _output, \
_mode, _show, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_out##_output##_enable, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_out##_output##_enable,\
_mode, _show, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_outY_wavetype
* /sys/bus/iio/devices/.../out_altvoltageX_outY_wavetype
*/
#define IIO_DEV_ATTR_OUT_WAVETYPE(_channel, _output, _store, _addr) \
IIO_DEVICE_ATTR(dds##_channel##_out##_output##_wavetype, \
IIO_DEVICE_ATTR(out_altvoltage##_channel##_out##_output##_wavetype,\
S_IWUSR, NULL, _store, _addr);
/**
* /sys/bus/iio/devices/.../ddsX_outY_wavetype_available
* /sys/bus/iio/devices/.../out_altvoltageX_outY_wavetype_available
*/
#define IIO_CONST_ATTR_OUT_WAVETYPES_AVAILABLE(_channel, _output, _modes)\
IIO_CONST_ATTR(dds##_channel##_out##_output##_wavetype_available,\
_modes);
IIO_CONST_ATTR( \
out_altvoltage##_channel##_out##_output##_wavetype_available, _modes);