staging:iio: Add new in_raw definitions for adc channels.
authorJonathan Cameron <jic23@cam.ac.uk>
Tue, 4 May 2010 13:42:56 +0000 (14:42 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:36:04 +0000 (11:36 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/adc/adc.h
drivers/staging/iio/sysfs.h

index d925b2c5e38ea9bcf35b379ecbac2ad8a7a65b92..46f0d08b4769a0053ece3fae170f33dc520935e3 100644 (file)
@@ -9,5 +9,17 @@
  *
  */
 
+/* Deprecated */
 #define IIO_DEV_ATTR_ADC(_num, _show, _addr)                   \
   IIO_DEVICE_ATTR(adc_##_num, S_IRUGO, _show, NULL, _addr)
+
+#define IIO_DEV_ATTR_IN_RAW(_num, _show, _addr)                                \
+       IIO_DEVICE_ATTR(in##_num##_raw, S_IRUGO, _show, NULL, _addr)
+
+#define IIO_DEV_ATTR_IN_DIFF_RAW(_nump, _numn, _show, _addr)           \
+       IIO_DEVICE_ATTR_NAMED(in##_nump##min##_numn##_raw,              \
+                             in##_nump-in##_numn##_raw,                \
+                             S_IRUGO,                                  \
+                             _show,                                    \
+                             NULL,                                     \
+                             _addr)
index e501e1338e11bb3491af13b2845fd6cd8fdb073d..d8fe0e276036a0b79cfbe4ae14e4840fc8d90e79 100644 (file)
@@ -98,6 +98,9 @@ struct iio_const_attr {
        struct iio_dev_attr iio_dev_attr_##_name                \
        = IIO_ATTR(_name, _mode, _show, _store, _addr)
 
+#define IIO_DEVICE_ATTR_NAMED(_vname, _name, _mode, _show, _store, _addr) \
+       struct iio_dev_attr iio_dev_attr_##_vname                       \
+       = IIO_ATTR(_name, _mode, _show, _store, _addr)
 
 #define IIO_DEVICE_ATTR_2(_name, _mode, _show, _store, _addr, _val2)   \
        struct iio_dev_attr iio_dev_attr_##_name                        \