~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/staging/iio/dac/ad5421.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include <linux/slab.h>
17
17
#include <linux/sysfs.h>
18
18
 
19
 
#include "../iio.h"
20
 
#include "../sysfs.h"
21
 
#include "../events.h"
 
19
#include <linux/iio/iio.h>
 
20
#include <linux/iio/sysfs.h>
 
21
#include <linux/iio/events.h>
22
22
#include "dac.h"
23
23
#include "ad5421.h"
24
24
 
87
87
                .indexed = 1,
88
88
                .output = 1,
89
89
                .channel = 0,
90
 
                .info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
 
90
                .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
 
91
                        IIO_CHAN_INFO_SCALE_SHARED_BIT |
91
92
                        IIO_CHAN_INFO_OFFSET_SHARED_BIT |
92
93
                        IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
93
94
                        IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
304
305
                return -EINVAL;
305
306
 
306
307
        switch (m) {
307
 
        case 0:
 
308
        case IIO_CHAN_INFO_RAW:
308
309
                ret = ad5421_read(indio_dev, AD5421_REG_DAC_DATA);
309
310
                if (ret < 0)
310
311
                        return ret;
340
341
        const unsigned int max_val = 1 << 16;
341
342
 
342
343
        switch (mask) {
343
 
        case 0:
 
344
        case IIO_CHAN_INFO_RAW:
344
345
                if (val >= max_val || val < 0)
345
346
                        return -EINVAL;
346
347
 
456
457
        struct ad5421_state *st;
457
458
        int ret;
458
459
 
459
 
        indio_dev = iio_allocate_device(sizeof(*st));
 
460
        indio_dev = iio_device_alloc(sizeof(*st));
460
461
        if (indio_dev == NULL) {
461
462
                dev_err(&spi->dev, "Failed to allocate iio device\n");
462
463
                return  -ENOMEM;
511
512
        if (spi->irq)
512
513
                free_irq(spi->irq, indio_dev);
513
514
error_free:
514
 
        iio_free_device(indio_dev);
 
515
        iio_device_free(indio_dev);
515
516
 
516
517
        return ret;
517
518
}
523
524
        iio_device_unregister(indio_dev);
524
525
        if (spi->irq)
525
526
                free_irq(spi->irq, indio_dev);
526
 
        iio_free_device(indio_dev);
 
527
        iio_device_free(indio_dev);
527
528
 
528
529
        return 0;
529
530
}