Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197220
b: refs/heads/master
c: 1722762
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 5b75c25 commit d976afa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5cba220b0a3211befd5514cbd822a97578ef5ed4
refs/heads/master: 1722762cead933994883fa57464efd45cf892ed7
36 changes: 15 additions & 21 deletions trunk/drivers/staging/iio/ring_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,25 +196,6 @@ ssize_t iio_scan_el_store(struct device *dev, struct device_attribute *attr,
**/
ssize_t iio_scan_el_show(struct device *dev, struct device_attribute *attr,
char *buf);
/**
* IIO_SCAN_EL - declare and initialize a scan element without control func
* @_name: identifying name. Resulting struct is iio_scan_el_##_name,
* sysfs element, scan_en_##_name.
* @_number: unique id number for the scan element.
* @_bits: number of bits in the scan element result (used in mixed bit
* length devices).
* @_label: indentification variable used by drivers. Often a reg address.
**/
#define IIO_SCAN_EL(_name, _number, _bits, _label) \
struct iio_scan_el iio_scan_el_##_name = { \
.dev_attr = __ATTR(scan_en_##_name, \
S_IRUGO | S_IWUSR, \
iio_scan_el_show, \
iio_scan_el_store), \
.mask = (1 << _number), \
.bit_count = _bits, \
.label = _label, \
}

ssize_t iio_scan_el_ts_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t len);
Expand All @@ -225,7 +206,7 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
* IIO_SCAN_EL_C - declare and initialize a scan element with a control func
*
* @_name: identifying name. Resulting struct is iio_scan_el_##_name,
* sysfs element, scan_en_##_name.
* sysfs element, _name##_en.
* @_number: unique id number for the scan element.
* @_bits: number of bits in the scan element result (used in mixed bit
* length devices).
Expand All @@ -234,7 +215,7 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
**/
#define IIO_SCAN_EL_C(_name, _number, _bits, _label, _controlfunc) \
struct iio_scan_el iio_scan_el_##_name = { \
.dev_attr = __ATTR(scan_en_##_name, \
.dev_attr = __ATTR(_number##_##_name##_en, \
S_IRUGO | S_IWUSR, \
iio_scan_el_show, \
iio_scan_el_store), \
Expand All @@ -243,6 +224,19 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
.label = _label, \
.set_state = _controlfunc, \
}

#define IIO_SCAN_NAMED_EL_C(_name, _string, _number, _bits, _label, _cf) \
struct iio_scan_el iio_scan_el_##_name = { \
.dev_attr = __ATTR(_number##_##_string##_en, \
S_IRUGO | S_IWUSR, \
iio_scan_el_show, \
iio_scan_el_store), \
.number = _number, \
.bit_count = _bits, \
.label = _label, \
.set_state = _cf, \
}

/**
* IIO_SCAN_EL_TIMESTAMP - declare a special scan element for timestamps
*
Expand Down

0 comments on commit d976afa

Please sign in to comment.