iio:dac:m62332: share scale and offset
authorHartmut Knaack <knaack.h@gmx.de>
Fri, 28 Aug 2015 21:59:53 +0000 (23:59 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 11 Oct 2015 14:39:37 +0000 (15:39 +0100)
This device simply uses its Vcc as reference voltage, so the same scale
applies for all channels. Also offset doesn't appear to be different for
any channel. Represent this by switching these two attributes to
info_mask_shared_by_type.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/dac/m62332.c

index c23d7fa889ee3fb3a524fd1e7efb144026c7f44e..cffc0630ed327626b289bb25088492ee545f4d13 100644 (file)
@@ -173,15 +173,15 @@ static const struct iio_info m62332_info = {
        .driver_module = THIS_MODULE,
 };
 
-#define M62332_CHANNEL(chan) {                         \
-       .type = IIO_VOLTAGE,                            \
-       .indexed = 1,                                   \
-       .output = 1,                                    \
-       .channel = (chan),                              \
-       .datasheet_name = "CH" #chan,                   \
-       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
-               BIT(IIO_CHAN_INFO_SCALE) |              \
-               BIT(IIO_CHAN_INFO_OFFSET),              \
+#define M62332_CHANNEL(chan) {                                 \
+       .type = IIO_VOLTAGE,                                    \
+       .indexed = 1,                                           \
+       .output = 1,                                            \
+       .channel = (chan),                                      \
+       .datasheet_name = "CH" #chan,                           \
+       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),           \
+       .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |  \
+                                   BIT(IIO_CHAN_INFO_OFFSET),  \
 }
 
 static const struct iio_chan_spec m62332_channels[M62332_CHANNELS] = {