28 Oct
2014
28 Oct
'14
11:29 p.m.
On Mon, Oct 27, 2014 at 10:52:31AM +0800, Oder Chiou wrote:
- /* Write register */
- r[0] = reg & 0xff;
- xfer[0].addr = client->addr;
- xfer[0].flags = 0;
- xfer[0].len = 1;
- xfer[0].buf = &r[0];
- /* Read data */
- xfer[1].addr = client->addr;
- xfer[1].flags = I2C_M_RD;
- xfer[1].len = 2;
- xfer[1].buf = data;
- ret = i2c_transfer(client->adapter, xfer, 2);
- if (ret != 2) {
dev_err(&client->dev, "i2c_transfer() returned %d\n", ret);
return -EIO;
- }
This looks like standard regmap stuff - what's different?