diff options
author | Zubair Lutfullah <zubair.lutfullah@gmail.com> | 2013-09-19 06:24:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-21 10:47:53 (GMT) |
commit | 0f6fc7d56fe56aad5410fdaa7cebbb918580a33c (patch) | |
tree | e5c360c8d25c50294690c9b009678287c65b406e /drivers | |
parent | baee539915e9e89bdebb369229bc0684c86feac2 (diff) | |
download | linux-fsl-qoriq-0f6fc7d56fe56aad5410fdaa7cebbb918580a33c.tar.xz |
iio: ti_am335x_adc: optimize memory usage
12 bit ADC data is stored in 32 bits of storage.
Change from u32 to u16 to reduce wasted memory.
Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index a952538..ebe93eb 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -122,7 +122,7 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels) chan->datasheet_name = chan_name_ain[chan->channel]; chan->scan_type.sign = 'u'; chan->scan_type.realbits = 12; - chan->scan_type.storagebits = 32; + chan->scan_type.storagebits = 16; } indio_dev->channels = chan_array; @@ -186,7 +186,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, if (stepid == map_val) { read = read & FIFOREAD_DATA_MASK; found = true; - *val = read; + *val = (u16) read; } } |