Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331159
b: refs/heads/master
c: 058fef6
h: refs/heads/master
i:
  331157: e581a03
  331155: 6e88876
  331151: 9337d37
v: v3
  • Loading branch information
Shubhrajyoti D authored and Mauro Carvalho Chehab committed Sep 27, 2012
1 parent 598e96a commit 5286e5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c43737aac95bdd005a0ee459b006c7e0f8a5519d
refs/heads/master: 058fef68ff081401f6325a76a37356c2584ea029
23 changes: 17 additions & 6 deletions trunk/drivers/media/radio/si470x/radio-si470x-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ int si470x_get_register(struct si470x_device *radio, int regnr)
{
u16 buf[READ_REG_NUM];
struct i2c_msg msgs[1] = {
{ radio->client->addr, I2C_M_RD, sizeof(u16) * READ_REG_NUM,
(void *)buf },
{
.addr = radio->client->addr,
.flags = I2C_M_RD,
.len = sizeof(u16) * READ_REG_NUM,
.buf = (void *)buf
},
};

if (i2c_transfer(radio->client->adapter, msgs, 1) != 1)
Expand All @@ -119,8 +123,11 @@ int si470x_set_register(struct si470x_device *radio, int regnr)
int i;
u16 buf[WRITE_REG_NUM];
struct i2c_msg msgs[1] = {
{ radio->client->addr, 0, sizeof(u16) * WRITE_REG_NUM,
(void *)buf },
{
.addr = radio->client->addr,
.len = sizeof(u16) * WRITE_REG_NUM,
.buf = (void *)buf
},
};

for (i = 0; i < WRITE_REG_NUM; i++)
Expand All @@ -146,8 +153,12 @@ static int si470x_get_all_registers(struct si470x_device *radio)
int i;
u16 buf[READ_REG_NUM];
struct i2c_msg msgs[1] = {
{ radio->client->addr, I2C_M_RD, sizeof(u16) * READ_REG_NUM,
(void *)buf },
{
.addr = radio->client->addr,
.flags = I2C_M_RD,
.len = sizeof(u16) * READ_REG_NUM,
.buf = (void *)buf
},
};

if (i2c_transfer(radio->client->adapter, msgs, 1) != 1)
Expand Down

0 comments on commit 5286e5d

Please sign in to comment.