iio: adc: ad7606: Move common channel definition to header
authorBeniamin Bia <beniamin.bia@analog.com>
Thu, 18 Jul 2019 06:27:30 +0000 (09:27 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 28 Jul 2019 07:53:18 +0000 (08:53 +0100)
The common channel definition which are going to be used by both core
file but also spi file, were moved in header file. Some devices have
different channel definitions when are used in software mode, feature
available only with spi, and those definitions will be added in spi file.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7606.c
drivers/iio/adc/ad7606.h

index aba0fd123a51bb714aa767235915639e1b777ee7..a49dc106a21c5ad108ec491914e4cb6d92497685 100644 (file)
@@ -308,29 +308,6 @@ static const struct attribute_group ad7606_attribute_group_range = {
        .attrs = ad7606_attributes_range,
 };
 
-#define AD760X_CHANNEL(num, mask) {                            \
-               .type = IIO_VOLTAGE,                            \
-               .indexed = 1,                                   \
-               .channel = num,                                 \
-               .address = num,                                 \
-               .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),   \
-               .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\
-               .info_mask_shared_by_all = mask,                \
-               .scan_index = num,                              \
-               .scan_type = {                                  \
-                       .sign = 's',                            \
-                       .realbits = 16,                         \
-                       .storagebits = 16,                      \
-                       .endianness = IIO_CPU,                  \
-               },                                              \
-}
-
-#define AD7605_CHANNEL(num)    \
-       AD760X_CHANNEL(num, 0)
-
-#define AD7606_CHANNEL(num)    \
-       AD760X_CHANNEL(num, BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO))
-
 static const struct iio_chan_spec ad7605_channels[] = {
        IIO_CHAN_SOFT_TIMESTAMP(4),
        AD7605_CHANNEL(0),
index d8a509c2c428c2ebc07b1329ac043b8897bb01e4..d547e88f4c9d14bbba66d73049eb97ad97d3f0cd 100644 (file)
@@ -8,6 +8,29 @@
 #ifndef IIO_ADC_AD7606_H_
 #define IIO_ADC_AD7606_H_
 
+#define AD760X_CHANNEL(num, mask) {                            \
+               .type = IIO_VOLTAGE,                            \
+               .indexed = 1,                                   \
+               .channel = num,                                 \
+               .address = num,                                 \
+               .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),   \
+               .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\
+               .info_mask_shared_by_all = mask,                \
+               .scan_index = num,                              \
+               .scan_type = {                                  \
+                       .sign = 's',                            \
+                       .realbits = 16,                         \
+                       .storagebits = 16,                      \
+                       .endianness = IIO_CPU,                  \
+               },                                              \
+}
+
+#define AD7605_CHANNEL(num)    \
+       AD760X_CHANNEL(num, 0)
+
+#define AD7606_CHANNEL(num)    \
+       AD760X_CHANNEL(num, BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO))
+
 /**
  * struct ad7606_chip_info - chip specific information
  * @channels:          channel specification