~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to drivers/mfd/wm831x-i2c.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                                   int bytes, void *src)
52
52
{
53
53
        struct i2c_client *i2c = wm831x->control_data;
54
 
        unsigned char msg[bytes + 2];
 
54
        struct i2c_msg xfer[2];
55
55
        int ret;
56
56
 
57
57
        reg = cpu_to_be16(reg);
58
 
        memcpy(&msg[0], &reg, 2);
59
 
        memcpy(&msg[2], src, bytes);
60
 
 
61
 
        ret = i2c_master_send(i2c, msg, bytes + 2);
 
58
 
 
59
        xfer[0].addr = i2c->addr;
 
60
        xfer[0].flags = 0;
 
61
        xfer[0].len = 2;
 
62
        xfer[0].buf = (char *)®
 
63
 
 
64
        xfer[1].addr = i2c->addr;
 
65
        xfer[1].flags = I2C_M_NOSTART;
 
66
        xfer[1].len = bytes;
 
67
        xfer[1].buf = (char *)src;
 
68
 
 
69
        ret = i2c_transfer(i2c->adapter, xfer, 2);
62
70
        if (ret < 0)
63
71
                return ret;
64
 
        if (ret < bytes + 2)
 
72
        if (ret != 2)
65
73
                return -EIO;
66
74
 
67
75
        return 0;