Commit 73e016ef authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

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

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a6b12855
What: /sys/bus/iio/devices/.../ddsX_freqY What: /sys/bus/iio/devices/.../out_altvoltageX_frequencyY
KernelVersion: 2.6.37 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Stores frequency into tuning word Y. Stores frequency into tuning word Y.
There will be more than one ddsX_freqY file, which allows for There will be more than one out_altvoltageX_frequencyY file,
pin controlled FSK Frequency Shift Keying which allows for pin controlled FSK Frequency Shift Keying
(ddsX_pincontrol_freq_en is active) or the user can control (out_altvoltageX_pincontrol_frequency_en is active) or the user
the desired active tuning word by writing Y to the can control the desired active tuning word by writing Y to the
ddsX_freqsymbol file. 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 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Scale to be applied to ddsX_freqY in order to obtain the Scale to be applied to out_altvoltageX_frequencyY in order to
desired value in Hz. If shared across all frequency registers obtain the desired value in Hz. If shared across all frequency
Y is not present. It is also possible X is not present if registers Y is not present. It is also possible X is not present
shared across all channels. if shared across all channels.
What: /sys/bus/iio/devices/.../ddsX_freqsymbol What: /sys/bus/iio/devices/.../out_altvoltageX_frequencysymbol
KernelVersion: 2.6.37 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Specifies the active output frequency tuning word. The value Specifies the active output frequency tuning word. The value
corresponds to the Y in ddsX_freqY. To exit this mode the user corresponds to the Y in out_altvoltageX_frequencyY.
can write ddsX_pincontrol_freq_en or ddsX_out_enable file. 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 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Stores phase into Y. Stores phase into Y.
There will be more than one ddsX_phaseY file, which allows for There will be more than one out_altvoltageX_phaseY file, which
pin controlled PSK Phase Shift Keying allows for pin controlled PSK Phase Shift Keying
(ddsX_pincontrol_phase_en is active) or the user can (out_altvoltageX_pincontrol_phase_en is active) or the user can
control the desired phase Y which is added to the phase 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 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Scale to be applied to ddsX_phaseY in order to obtain the Scale to be applied to out_altvoltageX_phaseY in order to obtain
desired value in rad. If shared across all phase registers the desired value in rad. If shared across all phase registers
Y is not present. It is also possible X is not present if Y is not present. It is also possible X is not present if
shared across all channels. shared across all channels.
What: /sys/bus/iio/devices/.../ddsX_phasesymbol What: /sys/bus/iio/devices/.../out_altvoltageX_phasesymbol
KernelVersion: 2.6.37 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Specifies the active phase Y which is added to the phase Specifies the active phase Y which is added to the phase
accumulator output. The value corresponds to the Y in accumulator output. The value corresponds to the Y in
ddsX_phaseY. To exit this mode the user can write out_altvoltageX_phaseY. To exit this mode the user can write
ddsX_pincontrol_phase_en or disable file. out_altvoltageX_pincontrol_phase_en or disable file.
What: /sys/bus/iio/devices/.../ddsX_pincontrol_en What: /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_en
What: /sys/bus/iio/devices/.../ddsX_pincontrol_freq_en What: /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_frequency_en
What: /sys/bus/iio/devices/.../ddsX_pincontrol_phase_en What: /sys/bus/iio/devices/.../out_altvoltageX_pincontrol_phase_en
KernelVersion: 2.6.37 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
ddsX_pincontrol_en: Both, the active frequency and phase is out_altvoltageX_pincontrol_en: Both, the active frequency and
controlled by the respective phase and frequency control inputs. phase is controlled by the respective phase and frequency
In case the device in question allows to independent controls, control inputs. In case the device in features independent
then there are dedicated files (ddsX_pincontrol_freq_en, controls, then there are dedicated files
ddsX_pincontrol_phase_en). (out_altvoltageX_pincontrol_frequency_en,
out_altvoltageX_pincontrol_phase_en).
What: /sys/bus/iio/devices/.../ddsX_out_enable What: /sys/bus/iio/devices/.../out_altvoltageX_out_enable
What: /sys/bus/iio/devices/.../ddsX_outY_enable What: /sys/bus/iio/devices/.../out_altvoltageX_outY_enable
KernelVersion: 2.6.37 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
ddsX_outY_enable controls signal generation on output Y of out_altvoltageX_outY_enable controls signal generation on
channel X. Y may be suppressed if all channels are output Y of channel X. Y may be suppressed if all channels are
controlled together. controlled together.
What: /sys/bus/iio/devices/.../ddsX_outY_wavetype What: /sys/bus/iio/devices/.../out_altvoltageX_outY_wavetype
KernelVersion: 2.6.37 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
...@@ -86,7 +89,7 @@ Description: ...@@ -86,7 +89,7 @@ Description:
For a list of available output waveform options read For a list of available output waveform options read
available_output_modes. 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 KernelVersion: 2.6.37
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
......
...@@ -177,18 +177,18 @@ static IIO_DEV_ATTR_OUT_ENABLE(0, S_IWUSR, NULL, ...@@ -177,18 +177,18 @@ static IIO_DEV_ATTR_OUT_ENABLE(0, S_IWUSR, NULL,
ad9832_write, AD9832_OUTPUT_EN); ad9832_write, AD9832_OUTPUT_EN);
static struct attribute *ad9832_attributes[] = { static struct attribute *ad9832_attributes[] = {
&iio_dev_attr_dds0_freq0.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequency0.dev_attr.attr,
&iio_dev_attr_dds0_freq1.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequency1.dev_attr.attr,
&iio_const_attr_dds0_freq_scale.dev_attr.attr, &iio_const_attr_out_altvoltage0_frequency_scale.dev_attr.attr,
&iio_dev_attr_dds0_phase0.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase0.dev_attr.attr,
&iio_dev_attr_dds0_phase1.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase1.dev_attr.attr,
&iio_dev_attr_dds0_phase2.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase2.dev_attr.attr,
&iio_dev_attr_dds0_phase3.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase3.dev_attr.attr,
&iio_const_attr_dds0_phase_scale.dev_attr.attr, &iio_const_attr_out_altvoltage0_phase_scale.dev_attr.attr,
&iio_dev_attr_dds0_pincontrol_en.dev_attr.attr, &iio_dev_attr_out_altvoltage0_pincontrol_en.dev_attr.attr,
&iio_dev_attr_dds0_freqsymbol.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequencysymbol.dev_attr.attr,
&iio_dev_attr_dds0_phasesymbol.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phasesymbol.dev_attr.attr,
&iio_dev_attr_dds0_out_enable.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out_enable.dev_attr.attr,
NULL, NULL,
}; };
......
...@@ -218,7 +218,7 @@ static ssize_t ad9834_show_out0_wavetype_available(struct device *dev, ...@@ -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); ad9834_show_out0_wavetype_available, NULL, 0);
static ssize_t ad9834_show_out1_wavetype_available(struct device *dev, 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, ...@@ -237,7 +237,7 @@ static ssize_t ad9834_show_out1_wavetype_available(struct device *dev,
return sprintf(buf, "%s\n", str); 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); ad9834_show_out1_wavetype_available, NULL, 0);
/** /**
...@@ -263,36 +263,36 @@ static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 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 IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1);
static struct attribute *ad9834_attributes[] = { static struct attribute *ad9834_attributes[] = {
&iio_dev_attr_dds0_freq0.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequency0.dev_attr.attr,
&iio_dev_attr_dds0_freq1.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequency1.dev_attr.attr,
&iio_const_attr_dds0_freq_scale.dev_attr.attr, &iio_const_attr_out_altvoltage0_frequency_scale.dev_attr.attr,
&iio_dev_attr_dds0_phase0.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase0.dev_attr.attr,
&iio_dev_attr_dds0_phase1.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase1.dev_attr.attr,
&iio_const_attr_dds0_phase_scale.dev_attr.attr, &iio_const_attr_out_altvoltage0_phase_scale.dev_attr.attr,
&iio_dev_attr_dds0_pincontrol_en.dev_attr.attr, &iio_dev_attr_out_altvoltage0_pincontrol_en.dev_attr.attr,
&iio_dev_attr_dds0_freqsymbol.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequencysymbol.dev_attr.attr,
&iio_dev_attr_dds0_phasesymbol.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phasesymbol.dev_attr.attr,
&iio_dev_attr_dds0_out_enable.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out_enable.dev_attr.attr,
&iio_dev_attr_dds0_out1_enable.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out1_enable.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out0_wavetype.dev_attr.attr,
&iio_dev_attr_dds0_out1_wavetype.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out1_wavetype.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype_available.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out0_wavetype_available.dev_attr.attr,
&iio_dev_attr_dds0_out1_wavetype_available.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out1_wavetype_available.dev_attr.attr,
NULL, NULL,
}; };
static struct attribute *ad9833_attributes[] = { static struct attribute *ad9833_attributes[] = {
&iio_dev_attr_dds0_freq0.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequency0.dev_attr.attr,
&iio_dev_attr_dds0_freq1.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequency1.dev_attr.attr,
&iio_const_attr_dds0_freq_scale.dev_attr.attr, &iio_const_attr_out_altvoltage0_frequency_scale.dev_attr.attr,
&iio_dev_attr_dds0_phase0.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase0.dev_attr.attr,
&iio_dev_attr_dds0_phase1.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phase1.dev_attr.attr,
&iio_const_attr_dds0_phase_scale.dev_attr.attr, &iio_const_attr_out_altvoltage0_phase_scale.dev_attr.attr,
&iio_dev_attr_dds0_freqsymbol.dev_attr.attr, &iio_dev_attr_out_altvoltage0_frequencysymbol.dev_attr.attr,
&iio_dev_attr_dds0_phasesymbol.dev_attr.attr, &iio_dev_attr_out_altvoltage0_phasesymbol.dev_attr.attr,
&iio_dev_attr_dds0_out_enable.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out_enable.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out0_wavetype.dev_attr.attr,
&iio_dev_attr_dds0_out0_wavetype_available.dev_attr.attr, &iio_dev_attr_out_altvoltage0_out0_wavetype_available.dev_attr.attr,
NULL, NULL,
}; };
......
...@@ -7,104 +7,104 @@ ...@@ -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) \ #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) _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) \ #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) \ #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); _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) \ #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) _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) \ #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) \ #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); _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)\ #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); _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)\ #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); _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)\ #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); _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) \ #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); _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, \ #define IIO_DEV_ATTR_OUTY_ENABLE(_channel, _output, \
_mode, _show, _store, _addr) \ _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); _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) \ #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); 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)\ #define IIO_CONST_ATTR_OUT_WAVETYPES_AVAILABLE(_channel, _output, _modes)\
IIO_CONST_ATTR(dds##_channel##_out##_output##_wavetype_available,\ IIO_CONST_ATTR( \
_modes); out_altvoltage##_channel##_out##_output##_wavetype_available, _modes);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment