Commit ad313b1062f0e16e5fa64e1a34eec37e1b8a3341

Authored by Jonathan Cameron
Committed by Greg Kroah-Hartman
1 parent 495c57f5f0

staging:iio: Add new in_raw definitions for adc channels.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 2 changed files with 15 additions and 0 deletions Side-by-side Diff

drivers/staging/iio/adc/adc.h
... ... @@ -9,6 +9,18 @@
9 9 *
10 10 */
11 11  
  12 +/* Deprecated */
12 13 #define IIO_DEV_ATTR_ADC(_num, _show, _addr) \
13 14 IIO_DEVICE_ATTR(adc_##_num, S_IRUGO, _show, NULL, _addr)
  15 +
  16 +#define IIO_DEV_ATTR_IN_RAW(_num, _show, _addr) \
  17 + IIO_DEVICE_ATTR(in##_num##_raw, S_IRUGO, _show, NULL, _addr)
  18 +
  19 +#define IIO_DEV_ATTR_IN_DIFF_RAW(_nump, _numn, _show, _addr) \
  20 + IIO_DEVICE_ATTR_NAMED(in##_nump##min##_numn##_raw, \
  21 + in##_nump-in##_numn##_raw, \
  22 + S_IRUGO, \
  23 + _show, \
  24 + NULL, \
  25 + _addr)
drivers/staging/iio/sysfs.h
... ... @@ -98,6 +98,9 @@
98 98 struct iio_dev_attr iio_dev_attr_##_name \
99 99 = IIO_ATTR(_name, _mode, _show, _store, _addr)
100 100  
  101 +#define IIO_DEVICE_ATTR_NAMED(_vname, _name, _mode, _show, _store, _addr) \
  102 + struct iio_dev_attr iio_dev_attr_##_vname \
  103 + = IIO_ATTR(_name, _mode, _show, _store, _addr)
101 104  
102 105 #define IIO_DEVICE_ATTR_2(_name, _mode, _show, _store, _addr, _val2) \
103 106 struct iio_dev_attr iio_dev_attr_##_name \