diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-02-19 16:12:21 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-03-17 15:49:15 -0400 |
commit | fa357a6a48420ff6dac6425b235830036ff3dc47 (patch) | |
tree | c1a9323f4de4afa14b50381276854a3bd563f305 /drivers | |
parent | f6e52e59c809c8d5f0fcdfe6f04fbce1013e2e50 (diff) |
staging:iio:dummy move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/iio/iio_simple_dummy.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c index aee76c710a3b..0193e1796b18 100644 --- a/drivers/staging/iio/iio_simple_dummy.c +++ b/drivers/staging/iio/iio_simple_dummy.c | |||
@@ -71,25 +71,25 @@ static const struct iio_chan_spec iio_dummy_channels[] = { | |||
71 | .indexed = 1, | 71 | .indexed = 1, |
72 | .channel = 0, | 72 | .channel = 0, |
73 | /* What other information is available? */ | 73 | /* What other information is available? */ |
74 | .info_mask = | 74 | .info_mask_separate = |
75 | /* | 75 | /* |
76 | * in_voltage0_raw | 76 | * in_voltage0_raw |
77 | * Raw (unscaled no bias removal etc) measurement | 77 | * Raw (unscaled no bias removal etc) measurement |
78 | * from the device. | 78 | * from the device. |
79 | */ | 79 | */ |
80 | IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 80 | BIT(IIO_CHAN_INFO_RAW) | |
81 | /* | 81 | /* |
82 | * in_voltage0_offset | 82 | * in_voltage0_offset |
83 | * Offset for userspace to apply prior to scale | 83 | * Offset for userspace to apply prior to scale |
84 | * when converting to standard units (microvolts) | 84 | * when converting to standard units (microvolts) |
85 | */ | 85 | */ |
86 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | | 86 | BIT(IIO_CHAN_INFO_OFFSET) | |
87 | /* | 87 | /* |
88 | * in_voltage0_scale | 88 | * in_voltage0_scale |
89 | * Multipler for userspace to apply post offset | 89 | * Multipler for userspace to apply post offset |
90 | * when converting to standard units (microvolts) | 90 | * when converting to standard units (microvolts) |
91 | */ | 91 | */ |
92 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, | 92 | BIT(IIO_CHAN_INFO_SCALE), |
93 | /* The ordering of elements in the buffer via an enum */ | 93 | /* The ordering of elements in the buffer via an enum */ |
94 | .scan_index = voltage0, | 94 | .scan_index = voltage0, |
95 | .scan_type = { /* Description of storage in buffer */ | 95 | .scan_type = { /* Description of storage in buffer */ |
@@ -118,19 +118,18 @@ static const struct iio_chan_spec iio_dummy_channels[] = { | |||
118 | .indexed = 1, | 118 | .indexed = 1, |
119 | .channel = 1, | 119 | .channel = 1, |
120 | .channel2 = 2, | 120 | .channel2 = 2, |
121 | .info_mask = | ||
122 | /* | 121 | /* |
123 | * in_voltage1-voltage2_raw | 122 | * in_voltage1-voltage2_raw |
124 | * Raw (unscaled no bias removal etc) measurement | 123 | * Raw (unscaled no bias removal etc) measurement |
125 | * from the device. | 124 | * from the device. |
126 | */ | 125 | */ |
127 | IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 126 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), |
128 | /* | 127 | /* |
129 | * in_voltage-voltage_scale | 128 | * in_voltage-voltage_scale |
130 | * Shared version of scale - shared by differential | 129 | * Shared version of scale - shared by differential |
131 | * input channels of type IIO_VOLTAGE. | 130 | * input channels of type IIO_VOLTAGE. |
132 | */ | 131 | */ |
133 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 132 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), |
134 | .scan_index = diffvoltage1m2, | 133 | .scan_index = diffvoltage1m2, |
135 | .scan_type = { /* Description of storage in buffer */ | 134 | .scan_type = { /* Description of storage in buffer */ |
136 | .sign = 's', /* signed */ | 135 | .sign = 's', /* signed */ |
@@ -146,9 +145,8 @@ static const struct iio_chan_spec iio_dummy_channels[] = { | |||
146 | .indexed = 1, | 145 | .indexed = 1, |
147 | .channel = 3, | 146 | .channel = 3, |
148 | .channel2 = 4, | 147 | .channel2 = 4, |
149 | .info_mask = | 148 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), |
150 | IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 149 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), |
151 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | ||
152 | .scan_index = diffvoltage3m4, | 150 | .scan_index = diffvoltage3m4, |
153 | .scan_type = { | 151 | .scan_type = { |
154 | .sign = 's', | 152 | .sign = 's', |
@@ -166,15 +164,14 @@ static const struct iio_chan_spec iio_dummy_channels[] = { | |||
166 | .modified = 1, | 164 | .modified = 1, |
167 | /* Channel 2 is use for modifiers */ | 165 | /* Channel 2 is use for modifiers */ |
168 | .channel2 = IIO_MOD_X, | 166 | .channel2 = IIO_MOD_X, |
169 | .info_mask = | 167 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | |
170 | IIO_CHAN_INFO_RAW_SEPARATE_BIT | | ||
171 | /* | 168 | /* |
172 | * Internal bias correction value. Applied | 169 | * Internal bias correction value. Applied |
173 | * by the hardware or driver prior to userspace | 170 | * by the hardware or driver prior to userspace |
174 | * seeing the readings. Typically part of hardware | 171 | * seeing the readings. Typically part of hardware |
175 | * calibration. | 172 | * calibration. |
176 | */ | 173 | */ |
177 | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT, | 174 | BIT(IIO_CHAN_INFO_CALIBBIAS), |
178 | .scan_index = accelx, | 175 | .scan_index = accelx, |
179 | .scan_type = { /* Description of storage in buffer */ | 176 | .scan_type = { /* Description of storage in buffer */ |
180 | .sign = 's', /* signed */ | 177 | .sign = 's', /* signed */ |
@@ -191,7 +188,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = { | |||
191 | /* DAC channel out_voltage0_raw */ | 188 | /* DAC channel out_voltage0_raw */ |
192 | { | 189 | { |
193 | .type = IIO_VOLTAGE, | 190 | .type = IIO_VOLTAGE, |
194 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, | 191 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), |
195 | .output = 1, | 192 | .output = 1, |
196 | .indexed = 1, | 193 | .indexed = 1, |
197 | .channel = 0, | 194 | .channel = 0, |
@@ -204,8 +201,8 @@ static const struct iio_chan_spec iio_dummy_channels[] = { | |||
204 | * @chan: the channel whose data is to be read | 201 | * @chan: the channel whose data is to be read |
205 | * @val: first element of returned value (typically INT) | 202 | * @val: first element of returned value (typically INT) |
206 | * @val2: second element of returned value (typically MICRO) | 203 | * @val2: second element of returned value (typically MICRO) |
207 | * @mask: what we actually want to read. 0 is the channel, everything else | 204 | * @mask: what we actually want to read as per the info_mask_* |
208 | * is as per the info_mask in iio_chan_spec. | 205 | * in iio_chan_spec. |
209 | */ | 206 | */ |
210 | static int iio_dummy_read_raw(struct iio_dev *indio_dev, | 207 | static int iio_dummy_read_raw(struct iio_dev *indio_dev, |
211 | struct iio_chan_spec const *chan, | 208 | struct iio_chan_spec const *chan, |
@@ -287,8 +284,8 @@ static int iio_dummy_read_raw(struct iio_dev *indio_dev, | |||
287 | * @chan: the channel whose data is to be written | 284 | * @chan: the channel whose data is to be written |
288 | * @val: first element of value to set (typically INT) | 285 | * @val: first element of value to set (typically INT) |
289 | * @val2: second element of value to set (typically MICRO) | 286 | * @val2: second element of value to set (typically MICRO) |
290 | * @mask: what we actually want to write. 0 is the channel, everything else | 287 | * @mask: what we actually want to write as per the info_mask_* |
291 | * is as per the info_mask in iio_chan_spec. | 288 | * in iio_chan_spec. |
292 | * | 289 | * |
293 | * Note that all raw writes are assumed IIO_VAL_INT and info mask elements | 290 | * Note that all raw writes are assumed IIO_VAL_INT and info mask elements |
294 | * are assumed to be IIO_INT_PLUS_MICRO unless the callback write_raw_get_fmt | 291 | * are assumed to be IIO_INT_PLUS_MICRO unless the callback write_raw_get_fmt |