summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/adc/lpc32xx_adc.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2012-04-15 17:41:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-18 16:38:19 -0700
commitb11f98ff8c35d62523b2bfad07df3d756113aae3 (patch)
treea63f22e81068a70c5f532951216689dbe25c1c32 /drivers/staging/iio/adc/lpc32xx_adc.c
parent31313fc64d51bbd8979997f9d6670cc882c5f963 (diff)
downloadlinux-b11f98ff8c35d62523b2bfad07df3d756113aae3.tar.bz2
staging:iio:adc Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional. No processed values for adc's. Updated to include the spear adc driver (hence introducing a dependency on the patch that adds that driver). Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/adc/lpc32xx_adc.c')
-rw-r--r--drivers/staging/iio/adc/lpc32xx_adc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c
index dfc9033843a3..ce9320bb9e62 100644
--- a/drivers/staging/iio/adc/lpc32xx_adc.c
+++ b/drivers/staging/iio/adc/lpc32xx_adc.c
@@ -73,7 +73,7 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev,
{
struct lpc32xx_adc_info *info = iio_priv(indio_dev);
- if (mask == 0) {
+ if (mask == IIO_CHAN_INFO_RAW) {
mutex_lock(&indio_dev->mlock);
clk_enable(info->clk);
/* Measurement setup */
@@ -98,12 +98,13 @@ static const struct iio_info lpc32xx_adc_iio_info = {
.driver_module = THIS_MODULE,
};
-#define LPC32XX_ADC_CHANNEL(_index) { \
- .type = IIO_VOLTAGE, \
- .indexed = 1, \
- .channel = _index, \
- .address = AD_IN * _index, \
- .scan_index = _index, \
+#define LPC32XX_ADC_CHANNEL(_index) { \
+ .type = IIO_VOLTAGE, \
+ .indexed = 1, \
+ .channel = _index, \
+ .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, \
+ .address = AD_IN * _index, \
+ .scan_index = _index, \
}
static struct iio_chan_spec lpc32xx_adc_iio_channels[] = {