diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-05-04 09:43:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 14:36:05 -0400 |
commit | 1722762cead933994883fa57464efd45cf892ed7 (patch) | |
tree | 778b67994337be7e55e5fc7411159564f933cfcb | |
parent | 5cba220b0a3211befd5514cbd822a97578ef5ed4 (diff) |
staging:iio: Clean out unused IIO_SCAN_EL and add IIO_SCAN_NAMED_EL_C
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/iio/ring_generic.h | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h index c482074dead..d74b5aea011 100644 --- a/drivers/staging/iio/ring_generic.h +++ b/drivers/staging/iio/ring_generic.h | |||
@@ -196,25 +196,6 @@ ssize_t iio_scan_el_store(struct device *dev, struct device_attribute *attr, | |||
196 | **/ | 196 | **/ |
197 | ssize_t iio_scan_el_show(struct device *dev, struct device_attribute *attr, | 197 | ssize_t iio_scan_el_show(struct device *dev, struct device_attribute *attr, |
198 | char *buf); | 198 | char *buf); |
199 | /** | ||
200 | * IIO_SCAN_EL - declare and initialize a scan element without control func | ||
201 | * @_name: identifying name. Resulting struct is iio_scan_el_##_name, | ||
202 | * sysfs element, scan_en_##_name. | ||
203 | * @_number: unique id number for the scan element. | ||
204 | * @_bits: number of bits in the scan element result (used in mixed bit | ||
205 | * length devices). | ||
206 | * @_label: indentification variable used by drivers. Often a reg address. | ||
207 | **/ | ||
208 | #define IIO_SCAN_EL(_name, _number, _bits, _label) \ | ||
209 | struct iio_scan_el iio_scan_el_##_name = { \ | ||
210 | .dev_attr = __ATTR(scan_en_##_name, \ | ||
211 | S_IRUGO | S_IWUSR, \ | ||
212 | iio_scan_el_show, \ | ||
213 | iio_scan_el_store), \ | ||
214 | .mask = (1 << _number), \ | ||
215 | .bit_count = _bits, \ | ||
216 | .label = _label, \ | ||
217 | } | ||
218 | 199 | ||
219 | ssize_t iio_scan_el_ts_store(struct device *dev, struct device_attribute *attr, | 200 | ssize_t iio_scan_el_ts_store(struct device *dev, struct device_attribute *attr, |
220 | const char *buf, size_t len); | 201 | const char *buf, size_t len); |
@@ -225,7 +206,7 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr, | |||
225 | * IIO_SCAN_EL_C - declare and initialize a scan element with a control func | 206 | * IIO_SCAN_EL_C - declare and initialize a scan element with a control func |
226 | * | 207 | * |
227 | * @_name: identifying name. Resulting struct is iio_scan_el_##_name, | 208 | * @_name: identifying name. Resulting struct is iio_scan_el_##_name, |
228 | * sysfs element, scan_en_##_name. | 209 | * sysfs element, _name##_en. |
229 | * @_number: unique id number for the scan element. | 210 | * @_number: unique id number for the scan element. |
230 | * @_bits: number of bits in the scan element result (used in mixed bit | 211 | * @_bits: number of bits in the scan element result (used in mixed bit |
231 | * length devices). | 212 | * length devices). |
@@ -234,7 +215,7 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr, | |||
234 | **/ | 215 | **/ |
235 | #define IIO_SCAN_EL_C(_name, _number, _bits, _label, _controlfunc) \ | 216 | #define IIO_SCAN_EL_C(_name, _number, _bits, _label, _controlfunc) \ |
236 | struct iio_scan_el iio_scan_el_##_name = { \ | 217 | struct iio_scan_el iio_scan_el_##_name = { \ |
237 | .dev_attr = __ATTR(scan_en_##_name, \ | 218 | .dev_attr = __ATTR(_number##_##_name##_en, \ |
238 | S_IRUGO | S_IWUSR, \ | 219 | S_IRUGO | S_IWUSR, \ |
239 | iio_scan_el_show, \ | 220 | iio_scan_el_show, \ |
240 | iio_scan_el_store), \ | 221 | iio_scan_el_store), \ |
@@ -243,6 +224,19 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr, | |||
243 | .label = _label, \ | 224 | .label = _label, \ |
244 | .set_state = _controlfunc, \ | 225 | .set_state = _controlfunc, \ |
245 | } | 226 | } |
227 | |||
228 | #define IIO_SCAN_NAMED_EL_C(_name, _string, _number, _bits, _label, _cf) \ | ||
229 | struct iio_scan_el iio_scan_el_##_name = { \ | ||
230 | .dev_attr = __ATTR(_number##_##_string##_en, \ | ||
231 | S_IRUGO | S_IWUSR, \ | ||
232 | iio_scan_el_show, \ | ||
233 | iio_scan_el_store), \ | ||
234 | .number = _number, \ | ||
235 | .bit_count = _bits, \ | ||
236 | .label = _label, \ | ||
237 | .set_state = _cf, \ | ||
238 | } | ||
239 | |||
246 | /** | 240 | /** |
247 | * IIO_SCAN_EL_TIMESTAMP - declare a special scan element for timestamps | 241 | * IIO_SCAN_EL_TIMESTAMP - declare a special scan element for timestamps |
248 | * | 242 | * |