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

« back to all changes in this revision

Viewing changes to drivers/staging/iio/meter/ade7854-i2c.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:
12
12
#include <linux/slab.h>
13
13
#include <linux/module.h>
14
14
 
15
 
#include "../iio.h"
 
15
#include <linux/iio/iio.h>
16
16
#include "ade7854.h"
17
17
 
18
18
static int ade7854_i2c_write_reg_8(struct device *dev,
20
20
                u8 value)
21
21
{
22
22
        int ret;
23
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
23
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
24
24
        struct ade7854_state *st = iio_priv(indio_dev);
25
25
 
26
26
        mutex_lock(&st->buf_lock);
39
39
                u16 value)
40
40
{
41
41
        int ret;
42
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
42
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
43
43
        struct ade7854_state *st = iio_priv(indio_dev);
44
44
 
45
45
        mutex_lock(&st->buf_lock);
59
59
                u32 value)
60
60
{
61
61
        int ret;
62
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
62
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
63
63
        struct ade7854_state *st = iio_priv(indio_dev);
64
64
 
65
65
        mutex_lock(&st->buf_lock);
80
80
                u32 value)
81
81
{
82
82
        int ret;
83
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
83
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
84
84
        struct ade7854_state *st = iio_priv(indio_dev);
85
85
 
86
86
        mutex_lock(&st->buf_lock);
101
101
                u16 reg_address,
102
102
                u8 *val)
103
103
{
104
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
104
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
105
105
        struct ade7854_state *st = iio_priv(indio_dev);
106
106
        int ret;
107
107
 
127
127
                u16 reg_address,
128
128
                u16 *val)
129
129
{
130
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
130
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
131
131
        struct ade7854_state *st = iio_priv(indio_dev);
132
132
        int ret;
133
133
 
153
153
                u16 reg_address,
154
154
                u32 *val)
155
155
{
156
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
156
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
157
157
        struct ade7854_state *st = iio_priv(indio_dev);
158
158
        int ret;
159
159
 
179
179
                u16 reg_address,
180
180
                u32 *val)
181
181
{
182
 
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
182
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
183
183
        struct ade7854_state *st = iio_priv(indio_dev);
184
184
        int ret;
185
185
 
208
208
        struct ade7854_state *st;
209
209
        struct iio_dev *indio_dev;
210
210
 
211
 
        indio_dev = iio_allocate_device(sizeof(*st));
 
211
        indio_dev = iio_device_alloc(sizeof(*st));
212
212
        if (indio_dev == NULL)
213
213
                return -ENOMEM;
214
214
        st = iio_priv(indio_dev);
226
226
 
227
227
        ret = ade7854_probe(indio_dev, &client->dev);
228
228
        if (ret)
229
 
                iio_free_device(indio_dev);
 
229
                iio_device_free(indio_dev);
230
230
 
231
231
        return ret;
232
232
}