diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2010-12-14 11:04:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 15:23:03 -0500 |
commit | 4851d97d87c8dfa8c97037965690cdefe99a767d (patch) | |
tree | 4e1dc8766618b81342665d0cff28a55beb913db7 /drivers/staging | |
parent | f8ce33bbd57a0c9c302ebb273fd963c5efb1a264 (diff) |
Staging: IIO: dds.h convenience macros
Changes since RFC/v1:
IIO: Apply list review feedback
Apply list review feedback:
Rename attributes to fit IIO convention used in other drivers.
Provide ddsX_out_enable as opposed to ddsX_out_disable.
Fix typos.
Changes since v2:
IIO: dds.h: Apply more list review feedback
Fix mixture of X and [n] notation for indices.
Remove duplicated descriptions.
Add store methods to some dds convenience macros.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/iio/dds/dds.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/drivers/staging/iio/dds/dds.h b/drivers/staging/iio/dds/dds.h new file mode 100644 index 000000000000..d8ac3a93baf6 --- /dev/null +++ b/drivers/staging/iio/dds/dds.h | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * dds.h - sysfs attributes associated with DDS devices | ||
3 | * | ||
4 | * Copyright (c) 2010 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | /** | ||
10 | * /sys/bus/iio/devices/.../ddsX_freqY | ||
11 | */ | ||
12 | |||
13 | #define IIO_DEV_ATTR_FREQ(_channel, _num, _mode, _show, _store, _addr) \ | ||
14 | IIO_DEVICE_ATTR(dds##_channel##_freq##_num, \ | ||
15 | _mode, _show, _store, _addr) | ||
16 | |||
17 | /** | ||
18 | * /sys/bus/iio/devices/.../ddsX_freqY_scale | ||
19 | */ | ||
20 | |||
21 | #define IIO_CONST_ATTR_FREQ_SCALE(_channel, _string) \ | ||
22 | IIO_CONST_ATTR(dds##_channel##_freq_scale, _string) | ||
23 | |||
24 | /** | ||
25 | * /sys/bus/iio/devices/.../ddsX_freqsymbol | ||
26 | */ | ||
27 | |||
28 | #define IIO_DEV_ATTR_FREQSYMBOL(_channel, _mode, _show, _store, _addr) \ | ||
29 | IIO_DEVICE_ATTR(dds##_channel##_freqsymbol, \ | ||
30 | _mode, _show, _store, _addr); | ||
31 | |||
32 | /** | ||
33 | * /sys/bus/iio/devices/.../ddsX_phaseY | ||
34 | */ | ||
35 | |||
36 | #define IIO_DEV_ATTR_PHASE(_channel, _num, _mode, _show, _store, _addr) \ | ||
37 | IIO_DEVICE_ATTR(dds##_channel##_phase##_num, \ | ||
38 | _mode, _show, _store, _addr) | ||
39 | |||
40 | /** | ||
41 | * /sys/bus/iio/devices/.../ddsX_phaseY_scale | ||
42 | */ | ||
43 | |||
44 | #define IIO_CONST_ATTR_PHASE_SCALE(_channel, _string) \ | ||
45 | IIO_CONST_ATTR(dds##_channel##_phase_scale, _string) | ||
46 | |||
47 | /** | ||
48 | * /sys/bus/iio/devices/.../ddsX_phasesymbol | ||
49 | */ | ||
50 | |||
51 | #define IIO_DEV_ATTR_PHASESYMBOL(_channel, _mode, _show, _store, _addr) \ | ||
52 | IIO_DEVICE_ATTR(dds##_channel##_phasesymbol, \ | ||
53 | _mode, _show, _store, _addr); | ||
54 | |||
55 | /** | ||
56 | * /sys/bus/iio/devices/.../ddsX_pincontrol_en | ||
57 | */ | ||
58 | |||
59 | #define IIO_DEV_ATTR_PINCONTROL_EN(_channel, _mode, _show, _store, _addr)\ | ||
60 | IIO_DEVICE_ATTR(dds##_channel##_pincontrol_en, \ | ||
61 | _mode, _show, _store, _addr); | ||
62 | |||
63 | /** | ||
64 | * /sys/bus/iio/devices/.../ddsX_pincontrol_freq_en | ||
65 | */ | ||
66 | |||
67 | #define IIO_DEV_ATTR_PINCONTROL_FREQ_EN(_channel, _mode, _show, _store, _addr)\ | ||
68 | IIO_DEVICE_ATTR(dds##_channel##_pincontrol_freq_en, \ | ||
69 | _mode, _show, _store, _addr); | ||
70 | |||
71 | /** | ||
72 | * /sys/bus/iio/devices/.../ddsX_pincontrol_phase_en | ||
73 | */ | ||
74 | |||
75 | #define IIO_DEV_ATTR_PINCONTROL_PHASE_EN(_channel, _mode, _show, _store, _addr)\ | ||
76 | IIO_DEVICE_ATTR(dds##_channel##_pincontrol_phase_en, \ | ||
77 | _mode, _show, _store, _addr); | ||
78 | |||
79 | /** | ||
80 | * /sys/bus/iio/devices/.../ddsX_out_enable | ||
81 | */ | ||
82 | |||
83 | #define IIO_DEV_ATTR_OUT_ENABLE(_channel, _mode, _show, _store, _addr) \ | ||
84 | IIO_DEVICE_ATTR(dds##_channel##_out_enable, \ | ||
85 | _mode, _show, _store, _addr); | ||
86 | |||
87 | /** | ||
88 | * /sys/bus/iio/devices/.../ddsX_outY_enable | ||
89 | */ | ||
90 | |||
91 | #define IIO_DEV_ATTR_OUTY_ENABLE(_channel, _output, \ | ||
92 | _mode, _show, _store, _addr) \ | ||
93 | IIO_DEVICE_ATTR(dds##_channel##_out##_output##_enable, \ | ||
94 | _mode, _show, _store, _addr); | ||
95 | |||
96 | /** | ||
97 | * /sys/bus/iio/devices/.../ddsX_outY_wavetype | ||
98 | */ | ||
99 | |||
100 | #define IIO_DEV_ATTR_OUT_WAVETYPE(_channel, _output, _store, _addr) \ | ||
101 | IIO_DEVICE_ATTR(dds##_channel##_out##_output##_wavetype, \ | ||
102 | S_IWUSR, NULL, _store, _addr); | ||
103 | |||
104 | /** | ||
105 | * /sys/bus/iio/devices/.../ddsX_outY_wavetype_available | ||
106 | */ | ||
107 | |||
108 | #define IIO_CONST_ATTR_OUT_WAVETYPES_AVAILABLE(_channel, _output, _modes)\ | ||
109 | IIO_CONST_ATTR(dds##_channel##_out##_output##_wavetype_available,\ | ||
110 | _modes); | ||